Templates

Create a template at version 1

post/v1/templates

Request

  • Base URL: https://api.galleyrender.com
  • URL: https://api.galleyrender.com/v1/templates
  • Auth: HTTP bearer

Request body

namestring required
sourcestring required

One self-contained HTML document with inline CSS and Liquid expressions. No file includes.

engine'chromium' | 'satori'
schemaobject

JSON Schema for the data payload. Strongly recommended: it is what turns a bad payload into a field-level error.

expected_pagesinteger

How many PDF pages a typical payload renders. This is the pre-flight estimate the free tier and the spend cap are checked against, so a multi-page template must declare it or a render that cannot fit the allowance will be allowed to start. It is not a limit: the render is metered on the pages it actually produced, and an under-estimate is corrected afterwards from that count. Ignored for png/jpg, which are always one unit.

exampleunknown
descriptionstring
messagestring

Change note for this version, like a commit message.

Example request

{
  "name": "invoice",
  "options": {
    "margin": "18mm"
  }
}

Response

Created at version 1.

object'template' required
idstring required
namestring required
descriptionstring nullable
latest_versioninteger required
created_atstring date-time required
updated_atstring date-time required
versioninteger

Present when a version was resolved.

refstring
engine'chromium' | 'satori'
schemaobject nullable
optionsobject nullable
expected_pagesinteger

The version's declared PDF page estimate.

exampleunknown
sourcestring
checksumstring

SHA-256 of engine, source, schema and options. Part of the render cache key.

messagestring nullable
version_created_atstring date-time
origin'library' | 'import' | 'own'

On GET /v1/templates: a starter from the library, a template saved from a document import, or one of the account's own.

Example response

{
  "id": "tpl_5m2k8q1xv7bd",
  "ref": "invoice@1"
}

Changes

No recorded changes to this operation across all 1 revision of this API.