---
search:
  tags:
    - Document templates
    - POST
seo:
  description: >-
    Queues the document. Poll the status endpoint until it reports ready or
    failed. Reference for the POST /api/v1/documents endpoint in the Taylorz CRM
    API.
sidebar:
  label: Generate a document
  badge: POST
title: Generate a document
type: openapi-operation
---
Queues the document. Poll the status endpoint until it reports ready or failed.

`POST /api/v1/documents`

**Request body** (`application/json`, required)

- `recordId` (string, required)
- `revision` (integer, required)
- `templateId` (string, required)

Request body example:

```json
{
  "recordId": "string",
  "revision": 1,
  "templateId": "string"
}
```

**Responses**

- `202` — The document was queued
- `400` — The request body, query or parameters were refused
- `401` — The access token is missing, invalid or revoked
- `403` — The tenant's module is off, or the token's scope or the member's role does not permit the action
- `404` — No such record, or none the caller may read
- `409` — The operation conflicts with the current state
- `413` — The request exceeds the route's body limit
- `500` — An unexpected failure

Response example, 202:

```json
{
  "id": "string"
}
```
