D
Druckling
Docs

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/v1

All 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:

ResourceobjectID prefix
Documentdocumentpdf_
Batchbatchbat_
Share linkshare_linkshl_
Webhook endpointwebhook_endpointwhe_
Embedded editor sessionembed_sessionemb_
Templatetemplateaddressed 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

StatusMeaning
200It worked. POST /v1/documents answers 200 when it waited for the render.
201A webhook endpoint, share link or embedded editor session was created.
202Accepted and queued: POST /v1/documents with async: true, and every batch.
400The request doesn't match the API's schema (data.issues lists the problems).
401 / 403The API key is missing or invalid, or lacks a permission.
404The resource doesn't exist in your workspace, or the endpoint doesn't exist.
409The request conflicts with the resource's state, e.g. canceling a finished batch.
413The request body is too large.
422The payload doesn't match the template's schema, a business rule failed, or the render failed.
429A quota or rate limit was reached.
504The 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.

On this page