PDF extraction
How to trigger Zapier when PDF processing finishes
Use okraPDF lifecycle webhooks, REST Hooks, or Webhooks by Zapier to start Zaps when hosted PDFs are ready or failed, without polling.
Zapier is the broadest distribution layer for PDF workflows. It is the right choice when the destination is not one system, but whichever app the operations team already runs: Google Sheets, Airtable, Slack, Gmail, HubSpot, Notion, QuickBooks, or a custom webhook.
This is API-feasible today. Zapier supports instant webhook-style triggers through REST Hooks in Zapier Platform CLI, and Webhooks by Zapier can catch POST requests from any HTTPS source. The API exposes document lifecycle webhooks for document.created, document.processed, document.failed, and document.deleted.
Choose the Zapier path
There are two viable paths.
| Path | Use when | What starts the Zap |
|---|---|---|
| Native Zapier app | You have the private/beta app available | REST Hook trigger |
| Webhooks by Zapier | You need a working setup today without native app access | Zapier Catch Hook URL |
Both paths use the same event model. The difference is setup polish. REST Hooks hide the webhook URL from the user and manage subscribe/unsubscribe. Webhooks by Zapier makes the hook URL visible and manual.
For most teams, okraPDF should own PDF hosting and lifecycle events while Zapier owns the handoff into the rest of the stack.
Trigger on the right event
Pick the event based on the job.
document.created: the upload was accepted. Use this for intake logs.document.processed: the hosted PDF and public URLs are ready. Use this for rows, Slack messages, CRM updates, and approvals.document.failed: processing reached a terminal failure. Use this for support queues.document.deleted: the user removed the document. Use this for cleanup.
Most Zaps should use document.processed. It prevents downstream steps from reading a partially processed document.
Native app setup
In Zapier:
- Create a new Zap.
- Choose okraPDF as the trigger app.
- Choose PDF Ready.
- Connect your account.
- Test the trigger with a recent PDF.
Under the hood, Zapier subscribes its hook URL to the lifecycle event. When the Zap is turned off, Zapier unsubscribes so delivery stops.
Webhooks by Zapier fallback
In Zapier:
- Create a new Zap.
- Choose Webhooks by Zapier.
- Pick Catch Hook.
- Copy the generated hook URL.
In webhook settings:
- Open webhook settings.
- Create an endpoint with the Zapier hook URL.
- Select
document.processedand optionallydocument.failed. - Save the signing secret.
Upload a PDF and return to Zapier to test the hook. Zapier should receive an event envelope with type, created_at, subscription_id, and data.
The equivalent API call is:
curl -X POST https://api.okrapdf.com/v1/webhooks \
-H "Authorization: Bearer $OKRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "document.processed",
"target_url": "https://hooks.zapier.com/hooks/catch/...",
"source": "zapier"
}'
Map the Zap payload
Keep a stable set of fields in the Zap:
- Event type
- Document ID
- Job ID or run ID
- Filename
- Hosted PDF URL
- Direct PDF URL
- Extracted fields when a workflow-specific extraction action adds them
- Error message for failures
For arrays like invoice line items, add a Looping by Zapier step or use a destination action that accepts line arrays. For one-row summaries, map fields directly.
Common destination recipes
Good first Zaps:
- PDF Ready -> Google Sheets -> Create Spreadsheet Row
- PDF Ready -> Slack -> Send Channel Message
- PDF Failed -> Gmail -> Send Email to operations
- Gmail Attachment -> Upload PDF action -> PDF Ready Zap -> Airtable record
- Google Drive New File -> Upload PDF action -> PDF Ready Zap -> CRM update
Keep upload and ready as separate concerns. Upload Zaps send PDFs into the upload action. Ready Zaps react after processing finishes.
Reliability checklist
Use an idempotency key. The safest key is the event ID or document ID plus event type. If a Zap retries, the destination should not create duplicate records.
Add a failure Zap. Every production PDF workflow needs a visible failed-processing path.
Store the hosted URL in the destination. It gives reviewers a stable way back to the source document.
Avoid putting secrets in Zap field mappings. API keys and webhook signing secrets belong in the app connection or webhook configuration, not in text fields.
For engineering-owned routing, use the public webhook adapter example in okrapdf/examples. For the native app path, the implementation lives in integrations/zapier and uses REST Hook subscribe/unsubscribe calls against /v1/webhooks.