Overview
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.
Usage
The first request creates the PDF. Retrying with the same key returns the exact same response — same id, same url, no additional credit charged.
Rules
- 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:
- 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.
Key naming patterns
Use keys that map to your business logic:
Don’t use random UUIDs as idempotency keys — they defeat the purpose. Use deterministic keys derived from your business entities so retries naturally deduplicate.
How it works internally
- 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.