API Documentation

Integrate PDFEx into your application with our simple, secure 2-step API.

Authentication

All requests to the generator endpoint require an API Key. You can manage your API keys in the dashboard. Include the key in the Authorization header of your requests.

Authorization: Bearer <YOUR_API_KEY>
1

Generate Token

Send your data and template ID to generate a single-use token. This operation is non-blocking and instaneous.

Endpoint

POST/api/pdf/token

Request Body

  • template_id (string) Required
  • data (object) Required JSON data
curl -X POST https://pdfex.io/api/pdf/token \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "651...", 
    "data": { "name": "Alice" }
  }'

Success Response (200 OK)

{
  "success": true,
  "token": "65eb...",
  "url": "/api/pdf/65eb..."
}
2

Retrieve PDF

Use the returned URL or Token to fetch the generated PDF file.

Endpoint

GET/api/pdf/:token
curl -O https://pdfex.io/api/pdf/65eb...