API reference
Conventions of the Druckling REST API, and a reference for every endpoint generated from the API's own contract.
The Druckling API is a JSON REST API. Every endpoint in this section is generated from the same contract the API is served from, so field names, types and limits here always match what /v1 accepts. Use the playground on each page to send a request with your test key.
Base URL
https://druckling-nine.vercel.app/v1All endpoints are versioned under /v1. Requests and responses use JSON (Content-Type: application/json) with snake_case field names, and timestamps are ISO 8601 strings in UTC.
Authentication
Send an API key with every request, either as a bearer token or in the x-api-key header:
curl https://druckling-nine.vercel.app/v1/templates \
-H "Authorization: Bearer $DRUCKLING_API_KEY"The key decides the workspace and the mode: dr_test_… keys work in test mode, dr_live_… keys in live mode. Some endpoints need a key with full access. See Authentication for permissions and the errors you get without them.
Resources and IDs
Every resource has an object field naming its type and an id with a prefix you can recognize:
| Resource | object | ID prefix |
|---|---|---|
| Document | document | pdf_ |
| Batch | batch | bat_ |
| Share link | share_link | shl_ |
| Webhook endpoint | webhook_endpoint | whe_ |
| Embedded editor session | embed_session | emb_ |
| Template | template | addressed by its slug |
Lists and pagination
List endpoints return { "object": "list", "data": [...] }. Documents, batches and a batch's documents are paginated: pass limit (1 to 100) and, for the next page, cursor set to the previous response's next_cursor. next_cursor is null on the last page. Templates, webhook endpoints and share links come back in one list. The SDKs iterate through pages for you.
Status codes
| Status | Meaning |
|---|---|
200 | It worked. POST /v1/documents answers 200 when it waited for the render. |
201 | A webhook endpoint, share link or embedded editor session was created. |
202 | Accepted and queued: POST /v1/documents with async: true, and every batch. |
400 | The request doesn't match the API's schema (data.issues lists the problems). |
401 / 403 | The API key is missing or invalid, or lacks a permission. |
404 | The resource doesn't exist in your workspace, or the endpoint doesn't exist. |
409 | The request conflicts with the resource's state, e.g. canceling a finished batch. |
413 | The request body is too large. |
422 | The payload doesn't match the template's schema, a business rule failed, or the render failed. |
429 | A quota or rate limit was reached. |
504 | The render took too long. |
Every error has the same JSON shape, with Druckling's own code in data.code and the offending field in data.field. See Errors for the full list and for which errors are safe to retry, and Plans and limits for quotas and rate limits.
OpenAPI
The OpenAPI 3.1 document behind this reference is served at /v1/openapi.json. Use it to generate a client in another language or to import the API into a tool such as Postman or Insomnia. An interactive Scalar reference is also available at /v1/docs.