> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dockiln.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://docs.dockiln.io/openapi.json). Use the origin of your DocKiln instance. Client requests and errors use JSON. File downloads return binary content.

The reference includes operations from the 1.1 review build. For release-specific details, see the [migration guide](https://docs.dockiln.io/pdfshift-migration.md).

## Document generation

Submit a job, follow its status and retrieve the finished file. History returns up to 100 jobs, newest first. Pass a Unix millisecond timestamp as `before` to request earlier records. [Choose a response mode](https://docs.dockiln.io/misc/varying-responses.md).

| Operation | Method and path |
| - | - |
| [Document history](https://docs.dockiln.io/api-reference/document-history.md) | `GET /v1/documents` |
| [Queue generation](https://docs.dockiln.io/api-reference/queue-generation.md) | `POST /v1/documents` |
| [Poll generation status](https://docs.dockiln.io/api-reference/poll-generation-status.md) | `GET /v1/documents/{id}` |
| [Download a PDF](https://docs.dockiln.io/api-reference/download-generated-file.md) | `GET /v1/documents/{id}/pdf` |
| [Download a PDF or image](https://docs.dockiln.io/api-reference/download-generated-file-1.md) | `GET /v1/documents/{id}/file` |
| [Create an expiring download link](https://docs.dockiln.io/api-reference/sign-private-s3-download-for-five-minutes.md) | `GET /v1/documents/{id}/link` |
| [Preview private Open Graph image](https://docs.dockiln.io/api-reference/preview-private-open-graph-image.md) | `POST /v1/preview-image` |
| [Queue up to eight independently validated documents](https://docs.dockiln.io/api-reference/queue-up-to-eight-independently-validated-documents.md) | `POST /v1/documents/batch` |

## Templates

Start from a library layout or save a workspace draft. Publish a snapshot when the layout is ready to use.

| Operation | Method and path |
| - | - |
| [Starter layouts](https://docs.dockiln.io/api-reference/starter-layouts.md) | `GET /v1/library` |
| [List workspace templates](https://docs.dockiln.io/api-reference/list-workspace-templates.md) | `GET /v1/templates` |
| [Create draft](https://docs.dockiln.io/api-reference/create-draft.md) | `POST /v1/templates` |
| [Read draft](https://docs.dockiln.io/api-reference/read-draft.md) | `GET /v1/templates/{id}` |
| [Save draft](https://docs.dockiln.io/api-reference/save-draft.md) | `PUT /v1/templates/{id}` |
| [Delete a workspace template and its versions](https://docs.dockiln.io/api-reference/delete-a-workspace-template-and-its-versions.md) | `DELETE /v1/templates/{id}` |
| [Snapshot current draft](https://docs.dockiln.io/api-reference/snapshot-current-draft.md) | `POST /v1/templates/{id}/publish` |
| [Published snapshots](https://docs.dockiln.io/api-reference/published-snapshots.md) | `GET /v1/templates/{id}/versions` |
| [Download published HTML source](https://docs.dockiln.io/api-reference/download-published-html-source.md) | `GET /v1/templates/{id}/raw` |
| [Download HTML filled with JSON data](https://docs.dockiln.io/api-reference/download-html-filled-with-json-data.md) | `POST /v1/templates/{id}/html` |

## Accounts and sessions

| Operation | Method and path |
| - | - |
| [Register](https://docs.dockiln.io/api-reference/register.md) | `POST /v1/auth/register` |
| [Login](https://docs.dockiln.io/api-reference/login.md) | `POST /v1/auth/login` |
| [End session](https://docs.dockiln.io/api-reference/end-session.md) | `POST /v1/auth/logout` |
| [Account identity](https://docs.dockiln.io/api-reference/account-identity.md) | `GET /v1/account` |

## API keys

Use a signed-in session to manage credentials. [Create and verify a key](https://docs.dockiln.io/misc/getting-an-api-key.md).

| Operation | Method and path |
| - | - |
| [List key labels](https://docs.dockiln.io/api-reference/list-key-labels.md) | `GET /v1/keys` |
| [Create key and show its secret once](https://docs.dockiln.io/api-reference/create-key-and-show-its-secret-once.md) | `POST /v1/keys` |
| [Revoke key](https://docs.dockiln.io/api-reference/revoke-key.md) | `DELETE /v1/keys/{id}` |
| [Rename, enable or disable a key](https://docs.dockiln.io/api-reference/rename-enable-or-disable-a-key.md) | `PATCH /v1/keys/{id}` |

## Webhooks

Use a signed-in session for endpoint configuration and delivery history. [Verify incoming events](https://docs.dockiln.io/misc/webhook-events.md).

| Operation | Method and path |
| - | - |
| [Endpoint and delivery history](https://docs.dockiln.io/api-reference/endpoint-and-delivery-history.md) | `GET /v1/webhook` |
| [Set endpoint and rotate secret](https://docs.dockiln.io/api-reference/set-endpoint-and-rotate-secret.md) | `PUT /v1/webhook` |
| [Disable webhook](https://docs.dockiln.io/api-reference/disable-webhook.md) | `DELETE /v1/webhook` |

## Bucket delivery

Use a signed-in session to configure a customer destination. [Choose a bucket provider](https://docs.dockiln.io/misc/overview.md#export-to-your-bucket).

| Operation | Method and path |
| - | - |
| [Read destination metadata](https://docs.dockiln.io/api-reference/read-destination-metadata.md) | `GET /v1/storage` |
| [Configure a private bucket](https://docs.dockiln.io/api-reference/configure-encrypted-s3-destination.md) | `PUT /v1/storage` |
| [Disable destination for future jobs](https://docs.dockiln.io/api-reference/disable-destination-for-future-jobs.md) | `DELETE /v1/storage` |

## Usage and billing

Usage counts accepted jobs in the current UTC calendar month. Stripe operations require test credentials.

| Operation | Method and path |
| - | - |
| [Monthly usage](https://docs.dockiln.io/api-reference/monthly-usage.md) | `GET /v1/usage` |
| [Create Stripe test checkout](https://docs.dockiln.io/api-reference/create-stripe-test-checkout.md) | `POST /v1/billing/test-checkout` |
| [List the last 100 workspace requests](https://docs.dockiln.io/api-reference/list-the-last-100-workspace-requests.md) | `GET /v1/logs` |
| [Inspect redacted request metadata](https://docs.dockiln.io/api-reference/inspect-redacted-request-metadata.md) | `GET /v1/logs/{id}` |
| [Inspect UTC monthly allowances and rate limit](https://docs.dockiln.io/api-reference/inspect-utc-monthly-allowances-and-rate-limit.md) | `GET /v1/plan` |
| [Read up to 25 linked Stripe test invoices](https://docs.dockiln.io/api-reference/read-up-to-25-linked-stripe-test-invoices.md) | `GET /v1/billing/invoices` |

## Integrations

AI draft generation requires an operator-configured provider.

| Operation | Method and path |
| - | - |
| [Provider configuration status](https://docs.dockiln.io/api-reference/provider-configuration-status.md) | `GET /v1/integrations` |
| [Generate a structured draft](https://docs.dockiln.io/api-reference/generate-a-structured-draft.md) | `POST /v1/ai/template` |

## Retry a submission

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**.

## Common errors

| 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.