---
title: "Generate Deliverable"
description: "Generates a new document from a template by filling its placeholders with the variable values you send, and stores it as a deliverable with a PDF copy. The response includes a `placeholderReport` listing template placeholders you sent no value for and values you sent that the template does not use."
url: "https://docs.turbodocx.com/docs/API/generate-deliverable"
---

# Generate Deliverable

> Generates a new document from a template by filling its placeholders with the variable values you send, and stores it as a deliverable with a PDF copy. The response includes a `placeholderReport` listing template placeholders you sent no value for and values you sent that the template does not use.

`POST https://api.turbodocx.com/v1/deliverable`

```bash
curl -X POST "https://api.turbodocx.com/v1/deliverable" \
  -H "Authorization: Bearer $TURBODOCX_API_KEY" \
  -H "x-rapiddocx-org-id: $TURBODOCX_ORG_ID"
```

  Request

### Body (application/json)

- `name` (string, required): Name of the new deliverable.
- `templateId` (string, required): The template to generate from. A PDF signature template cannot generate documents and returns `400 SignatureOnlyTemplate`.
- `description` (string, nullable): Description of the deliverable.
- `deliverableFolderId` (string): Folder to place the deliverable in.
- `variables` (object[], required): Values for the template's placeholders. Required, but may be an empty array; a placeholder with no value renders blank unless `strict` is `true`.
  - `placeholder` (string, required): The placeholder exactly as it appears in the template, for example `{CompanyName}`.
  - `text` (string): The value to insert. Required unless the variable has a `variableStack` or `isDisabled` is `true`.
  - `mimeType` (string): How `text` is interpreted; `text` when omitted. `html` needs a template variable that allows rich text, otherwise the request returns 400 with `{ "error": "ValidationError", "message" }`. Allowed: `text`, `html`, `image`, `markdown`.
  - `isDisabled` (boolean): Set to `true` to skip this variable during generation. Allowed: `true`, `false`. Default: `false`.
  - `subvariables` (object[]): Values for placeholders that appear inside this variable's HTML `text`. The parent must have `mimeType: html`.
    - `placeholder` (string)
    - `text` (string)
    - `mimeType` (string). Allowed: `text`, `html`, `image`, `markdown`.
  - `variableStack` (object): Repeating content: several values for the same placeholder, keyed by position (`"0"`, `"1"`, ...). An array of the same objects is also accepted.
  - `aiPrompt` (string): Prompt used to generate the value with AI.
- `tags` (any[]): Tags to attach to the deliverable: tag labels (1 to 255 characters each), or tag objects with their `id`.
- `keepAnchoredTags` (boolean): Set to `true` to keep the template's TurboSign field tags (the anchored tags of its saved signature setup) as literal text, so a later signature request can place fields on them. Omitted, every placeholder is filled with the value sent. Allowed: `true`, `false`.
- `strict` (boolean): Set to `true` to refuse generation with `400 PlaceholderMismatch` when any template placeholder has no value or any value names a placeholder the template does not have. Omitted means generate anyway. Allowed: `true`, `false`.
- `replaceFonts` (boolean): Set to `true` to replace the document's fonts with `defaultFont`. Allowed: `true`, `false`. Default: `false`.
- `defaultFont` (string, nullable): Font to use. When omitted, the template's own default font is used.
- `fonts` (object[]): Fonts used by the document. Each entry has exactly `name` and `usage`.
  - `name` (string, required)
  - `usage` (string, required)



### Responses

#### 200

The deliverable was generated.

```json
{
  "data": {
    "results": {
      "deliverable": {
        "id": "39697685-ca00-43b8-92b8-7722544c574f",
        "name": "Employee Contract - John Smith",
        "description": "Employment contract for new senior developer",
        "templateId": "0b1099cf-d7b9-41a4-822b-51b68fd4885a",
        "createdBy": "f5e6d7c8-9a0b-4c1d-8e3f-4a5b6c7d8e9f",
        "createdOn": "2026-01-15T14:12:10.721Z",
        "updatedOn": "2026-01-15T14:12:10.721Z",
        "isActive": 1,
        "defaultFont": "Arial",
        "fonts": null
      },
      "placeholderReport": {
        "missing": [
          "{StartDate}"
        ],
        "unknown": []
      }
    }
  }
}
```

#### 400

The request is invalid, `strict` is on and the placeholders do not match, the template is a PDF signature template, or your plan's deliverable or storage limit is reached.

```json
{
  "message": "There was an issue validating the body",
  "type": "ValidationError",
  "data": {
    "errors": [
      {
        "message": "\"name\" length must be at least 3 characters long",
        "path": [
          "name"
        ],
        "type": "string.min",
        "context": {
          "limit": 3,
          "value": "ab",
          "label": "name",
          "key": "name"
        }
      }
    ]
  }
}
```

#### 401

Missing or invalid API key, or the organization ID header is missing or is not an organization the key belongs to. The response has no body.

#### 403

The key's role cannot generate documents (viewers cannot), or your organization's usage record could not be found. The response has no body.

#### 404

The template does not exist in your organization.

```json
{
  "error": "TemplateNotFound",
  "message": "Template with id 0b1099cf-d7b9-41a4-822b-51b68fd4885a not found"
}
```

#### 423

Someone is editing the template in TurboDocx. Retry once they have finished.

```json
{
  "error": "Resource is locked",
  "message": "This template is currently being edited",
  "data": {
    "locked": true,
    "lockedBy": "f5e6d7c8-9a0b-4c1d-8e3f-4a5b6c7d8e9f",
    "lockedOn": "2026-01-15T14:10:00.000Z"
  }
}
```

#### 499

The client disconnected before generation finished. Any partly created deliverable is cleaned up.

```json
{
  "error": "Request cancelled",
  "message": "Deliverable generation was cancelled during processing"
}
```
