GET /templates
List the project's templates
API key (Bearer), on the public API endpoint.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | |
after | query | string |
Responses
| Status | Description | Body |
|---|---|---|
200 | Page of templates | TemplateListResponse |
403 | scope_missing (template:read) | |
422 | pagination_invalid | |
503 | mail_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
| Field | Type | Description |
|---|---|---|
name | string · required | |
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 |
|---|---|---|
201 | Draft created | Template |
403 | scope_missing (template:write) | |
409 | template_alias_exists | |
413 | Body larger than 256 KiB | |
422 | Invalid parameters | Error |
503 | mail_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"})