Compose a document from a template and data
Renders one of your saved compose templates with the data you pass, and gives you back a PDF.
`template` is the config id or slug from [POST /v1/compose/configs](https://docs.cloudraker.com/capabilities/compose). `data` is validated against that template's JSON Schema BEFORE anything renders, so a missing field costs you a `422` with the exact instance paths, not a broken document.
```json
{ "template": "invoice", "data": { "customer": "Acme", "total": 1240 } }
```
`output` decides what comes back:
- `file` (the default) stores the PDF in your corpus and returns the file object, with the `templateHash` of the exact bundle that produced it.
- `raw` streams the PDF bytes straight back and stores nothing.
**Learn more:** [Compose](https://docs.cloudraker.com/capabilities/compose)
Authentication
AuthorizationBearer
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
This endpoint expects an object.
template
data
output
Response
The PDF bytes (output: "raw" only — nothing was stored).
Errors
400
Bad Request Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error