Automette docs

Update a template

PATCH
/api/v1/templates/{id}

Authorization

ApiKeyAuth
AuthorizationBearer <token>

API key from Settings → API Keys.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v1/templates/string" \  -H "Content-Type: application/json" \  -d '{    "document": "#let data = (customer: \\"Acme Ltd\\",)\\n= Invoice for #data.customer"  }'
Empty

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. 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. Also returns `url_base` — the template's on-demand URL token, or `null` if not generated yet. See [On-demand URLs](/docs/api/on-demand-urls). > `available_fields` is a deprecated alias for `fields` and will be removed. Use `fields`.

Move a template to the trash DELETE

Moves the template to the trash, where it stays recoverable for 7 days. Renders, forms and automations that reference it keep resolving until it is purged — deleting a template does not retroactively break the documents made from it. There is no API for the permanent delete. That one is irreversible and stays behind a person clicking it in the dashboard.