Galon Cloud
Galon API v1

/templates/{template}

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

GET /templates/{template}

Get a template's draft and published state

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

Parameters

NameInTypeDescription
templatepathstring · requiredUUID or alias of the template.

Responses

StatusDescriptionBody
200TemplateTemplate
403scope_missing (template:read)
404template_not_found
503mail_contacts_unavailable

Examples

curl

curl -X GET "$GALON_API_BASE/templates/<template>" \
  -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.get("<id>");

Python (SDK)

from galon import Galon

galon = Galon()  # reads GALON_API_KEY
result = galon.templates.get("<id>")

PATCH /templates/{template}

Update only a template's draft

Versions already published remain immutable.

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

Parameters

NameInTypeDescription
templatepathstring · requiredUUID or alias of the template.

Request body

application/json · schema TemplateUpdate

FieldTypeDescription
namestring
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
200Draft updatedTemplate
403scope_missing (template:write)
404template_not_found
409template_alias_exists
413Body larger than 256 KiB
422Invalid parametersError
503mail_contacts_unavailable

Examples

curl

curl -X PATCH "$GALON_API_BASE/templates/<template>" \
  -H "Authorization: Bearer $GALON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "alias": "string", "subject": "string", "html": "string"}'

Node.js (SDK)

import { Galon } from "galon";

const galon = new Galon(process.env.GALON_API_KEY);
const result = await galon.templates.update("<id>", {"name": "string", "alias": "string", "subject": "string", "html": "string"});

Python (SDK)

from galon import Galon

galon = Galon()  # reads GALON_API_KEY
result = galon.templates.update("<id>", {"name": "string", "alias": "string", "subject": "string", "html": "string"})

DELETE /templates/{template}

Delete a template and its versions

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

Parameters

NameInTypeDescription
templatepathstring · requiredUUID or alias of the template.

Responses

StatusDescriptionBody
200Template deletedTemplateDeleteResponse
403scope_missing (template:write)
404template_not_found
503mail_contacts_unavailable

Examples

curl

curl -X DELETE "$GALON_API_BASE/templates/<template>" \
  -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.remove("<id>");

Python (SDK)

from galon import Galon

galon = Galon()  # reads GALON_API_KEY
result = galon.templates.remove("<id>")