Automette docs

Start a file upload

POST
/api/v1/uploads

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/uploads" \  -H "Content-Type: application/json" \  -d '{    "target": "template_asset",    "filename": "string"  }'
{  "upload_id": "eyJ0IjoidGVtcGxhdGVfZG9jeCIsInRlYW0iOiJ0ZWFtXzEyMyJ9.7Qk2...",  "upload_url": "https://docuagen.s3.eu-west-1.amazonaws.com/",  "fields": {    "key": "temp-uploads/6f1c.../body.docx",    "policy": "eyJleHBpcmF0aW9uIjoi..."  },  "max_bytes": 26214400,  "expires_in": 900,  "upload_with": "curl -f -X POST \"https://docuagen.s3.eu-west-1.amazonaws.com/\" -F key=\"...\" -F policy=\"...\" -F file=@<path-to-file>"}

Get a template's field schema GET

The template's fields on their own, without the document body beside them. Same `fields` and `layers` as `GET /api/v1/templates/{id}`, but a document can be large and a caller that only needs to know what to put in `data` should not have to download one to find out. Add `?primary=true` for content fields only. A canvas layer carries every typography property it supports, so a five-layer template answers with 56 fields of which four are the ones anyone means. `field_count` reports both totals either way, so a filtered response never looks like the whole picture. `sample_data` is a ready-to-send `data` object built from the fields' own example values, and always contains the primary fields only.

Finish a file upload POST

Stores a file that was posted to the URL from `POST /v1/uploads`. This is where the work happens. A `.docx` is parsed before it is kept, so a file the renderer cannot read is refused rather than becoming a template that fails at render time, and only now does it get a version. For a Word body the response names the fields the upload `added` and `removed`. Every upload is checked against its own first bytes, so a truncated image or a PNG sent as a font is refused here rather than stored and discovered at render time. For a Brand Kit image the response carries `key`, which is what a canvas image `src` takes; for a Brand Kit font it carries `family`, read out of the file and often not the filename, which is what `fontFamily` takes. Both say plainly that the file is team-wide. A font declaring a family this product already ships is refused: the built-in face wins when the renderer resolves the name, so the upload would be stored, listed and never drawn. Idempotent: a second call returns the first result rather than storing a second version.