Galon Cloud
Galon API v1

/templates

Base URL https://api.galon.ai/v1 · export GALON_API_BASE="https://api.galon.ai/v1"

GET /templates

List the project's templates

API key (Bearer), on the public API endpoint.

Parameters

NameInTypeDescription
limitqueryinteger
afterquerystring

Responses

StatusDescriptionBody
200Page of templatesTemplateListResponse
403scope_missing (template:read)
422pagination_invalid
503mail_contacts_unavailable

Examples

curl

curl -X GET "$GALON_API_BASE/templates" \
  -H "Authorization: Bearer $GALON_API_KEY"

Node.js (SDK)

import { Galon } from "galon";

const galon = new Galon(process.env.GALON_API_KEY);
const result = await galon.templates.list({ limit: 20 });

Python (SDK)

from galon import Galon

galon = Galon()  # reads GALON_API_KEY
result = galon.templates.list({"limit": 20})

POST /templates

Create a versioned template draft

API key (Bearer), on the public API endpoint.

Request body

application/json · schema TemplateCreate

FieldTypeDescription
namestring · required
aliasstring | null
subjectstring | nullAt most 200 UTF-8 bytes, no CR/LF.
htmlstring | nullAt most 48 KiB UTF-8; each line stays under 998 bytes.
textstring | nullAt most 48 KiB UTF-8; each line stays under 998 bytes.
variablesarray<TemplateVariable>
fromstring | null
reply_tostring | null

Responses

StatusDescriptionBody
201Draft createdTemplate
403scope_missing (template:write)
409template_alias_exists
413Body larger than 256 KiB
422Invalid parametersError
503mail_contacts_unavailable

Examples

curl

curl -X POST "$GALON_API_BASE/templates" \
  -H "Authorization: Bearer $GALON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "string"}'

Node.js (SDK)

import { Galon } from "galon";

const galon = new Galon(process.env.GALON_API_KEY);
const result = await galon.templates.create({"name": "string"});

Python (SDK)

from galon import Galon

galon = Galon()  # reads GALON_API_KEY
result = galon.templates.create({"name": "string"})