Automette docs

Create a template

POST
/api/v1/templates

Authorization

ApiKeyAuth
AuthorizationBearer <token>

API key from Settings → API Keys.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/templates" \  -H "Content-Type: application/json" \  -d '{    "from_library": "invoice-minimal",    "name": "Acme invoice"  }'
{  "id": "string",  "name": "string",  "engine": "typst",  "default_formats": [    "string"  ],  "allowed_formats": [    "string"  ],  "self": "http://example.com",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}

List templates GET

Returns all templates in your team, ordered by creation date ascending. Use the `engine` filter to narrow to a specific template type. Archived templates are not in this list. Pass `archived=true` for those instead — that is how you find one again to bring it back with `PATCH /api/v1/templates/{id}`. Trashed templates are in neither view: they are recoverable for 7 days from the dashboard, and no API reads or restores them.

Get a template GET

Returns a single template including its `document` and its `fields` — the keys you can pass in the `data` object of `POST /api/v1/renders`. `document` is the template itself: Typst source, or the canvas document as a JSON string. It is here because `PATCH` takes a whole document, so editing is read-change-write. If you only need the field schema, `GET /api/v1/templates/{id}/fields` skips the body. **`?version=N` reads a saved version** and changes nothing. Restoring is how you go back, but it immediately changes what every unpinned Dynamic URL, connected form and render call serves — so it is the wrong way to find out what a version contained. Numbers come from `GET /api/v1/templates/{id}/versions`. Each field carries `primary`: `true` for content (the reason the field exists), `false` for styling. If you are building a form or an integration, show the primary fields and put the rest behind a "show all" toggle. **Field schema by engine:** - **Typst** — keys extracted from the template source: `{ key, type: "text", example, primary: true }` where `example` is the placeholder value in the source. - **Canvas** — one entry per settable layer property, keyed `layerName.property`: `{ key, label, type, example, primary }`. - **DOCX** — the template's authored field definitions with richer metadata: `{ key, label, type, required, primary: true }` where `type` is one of `text`, `date`, `number`, or `array`. **Canvas templates also return `layers`** — the same properties grouped by the layer they belong to, which is how the template is actually built. Each property carries the full dotted `key` to send in `data`, so you never have to build it yourself. Not every visual attribute is settable. Position, size, rotation, opacity and font size are design-time only: they are changed in the template editor, and are absent from both `fields` and `layers`. Sending them in `data` has no effect. **`archived: true` appears only on an archived template**, alongside `archived_at`. Archived templates are absent from `GET /api/v1/templates` but still render and are still readable by id, so this is the only place a caller holding an id learns the template has been put away. Archiving and unarchiving are dashboard actions. > `available_fields` is a deprecated alias for `fields` and will be removed. Use `fields`.