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.
x-api-key: qd_live_...How it works: generation is asynchronous.
POST /generatestarts a document and returns arun_idstraight away.- Poll
GET /api-v1/runs/{run_id}every 2 to 3 seconds untilstatusissuccessorfailed. - On
success, download the PDF fromdownload_urlwithin 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
| Field | Type | Required | Description |
|---|---|---|---|
template_id | string | yes | The template's id. Shown in Documenty, or via GET /api-v1/templates. |
record_id | string | one of the two | A record in the template's connected data source, for example an Airtable record id rec.... Documenty reads the record itself. |
data | object | one of the two | Placeholder values you send yourself. Line items are arrays of objects. |
locale | string | no | Language 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 -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
{
"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
{ "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 https://api.documenty.net/functions/v1/api-v1/runs/9b2e4f10-... \
-H "x-api-key: qd_live_..."Response when ready 200
{
"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
}| Status | Meaning |
|---|---|
pending | Queued. |
processing | Being generated. |
held | Waiting: the template is paused for editing. |
success | Ready. download_url is valid for 300 seconds; call again for a fresh link. |
failed | Not generated. The reason is in error. Failed documents use no credits. |
cancelled | Stopped 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
{
"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}
{
"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>" }.
| HTTP | error | What to do |
|---|---|---|
| 400 | template_id required | Send template_id. |
| 400 | template_not_found | Check the id. |
| 400 | template_inactive, template_archived, template_deleted | Activate the template in Documenty, or use another one. |
| 400 | missing_input | Send record_id or data. |
| 400 | fetch_record_failed | Documenty could not read the record. Check the record id and that it is in the template's table. |
| 400 | connector_inactive, no_credentials | The template's data connection needs attention in Documenty. |
| 400 | unsupported_locale, locale_not_approved, conflicting_locale_config | See details. The translation does not exist yet, or the template picks its language itself. |
| 401 | unauthorized | Missing or wrong API key, or the key was sent in the wrong header. Use x-api-key. |
| 402 | no_active_plan | The workspace has no active plan yet. |
| 403 | forbidden | The template belongs to another workspace. |
| 404 | not_found | Unknown id, or an id from another workspace. |
| 429 | rate_limited | Too many documents in one minute. Wait retry_after_seconds and retry. |
| 429 | held_queue_full | 250 documents are already waiting on a paused template. Release it in Documenty first. |
| 500 | enqueue_failed, lookup_failed | Temporary 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.
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.
