Webhook Endpoints
Reference for Webhooks CRUD API endpoints (List, Create, Get, Update, Delete, and Test subscriptions).
GET /v1/webhooks
Retrieves webhook subscriptions with cursor-based pagination.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | ❌ | Results per page (default 20, max 100). |
cursor | string | ❌ | Pagination cursor from previous response. |
Response 200 OK
POST /v1/webhooks
Creates a new webhook subscription to receive real-time extraction events.
The response includes signing_secret once. Store it immediately — it cannot be retrieved again. Use it to verify X-PerfectParser-Signature HMAC on incoming payloads.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | ✅ | Callback HTTP POST URL (HTTPS required in production). |
events | string[] | ✅ | extraction.document_completed, extraction.job_completed. |
secret | string | ❌ | Optional static token (min 8 chars) sent as X-Webhook-Secret. Useful for Zapier/Make. |
Response 201 Created
GET /v1/webhooks/:id
Retrieves configuration details and the last 10 delivery attempts.
Response 200 OK
PATCH /v1/webhooks/:id
Partially update a webhook subscription.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | ❌ | New callback URL. |
events | string[] | ❌ | Updated event list. |
is_active | boolean | ❌ | Enable or pause the subscription. |
Response 200 OK — returns { webhook: { ... } } envelope.
POST /v1/webhooks/:id/test
Sends a synthetic extraction.job_completed payload to your endpoint. The payload includes "test": true so you can distinguish test deliveries.
Response 200 OK
DELETE /v1/webhooks/:id
Soft-deletes a webhook subscription. No further callbacks will be triggered.
Response 204 No Content
Common Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
400 | INVALID_PAYLOAD | Validation failed (e.g. non-HTTPS URL in production). |
401 | UNAUTHORIZED | Invalid or missing API key. |
404 | RESOURCE_NOT_FOUND | Webhook not found or belongs to another account. |