Webhook
Register outbound webhooks signed with HMAC. · 8 endpoints
- GET/webhooks
- POST/webhooks
- GET/webhooks/{id}
- PATCH/webhooks/{id}
- DELETE/webhooks/{id}
- POST/webhooks/{id}/test
- GET/webhooks/{id}/deliveries
- POST/webhook-deliveries/{id}/retry
This key's webhooks
GET
/api/v1/webhooksScope: webhooks:manageExample request
bash
curl "http://127.0.0.1:9900/api/v1/webhooks" \
-H "Authorization: Bearer dpk_xxx"Register a webhook (the secret is returned once)
POST
/api/v1/webhooksScope: webhooks:manageDeplao POSTs events to url with the signature X-Deplao-Signature: v1=<HMAC-SHA256(secret, timestamp + "." + body)>. See the "Webhooks" guide.
URLs on a private network (localhost, 192.168.x, 10.x) are only allowed when the call comes from the machine running Deplao itself (not through a tunnel), or when the api_allow_private_urls setting is enabled.
Request body (JSON)
nameoptional | string max 100 · default "" | |
urlrequired | string (uri) max 2000 | |
eventsoptional | string[] max 50 items · default ["*"] | |
account_idsoptional | string[] max 200 items | |
secretoptional | string max 200 | Empty = generated by Deplao |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/webhooks" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"name":"CRM sync","url":"https://crm.example.com/deplao","events":["message.received","friend.request.received"]}'Get a webhook
GET
/api/v1/webhooks/{id}Scope: webhooks:manageParameters
idpath · required | string max 200 |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/webhooks/{id}" \
-H "Authorization: Bearer dpk_xxx"Update a webhook / re-enable it after it turned itself off
PATCH
/api/v1/webhooks/{id}Scope: webhooks:manageParameters
idpath · required | string max 200 |
Request body (JSON)
nameoptional | string max 100 | |
urloptional | string (uri) max 2000 | |
eventsoptional | string[] max 50 items | |
account_idsoptional | array | null max 200 items | |
activeoptional | boolean |
Example request
bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/webhooks/{id}" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"name":"string","url":"https://example.com/file.jpg","events":[]}'Delete a webhook
DELETE
/api/v1/webhooks/{id}Scope: webhooks:manageParameters
idpath · required | string max 200 |
Example request
bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/webhooks/{id}" \
-H "Authorization: Bearer dpk_xxx"Send a test "ping" event now
POST
/api/v1/webhooks/{id}/testScope: webhooks:manageParameters
idpath · required | string max 200 |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/webhooks/{id}/test" \
-H "Authorization: Bearer dpk_xxx"Most recent deliveries (default 100, max 500)
GET
/api/v1/webhooks/{id}/deliveriesScope: webhooks:manageParameters
idpath · required | string max 200 | |
statusquery · optional | "pending" | "delivered" | "failed" | |
limitquery · optional | integer ≥ 1 · ≤ 500 · default 100 |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/webhooks/{id}/deliveries" \
-H "Authorization: Bearer dpk_xxx"Retry a failed delivery
POST
/api/v1/webhook-deliveries/{id}/retryScope: webhooks:manageParameters
idpath · required | string max 200 |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/webhook-deliveries/{id}/retry" \
-H "Authorization: Bearer dpk_xxx"