Automation & webhooks
Webhook notifications let you react to Paperoffice events in real time.
Subscribe to events
curl -X POST https://api.paperoffice.ai/v1/webhooks/subscriptions \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"target_url": "https://partner.example.com/paperoffice/webhooks",
"events": ["document.created", "workflow.completed"],
"secret": "<SIGNING_SECRET>"
}'
Validate signatures
- Read the HTTP header
X-Paperoffice-Signature. - Compute
HMAC_SHA256(body, SIGNING_SECRET). - Compare the hex value
timestamp.signaturewith the header.
Trigger workflows
curl -X POST https://api.paperoffice.ai/v1/workflows/start \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"workflow_code": "archiving-standard",
"payload": {
"document_id": "DOC-12345",
"priority": "high"
}
}'
Combine webhooks with the workflow API to automate end-to-end processes.