Documenty API

Generate PDFs from your Documenty templates with one HTTP call, then fetch the result.

Basics

Base URL: https://api.documenty.net/functions/v1

Authentication: send your workspace API key in the x-api-key header on every request. The key starts with qd_live_ and is found in Documenty under Settings, My account, API keys. It only gives access to your own workspace.

Header
x-api-key: qd_live_...

How it works: generation is asynchronous.

  1. POST /generate starts a document and returns a run_id straight away.
  2. Poll GET /api-v1/runs/{run_id} every 2 to 3 seconds until status is success or failed.
  3. On success, download the PDF from download_url within 5 minutes.

Most documents are ready in 5 to 20 seconds. If your template has an output destination (for example an Airtable attachment field or an email), Documenty delivers the PDF there too, so you often do not need to poll at all.

Every successful live document uses one credit.

Generate a document

POST/generate

FieldTypeRequiredDescription
template_idstringyesThe template's id. Shown in Documenty, or via GET /api-v1/templates.
record_idstringone of the twoA record in the template's connected data source, for example an Airtable record id rec.... Documenty reads the record itself.
dataobjectone of the twoPlaceholder values you send yourself. Line items are arrays of objects.
localestringnoLanguage code of an approved translation, for example fr-BE. Only for templates that do not pick the language from a record field.

You can send both record_id and data: your data values then overrule the record's.

If you move over from DocsAutomator, docId and recId work as aliases for template_id and record_id.

Example with a record

curl
curl -X POST https://api.documenty.net/functions/v1/generate \
  -H "x-api-key: qd_live_..." \
  -H "Content-Type: application/json" \
  -d '{"template_id": "6f1c0a2e-...", "record_id": "recA1b2C3d4E5f6G7"}'

Example with your own data

JSON
{
  "template_id": "6f1c0a2e-...",
  "data": {
    "customer_name": "Bakkerij Janssens",
    "quote_date": "2026-11-04",
    "line_items_1": [
      { "description": "Consultancy", "qty": 2, "unit_price": 95 }
    ]
  }
}

Send raw values (numbers as numbers, dates as YYYY-MM-DD). The template formats them, for example 95 becomes 95,00 € and the date 04/11/2026.

Response 200

JSON
{ "run_id": "9b2e4f10-...", "status": "pending" }

status is held instead of pending when the template is paused for editing in Documenty: the document waits and is generated once the template is released.

Get the result

GET/api-v1/runs/{run_id}

curl
curl https://api.documenty.net/functions/v1/api-v1/runs/9b2e4f10-... \
  -H "x-api-key: qd_live_..."

Response when ready 200

JSON
{
  "run_id": "9b2e4f10-...",
  "template_id": "6f1c0a2e-...",
  "status": "success",
  "mode": "live",
  "created_at": "2026-11-04T09:12:03.512Z",
  "processing_ms": 6840,
  "download_url": "https://api.documenty.net/storage/v1/object/sign/...",
  "download_url_expires_in": 300
}
StatusMeaning
pendingQueued.
processingBeing generated.
heldWaiting: the template is paused for editing.
successReady. download_url is valid for 300 seconds; call again for a fresh link.
failedNot generated. The reason is in error. Failed documents use no credits.
cancelledStopped in Documenty.

Timestamps are UTC. A run id from another workspace returns 404, the same as an unknown id.

Templates

List your active templates: GET /api-v1/templates

JSON
{
  "templates": [
    { "id": "6f1c0a2e-...", "name": "Quote", "version": 12, "locale": "nl-BE", "updated_at": "2026-10-30T14:02:11.000Z" }
  ]
}

Only active, main-language templates are listed. Translations are reached through locale on /generate.

Read one template's placeholders: GET /api-v1/templates/{id}

JSON
{
  "id": "6f1c0a2e-...",
  "name": "Quote",
  "version": 12,
  "locale": "nl-BE",
  "is_active": true,
  "placeholders": {
    "fields": ["customer_name", "quote_date"],
    "line_items": [{ "group": "line_items_1", "fields": ["description", "qty", "unit_price"] }]
  }
}

Use these names as the keys in data.

Errors and limits

Errors return JSON: { "error": "<code>", "details": "<explanation>" }.

HTTPerrorWhat to do
400template_id requiredSend template_id.
400template_not_foundCheck the id.
400template_inactive, template_archived, template_deletedActivate the template in Documenty, or use another one.
400missing_inputSend record_id or data.
400fetch_record_failedDocumenty could not read the record. Check the record id and that it is in the template's table.
400connector_inactive, no_credentialsThe template's data connection needs attention in Documenty.
400unsupported_locale, locale_not_approved, conflicting_locale_configSee details. The translation does not exist yet, or the template picks its language itself.
401unauthorizedMissing or wrong API key, or the key was sent in the wrong header. Use x-api-key.
402no_active_planThe workspace has no active plan yet.
403forbiddenThe template belongs to another workspace.
404not_foundUnknown id, or an id from another workspace.
429rate_limitedToo many documents in one minute. Wait retry_after_seconds and retry.
429held_queue_full250 documents are already waiting on a paused template. Release it in Documenty first.
500enqueue_failed, lookup_failedTemporary problem. Retry after a few seconds.

Rate limit: 60 documents per minute per workspace by default. Ask us if you need more.

Recipes

Airtable automation

Trigger: a record enters a view or a button is pressed. Action: Run a script, with an input variable recordId set to the record's id.

JavaScript
const { recordId } = input.config();

const res = await fetch("https://api.documenty.net/functions/v1/generate", {
  method: "POST",
  headers: {
    "x-api-key": "qd_live_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ template_id: "6f1c0a2e-...", record_id: recordId }),
});

const body = await res.json();
if (!res.ok) throw new Error(`Documenty: ${body.error} ${body.details ?? ""}`);
output.set("run_id", body.run_id);

If the template writes the PDF back to an attachment field, nothing else is needed.

Make

Add an HTTP: Make a request module:

  • URL: https://api.documenty.net/functions/v1/generate
  • Method: POST
  • Header: x-api-key = your key
  • Body type: Raw, content type JSON
  • Request content: {"template_id": "6f1c0a2e-...", "record_id": "{{record id from the previous module}}"}
  • Parse response: yes

To get the PDF in the same scenario, add a Sleep of 10 seconds and a second HTTP module: GET https://api.documenty.net/functions/v1/api-v1/runs/{{run_id}} with the same header. Repeat while status is pending or processing.

Using Claude, Cursor or another AI assistant? Connect Documenty to your AI assistant.

Start for freeBook a demo