Start a file upload
Authorization
ApiKeyAuth 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
curl -X POST "https://example.com/api/v1/uploads" \ -H "Content-Type: application/json" \ -d '{ "target": "template_asset", "template_id": "string", "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`. Idempotent: a second call returns the first result rather than storing a second version.