Async PDF Generation with Webhooks

Fork PDF uses a single, project-level webhook endpoint to deliver asynchronous PDF generation results. Instead of managing complex event subscriptions, your endpoint simply receives the final state: completed or failed.

Payload limit: the webhook contains metadata and a 15-minute download URL, not the PDF binary. With testResults capped at 8 KB, the payload stays small. See Limits & file sizes.

Trigger an Async Generation with cURL

curl -X POST "https://api.forkpdf.com/v1/generate-pdf" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-project-id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "format": "A4",
    "webhook": true
  }'

Example Acknowledgment

{
  "success": true,
  "message": "PDF generation queued. You will be notified via webhook.",
  "id": "xxxxxxxx-5e1e-7966-bbe5-a57a088f3fec",
  "status": "pending"
}

Example Webhook Delivery

{
  "id": "xxxxxxxx-5e1e-7966-bbe5-a57a088f3fec",
  "status": "completed",
  "success": true,
  "testResults": {},
  "downloadUrl": "https://.../result.pdf",
  "accessibility": {
    "version": 1,
    "count": 1,
    "warnings": [
      {
        "code": "TEXT_LETTER_SPACING",
        "severity": "warning",
        "message": "Text has letter-spacing. Position-based PDF readers may insert spaces between glyphs.",
        "count": 2,
        "samples": []
      }
    ]
  },
  "compliance": { "pdfUa": 2 },
  "complianceStatus": {
    "fontPolicy": "warn",
    "fontEmbedding": "verified",
    "pdfUa": "stable",
    "pdfUaVersion": 2
  },
  "warnings": []
}

PDF/UA-1/2 jobs add compliance, complianceStatus, and advisory warnings to the webhook delivery payload. PDF/UA status is stable. SDK 2.0.0 removes the deprecated experimental response field. See PDF/UA generation for the request format, authoring requirements, and limitations.

When accessibility checks find authoring issues, completed deliveries also include an accessibility object. It is advisory and may contain TEXT_LETTER_SPACING, IMAGE_MISSING_ALT, INLINE_SVG_FIGURE, LINK_EMPTY_NAME, TABLE_MISSING_HEADERS, MISSING_TITLE, MISSING_LANG, and related warning codes. It is omitted when no warnings are found.

Failed deliveries include error, testResults, and a 15-minute rawPayloadUrl so your backend can repair and resubmit the job.

Zero Data Loss Guarantee

We treat your generated documents with strict reliability. If your server is down, deploying, or returning 500-level errors, Fork PDF will not drop the payload. Failed deliveries are automatically retried and, if unsuccessful, quarantined in your project's Dead Letter Queue (DLQ) so you can safely replay them later.

DLQ Retention & Limits

To ensure system stability, your Dead Letter Queue stores failed webhooks for a maximum of 3 days. A single project can hold up to 1000 failed webhooks at a time. If your project exceeds this limit, the system will automatically drop the oldest failed webhook to make room for the newest failure.