Skip to content

GET /v1/templates

Templates are per-account. A brand-new account — including a keyless trial — starts with the starter library already loaded.

GET https://api.galleyrender.com/v1/templates
GET https://api.galleyrender.com/v1/templates/:ref
DELETE https://api.galleyrender.com/v1/templates/:name
Authorization: Bearer glr_sk_…

Lists every template on the account that has not been deleted, ordered by name. Takes no parameters.

200 OK, { "object": "list", "data": [...] }. Each entry is the summary form: no schema, no source.

FieldTypeDescription
objectstringAlways template.
idstringtpl_….
namestringLowercase, matches ^[a-z0-9][a-z0-9._-]{0,62}$.
descriptionstring | null
latest_versionnumberThe highest published version.
created_atstringISO 8601.
updated_atstringISO 8601. Moves when a new version is published.
List templates shell
curl -sS https://api.galleyrender.com/v1/templates \
  -H "Authorization: Bearer $GALLEY_API_KEY"
List templates javascript
// Node 22+. No dependencies — `fetch` is built in.
const res = await fetch("https://api.galleyrender.com/v1/templates", {
  headers: {
    authorization: `Bearer ${process.env.GALLEY_API_KEY}`,
  },
});

const templates = await res.json();
if (!res.ok) throw new Error(templates.error.message);

console.log(templates);
List templates python
# Python 3.9+. Standard library only.
import json, os, urllib.request

req = urllib.request.Request(
    "https://api.galleyrender.com/v1/templates",
    headers={"Authorization": f"Bearer {os.environ['GALLEY_API_KEY']}"},
)

templates = json.load(urllib.request.urlopen(req))
print(templates)
List templates — no key shell + json
# No API key. The first call mints a 50-render trial.
curl -sS https://mcp.galleyrender.com/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "list_templates",
      "arguments": {}
    }
  }'
200 OK
{
"object": "list",
"data": [
{
"object": "template",
"id": "tpl_3n8kq1w7v2md",
"name": "invoice",
"description": "Letter-size invoice with line items, totals, and payment terms.",
"latest_version": 1,
"created_at": "2026-09-16T13:58:22.410Z",
"updated_at": "2026-09-16T13:58:22.410Z"
},
{
"object": "template",
"id": "tpl_8w2mv4k9t1qp",
"name": "og-card",
"description": "1200x630 social card.",
"latest_version": 2,
"created_at": "2026-09-16T13:58:22.688Z",
"updated_at": "2026-09-16T14:11:09.223Z"
}
]
}

Reads one version in full, including its JSON Schema and HTML source.

ParameterInDescription
refpathinvoice for the latest version, invoice@3 to pin one. invoice@latest is the same as invoice.

The reference is parsed at the last @, so a name containing dots and dashes is fine. A version that is not a positive integer is an invalid_request, not a 404.

200 OK. The summary fields above, plus:

FieldTypeDescription
versionnumberThe resolved version number.
refstringname@version. Pin this in anything you ship.
enginestringchromium or satori.
schemaobjectJSON Schema (draft 2020-12) for data. {} if the version has none.
optionsobjectDefault render options for this version. Per-request options are merged over them.
exampleunknown | nullAn example payload, if the version ships one.
sourcestringThe HTML + Liquid source.
checksumstringSHA-256 over engine, source, schema and options. It is the template half of the render cache key.
messagestring | nullThe changelog line recorded with the version.
version_created_atstringISO 8601.
Read a pinned version
curl -sS https://api.galleyrender.com/v1/templates/invoice@1 \
-H "Authorization: Bearer $GALLEY_API_KEY"
200 OK (schema and source abbreviated)
{
"object": "template",
"id": "tpl_3n8kq1w7v2md",
"name": "invoice",
"description": "Letter-size invoice with line items, totals, and payment terms.",
"latest_version": 1,
"created_at": "2026-09-16T13:58:22.410Z",
"updated_at": "2026-09-16T13:58:22.410Z",
"version": 1,
"ref": "invoice@1",
"engine": "chromium",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Invoice",
"type": "object",
"required": ["invoice_number", "issued_on", "seller", "buyer", "line_items"],
"additionalProperties": true,
"properties": {
"invoice_number": { "type": "string", "examples": ["INV-1042"] },
"issued_on": { "type": "string", "format": "date", "examples": ["2026-09-16"] },
"tax_rate": { "type": "number", "minimum": 0, "maximum": 1, "examples": [0.07] }
}
},
"options": { "page_size": "Letter", "margin": "0.5in", "print_background": true },
"example": { "invoice_number": "INV-1042", "issued_on": "2026-09-16" },
"source": "<html><head><style>@page { size: Letter; margin: 0.5in }</style></head>…",
"checksum": "b2f0c8a1d34e5f67…",
"message": "starter library",
"version_created_at": "2026-09-16T13:58:22.410Z"
}

Read the schema before rendering a template you have not used. It is the contract for data, and POST /v1/templates/:ref/validate will check a payload against it for free.

404 Not Found
{
"error": {
"type": "not_found",
"message": "Template `invioce` was not found on this account.",
"docs_url": "https://galleyrender.com/docs/errors/not_found",
"details": {
"requested": "invioce",
"available_templates": ["invoice@1", "og-card@2", "receipt@1"],
"create_url": "https://galleyrender.com/docs/templates#create"
}
}
}

details.available_templates holds up to 25 entries, each already in name@version form.

Soft-deletes a template. The row is marked deleted rather than removed.

ParameterInDescription
namepathThe template name. A version suffix is accepted and ignored — delete acts on the whole template, not one version.
Delete a template
curl -sS -X DELETE https://api.galleyrender.com/v1/templates/receipt \
-H "Authorization: Bearer $GALLEY_API_KEY"
200 OK
{
"object": "template",
"id": "tpl_1v7mq4k8w2nt",
"name": "receipt",
"deleted": true
}

What a soft delete does and does not do:

Stops appearing in GET /v1/templatesyes
Can still be renderedno — POST /v1/render returns not_found
Existing renders keep workingyes — stored files and their signed URLs are untouched
Version history is destroyedno — rows are kept
The name becomes free againno
TypeStatusWhen
authentication_error401Missing, unknown or revoked key.
not_found404No such template on this account, or the template has no such version.
invalid_request400The reference is malformed, e.g. invoice@0 or invoice@three.