---
updatedAt: 2026-11-03T17:23:35.000Z
agentTools:
  projectIndex: https://docs.inkit.com/llms.txt
---

# Generate a document from a template

Generate from an existing template. merge_parameters is required; use {} for a template without merge variables. Inkit Storage is added automatically. HTTP 201 returns identifiers before processing finishes. Poll the render and download after completion. Subscription, destination, and permission checks apply.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Inkit API",
    "description": "Commercial API reference for documentation version 2.0. HTTP routes remain /api/v1. Use X-Inkit-API-Token for API-key requests. Operations depend on the account subscription, permissions, and enabled features. Generation and workflow invocation are asynchronous; HTTP 201 means accepted, not completed.",
    "version": "2.0.0",
    "contact": {
      "name": "Inkit",
      "url": "https://www.inkit.com"
    }
  },
  "servers": [
    {
      "url": "https://apps.inkit.com",
      "description": "Commercial"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Inkit-API-Token",
        "description": "API Key for authentication"
      }
    },
    "schemas": {
      "Error": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/GoError"
          },
          {
            "$ref": "#/components/schemas/PythonError"
          },
          {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/schemas/GoFieldErrors"
          }
        ]
      },
      "InkitStorageDestination": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 251,
            "description": "Document name (automatically gets .pdf extension if missing)"
          },
          "description": {
            "type": "string",
            "maxLength": 65535,
            "description": "Document description"
          },
          "folder_id": {
            "type": "string",
            "minLength": 25,
            "maxLength": 32,
            "description": "Existing folder public ID with write access."
          },
          "retain_for": {
            "type": "object",
            "description": "Document retention period",
            "properties": {
              "minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "hours": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "years": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              }
            },
            "oneOf": [
              {
                "required": [
                  "minutes"
                ]
              },
              {
                "required": [
                  "hours"
                ]
              },
              {
                "required": [
                  "days"
                ]
              },
              {
                "required": [
                  "years"
                ]
              }
            ],
            "nullable": true
          },
          "expire_after_n_views": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "nullable": true,
            "description": "Number of views before document expires"
          }
        }
      },
      "DigitalSignatureSigner": {
        "type": "object",
        "required": [
          "signer_number"
        ],
        "properties": {
          "signer_name": {
            "type": "string",
            "maxLength": 255,
            "description": "Name of signer (required when using email)"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email address (required if not using signing group)"
          },
          "signing_group_id": {
            "type": "integer",
            "description": "ID of signing group (mutually exclusive with email)"
          },
          "group_name": {
            "type": "string",
            "maxLength": 255,
            "description": "Name of signing group (mutually exclusive with email)"
          },
          "signer_number": {
            "type": "integer",
            "minimum": 1,
            "description": "Signer number matching template blocks"
          },
          "signing_round": {
            "type": "integer",
            "minimum": 1,
            "description": "Signing round for parallel signing. Signers with the same round number can sign simultaneously. Defaults to sequential signing based on signer_number when not provided."
          },
          "can_skip": {
            "type": "boolean",
            "default": false,
            "description": "Whether this signer can skip signing"
          },
          "can_reassign": {
            "type": "boolean",
            "default": false,
            "description": "Whether this signer can reassign to someone else"
          },
          "responsibility": {
            "type": "string",
            "enum": [
              "none",
              "concur",
              "approve"
            ],
            "default": "none"
          }
        },
        "description": "Provide email plus signer_name, or a signing_group_id/group_name. Email and group identifiers are mutually exclusive. If both group identifiers are supplied they must identify the same group. Signer numbers must be unique and match the template participants. At least one signer must have can_skip=false."
      },
      "DigitalSignatureBCC": {
        "type": "object",
        "properties": {
          "bcc_name": {
            "type": "string",
            "maxLength": 255,
            "description": "Name of BCC recipient (required when using email)"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email address (required if not using signing group)"
          },
          "signing_group_id": {
            "type": "integer",
            "description": "ID of signing group (mutually exclusive with email)"
          },
          "group_name": {
            "type": "string",
            "maxLength": 255,
            "description": "Name of signing group (mutually exclusive with email)"
          }
        }
      },
      "DigitalSignatureDestination": {
        "type": "object",
        "required": [
          "order",
          "signers"
        ],
        "properties": {
          "order": {
            "type": "string",
            "enum": [
              "In order",
              "All at once"
            ],
            "description": "Signing order"
          },
          "signers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/DigitalSignatureSigner"
            }
          },
          "bcc": {
            "type": "array",
            "description": "BCC recipients",
            "items": {
              "$ref": "#/components/schemas/DigitalSignatureBCC"
            }
          },
          "email_subject": {
            "type": "string",
            "maxLength": 100,
            "nullable": true,
            "description": "Custom request email subject; used only when the account feature is enabled."
          },
          "email_body": {
            "type": "string",
            "maxLength": 2000,
            "nullable": true,
            "description": "Custom request email body; used only when the account feature is enabled."
          },
          "reference_field": {
            "type": "string",
            "maxLength": 255,
            "nullable": true,
            "description": "Must resolve to a signer input on the template, for example signer_inputs.1.reference."
          }
        },
        "description": "Cannot be combined with Inkit Storage expiration settings. BCC recipients cannot duplicate signer emails, signer groups, or other BCC recipients."
      },
      "SalesforceDestination": {
        "type": "object",
        "required": [
          "record_id",
          "file_name",
          "type"
        ],
        "properties": {
          "record_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Salesforce record ID"
          },
          "file_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "File name (automatically gets .pdf extension)"
          },
          "description": {
            "type": "string",
            "maxLength": 65535
          },
          "type": {
            "type": "string",
            "enum": [
              "file",
              "link"
            ],
            "description": "Type of Salesforce attachment"
          },
          "sandbox": {
            "type": "boolean",
            "default": false,
            "description": "Whether to use sandbox environment"
          }
        }
      },
      "MagicLinkDestination": {
        "type": "object",
        "required": [
          "recipient_email",
          "auth_method"
        ],
        "properties": {
          "auth_email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          },
          "recipient_email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 65535
          },
          "auth_method": {
            "type": "string",
            "enum": [
              "email",
              "social"
            ],
            "description": "Authentication method for accessing the magic link"
          },
          "retain_from_created": {
            "type": "object",
            "description": "Retention period from creation",
            "properties": {
              "minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "hours": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              }
            }
          },
          "retain_from_first_opened": {
            "type": "object",
            "description": "Retention period from first open",
            "properties": {
              "minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "hours": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              }
            }
          },
          "expire_after_n_views": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "nullable": true
          }
        }
      },
      "AmazonS3Destination": {
        "type": "object",
        "required": [
          "file_name",
          "bucket_name"
        ],
        "properties": {
          "file_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "File name (automatically gets .pdf extension)"
          },
          "bucket_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        }
      },
      "RenderDataCreateRequest": {
        "type": "object",
        "required": [
          "template_id",
          "merge_parameters"
        ],
        "properties": {
          "template_id": {
            "type": "string",
            "pattern": "^tmpl_[a-zA-Z\\d]+$",
            "maxLength": 32,
            "description": "Template ID to render"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Document name"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 65535,
            "description": "Document description"
          },
          "custom_data": {
            "type": "object",
            "description": "Custom metadata"
          },
          "merge_parameters": {
            "type": "object",
            "additionalProperties": true,
            "description": "Template merge parameters (key-value pairs)"
          },
          "destinations": {
            "type": "object",
            "description": "Commercial destination configurations. Each destination requires its integration and account entitlement. Magic Link also requires its feature flag. Sepire is a legacy account-configured mail integration.",
            "properties": {
              "inkit_storage": {
                "$ref": "#/components/schemas/InkitStorageDestination"
              },
              "digital_signature": {
                "$ref": "#/components/schemas/DigitalSignatureDestination"
              },
              "salesforce": {
                "$ref": "#/components/schemas/SalesforceDestination"
              },
              "magic_link": {
                "$ref": "#/components/schemas/MagicLinkDestination"
              },
              "amazon_s3": {
                "$ref": "#/components/schemas/AmazonS3Destination"
              },
              "box": {
                "$ref": "#/components/schemas/BoxDestination"
              },
              "dropbox": {
                "$ref": "#/components/schemas/DropboxDestination"
              },
              "google_drive": {
                "$ref": "#/components/schemas/GoogleDriveDestination"
              },
              "docusign": {
                "$ref": "#/components/schemas/DocusignDestination"
              },
              "sepire": {
                "$ref": "#/components/schemas/SepireDestination"
              }
            }
          }
        }
      },
      "RenderDataCreateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public ID of the render data"
          },
          "document_id": {
            "type": "string",
            "description": "Public ID of the document"
          },
          "file_id": {
            "type": "string",
            "description": "Public ID of the inkit_storage file"
          },
          "salesforce_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "magic_link_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "digital_signature_item_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "amazon_s3_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "box_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "dropbox_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "google_drive_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "docusign_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          },
          "mail_piece_id": {
            "type": "string",
            "description": "Returned only when the corresponding destination is included."
          }
        }
      },
      "GoError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Application error code, such as unprocessable or not_found."
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "PythonError": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "title": {
              "type": "string"
            },
            "code_name": {
              "type": "string"
            },
            "detail": {
              "type": "string"
            },
            "meta": {
              "nullable": true
            }
          },
          "required": [
            "id",
            "title",
            "code_name"
          ]
        }
      },
      "BoxDestination": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": "string",
            "maxLength": 251
          },
          "parent_id": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "file_name",
          "parent_id"
        ]
      },
      "DropboxDestination": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": "string",
            "maxLength": 251
          },
          "path": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "file_name",
          "path"
        ]
      },
      "GoogleDriveDestination": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": "string",
            "maxLength": 251
          },
          "folder_id": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "file_name",
          "folder_id"
        ]
      },
      "DocusignDestination": {
        "type": "object",
        "properties": {
          "signers": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 255
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "maxLength": 255
                },
                "routing_order": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "required": [
                "name",
                "email"
              ]
            },
            "minProperties": 1
          },
          "copy_receivers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "name",
                "email"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "maxLength": 255
                }
              }
            }
          },
          "routing": {
            "type": "string",
            "enum": [
              "ordered",
              "unordered",
              "custom"
            ],
            "default": "ordered"
          }
        },
        "required": [
          "signers"
        ]
      },
      "GoFieldErrors": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "field",
            "error"
          ],
          "properties": {
            "field": {
              "type": "string"
            },
            "error": {
              "type": "string"
            }
          }
        }
      },
      "SepireDestination": {
        "type": "object",
        "required": [
          "first_name",
          "last_name",
          "address_line_1",
          "address_city",
          "address_state",
          "address_zip",
          "verify_address",
          "mail_product_name"
        ],
        "properties": {
          "first_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "last_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "address_line_1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "address_city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "address_state": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "address_zip": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "address_line_2": {
            "type": "string",
            "maxLength": 255
          },
          "address_country": {
            "type": "string",
            "default": "US"
          },
          "company": {
            "type": "string",
            "maxLength": 255
          },
          "verify_address": {
            "type": "boolean"
          },
          "mail_product_name": {
            "type": "string",
            "description": "An existing account mail product name; validated against configured products."
          },
          "mail_product_data": {
            "type": "object",
            "description": "Product-specific data. Letters require letter_color; postcards require mail_type and postcard_size. Product availability and sizes are account-configured."
          }
        },
        "description": "Legacy commercial mail destination. Requires a configured account product and destination entitlement. Address validation and product-specific fields apply; do not assume availability for new accounts."
      }
    }
  },
  "paths": {
    "/api/v1/generate": {
      "post": {
        "summary": "Generate a document from a template",
        "description": "Generate from an existing template. merge_parameters is required; use {} for a template without merge variables. Inkit Storage is added automatically. HTTP 201 returns identifiers before processing finishes. Poll the render and download after completion. Subscription, destination, and permission checks apply.",
        "operationId": "createRender",
        "tags": [
          "Signatures"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderDataCreateRequest"
              },
              "examples": {
                "digital_signature": {
                  "summary": "Digital Signature",
                  "value": {
                    "template_id": "tmpl_abc123",
                    "name": "Employment Contract",
                    "merge_parameters": {
                      "employee_name": "Jane Smith",
                      "start_date": "2025-02-01",
                      "position": "Senior Developer",
                      "salary": 120000
                    },
                    "destinations": {
                      "inkit_storage": {
                        "name": "Employment Contract",
                        "description": "Contract for Jane Smith"
                      },
                      "digital_signature": {
                        "order": "In order",
                        "signers": [
                          {
                            "signer_name": "Jane Smith",
                            "email": "jane.smith@example.com",
                            "signer_number": 1
                          },
                          {
                            "signer_name": "John Manager",
                            "email": "john.manager@example.com",
                            "signer_number": 2
                          }
                        ]
                      }
                    }
                  }
                },
                "digital_signature_with_salesforce": {
                  "summary": "Digital Signature with Salesforce",
                  "value": {
                    "template_id": "tmpl_abc123",
                    "name": "Sales Agreement",
                    "merge_parameters": {
                      "client_name": "Acme Corp",
                      "contract_value": 50000,
                      "effective_date": "2025-01-20"
                    },
                    "destinations": {
                      "inkit_storage": {
                        "name": "Sales Agreement",
                        "description": "Agreement with Acme Corp"
                      },
                      "digital_signature": {
                        "order": "In order",
                        "signers": [
                          {
                            "signer_name": "Sarah Client",
                            "email": "sarah@acmecorp.com",
                            "signer_number": 1
                          },
                          {
                            "signer_name": "Bob Sales",
                            "email": "bob.sales@example.com",
                            "signer_number": 2
                          }
                        ]
                      },
                      "salesforce": {
                        "record_id": "001XX000003Dxxxx",
                        "file_name": "Sales Agreement",
                        "type": "file",
                        "sandbox": false
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Render created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenderDataCreateResponse"
                },
                "example": {
                  "id": "rend_xyz789",
                  "document_id": "doc_abc123",
                  "file_id": "file_def456"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid template or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required - Account limits reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission, subscription, or feature access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error; inspect HTTP status and response body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
```