Skip to content

API reference

Look up the REST endpoints, retry rules and responses used by DocKiln clients.

The paths below come directly from the repository’s OpenAPI specification. Use the origin of your DocKiln instance. Client requests and errors use JSON. File downloads return binary content.

GET/v1/usage
Monthly usage
GET/v1/documents
Document history
POST/v1/documents
Queue generation
GET/v1/documents/{id}
Poll generation status
GET/v1/documents/{id}/pdf
Download generated file
GET/v1/documents/{id}/file
Download generated file
GET/v1/documents/{id}/link
Sign private S3 download for five minutes
POST/v1/documents/batch
Queue up to eight independently validated documents

History returns up to 100 jobs, newest first. To request older records, pass a Unix millisecond timestamp as the before query parameter. The quota counts accepted jobs for the workspace in the current UTC calendar month. Read GET /v1/usage for this instance’s limit and reset time.

Send an Idempotency-Key header with a stable value for each logical generation. Use 1–128 letters, numbers, periods, underscores, colons or hyphens. Retry with the same workspace key scope and identical JSON payload, preserving property order. A duplicate returns the existing job ID without consuming another document unit. Reusing the key with a different payload returns 409.

GET/v1/library
Starter layouts
GET/v1/templates
List workspace templates
POST/v1/templates
Create draft
GET/v1/templates/{id}
Read draft
PUT/v1/templates/{id}
Save draft
DELETE/v1/templates/{id}
Delete a workspace template and its versions
POST/v1/templates/{id}/publish
Snapshot current draft
GET/v1/templates/{id}/versions
Published snapshots
GET/v1/templates/{id}/raw
Download published HTML source
POST/v1/templates/{id}/html
Download HTML filled with JSON data

Starter layouts are public. Workspace templates and immutable versions require authentication.

POST/v1/auth/register
Register
POST/v1/auth/login
Login
POST/v1/auth/logout
End session
GET/v1/account
Account identity
GET/v1/keys
List key labels
POST/v1/keys
Create key and show its secret once
DELETE/v1/keys/{id}
Revoke key
PATCH/v1/keys/{id}
Rename, enable or disable a key
GET/v1/webhook
Endpoint and delivery history
PUT/v1/webhook
Set endpoint and rotate secret
DELETE/v1/webhook
Disable webhook
GET/v1/storage
Read destination metadata
PUT/v1/storage
Configure encrypted S3 destination
DELETE/v1/storage
Disable destination for future jobs
GET/v1/integrations
Provider configuration status
POST/v1/ai/template
Generate a structured draft
POST/v1/billing/test-checkout
Create Stripe test checkout
POST/v1/preview-image
Preview private Open Graph image
GET/v1/billing/invoices
Read up to 25 linked Stripe test invoices

Managing keys, webhook and bucket settings requires a signed-in account session. AI generation and test checkout additionally require operator-configured provider credentials.

Status What to do
400 / 413 Correct malformed JSON or reduce the request size.
401 / 403 Verify the credential. Use a signed-in session for account settings.
404 Check the ID and confirm the resource belongs to this workspace.
409 Check publication state, stale draft revision, job readiness or idempotency conflict.
422 Read the JSON error message and correct the supplied fields.
429 For a per-minute rate limit, wait for Retry-After. For monthly quota exhaustion, inspect /v1/usage and its reset time.
503 Check operator configuration or service availability before retrying.

A 202 response confirms admission. Use the job’s terminal status to determine whether rendering and delivery succeeded.