Network failures happen. When a request times out, you don’t know if PDFBase processed it or not. Idempotency keys let you safely retry without creating duplicate PDFs or double-processing batch jobs.Pass an Idempotency-Key header with any POST request. If PDFBase has already processed a request with that key, it returns the original response instead of creating a new resource.
Keys are scoped to your account. Two different accounts can use the same key string without conflict.
Keys expire after 24 hours. After that, the same key can be reused for a new request.
Keys are tied to parameters. Reusing a key with different request parameters returns a 409 Conflict:
{ "error": { "type": "idempotency_error", "code": "idempotency_key_conflict", "message": "Idempotency key 'order-42-invoice' was already used with different parameters.", "param": null }}
Keys work on all POST endpoints — PDF creation, template creation, batch creation, merge, split, etc.
GET, PATCH, DELETE are inherently idempotent. You don’t need keys for those.
Don’t use random UUIDs as idempotency keys — they defeat the purpose. Use deterministic keys derived from your business entities so retries naturally deduplicate.
PDFBase hashes the idempotency key + your account ID.
On first request: stores the hash → request parameters → response.
On retry: compares stored parameters to new parameters. If they match, returns the stored response. If they don’t, returns 409.
The stored response is returned even if the original PDF file has expired — the response metadata (ID, pages, bytes) is preserved, but the url may be regenerated.
Assistant
Responses are generated using AI and may contain mistakes.