GET /templates/{template}
Get a template's draft and published state
API key (Bearer), on the public API endpoint.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
template | path | string · required | UUID or alias of the template. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Template | Template |
403 | scope_missing (template:read) | |
404 | template_not_found | |
503 | mail_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
| Name | In | Type | Description |
|---|---|---|---|
template | path | string · required | UUID or alias of the template. |
Request body
application/json · schema TemplateUpdate
| Field | Type | Description |
|---|---|---|
name | string | |
alias | string | null | |
subject | string | null | At most 200 UTF-8 bytes, no CR/LF. |
html | string | null | At most 48 KiB UTF-8; each line stays under 998 bytes. |
text | string | null | At most 48 KiB UTF-8; each line stays under 998 bytes. |
variables | array<TemplateVariable> | |
from | string | null | |
reply_to | string | null |
Responses
| Status | Description | Body |
|---|---|---|
200 | Draft updated | Template |
403 | scope_missing (template:write) | |
404 | template_not_found | |
409 | template_alias_exists | |
413 | Body larger than 256 KiB | |
422 | Invalid parameters | Error |
503 | mail_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
| Name | In | Type | Description |
|---|---|---|---|
template | path | string · required | UUID or alias of the template. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Template deleted | TemplateDeleteResponse |
403 | scope_missing (template:write) | |
404 | template_not_found | |
503 | mail_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>")