Skip to content

Webhook

Register outbound webhooks signed with HMAC. · 8 endpoints

This key's webhooks

GET/api/v1/webhooksScope: webhooks:manage

Example 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:manage

Deplao 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)

name
optional
string
max 100 · default ""
url
required
string (uri)
max 2000
events
optional
string[]
max 50 items · default ["*"]
account_ids
optional
string[]
max 200 items
secret
optional
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:manage

Parameters

id
path · 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:manage

Parameters

id
path · required
string
max 200

Request body (JSON)

name
optional
string
max 100
url
optional
string (uri)
max 2000
events
optional
string[]
max 50 items
account_ids
optional
array | null
max 200 items
active
optional
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:manage

Parameters

id
path · 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:manage

Parameters

id
path · 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:manage

Parameters

id
path · required
string
max 200
status
query · optional
"pending" | "delivered" | "failed"
limit
query · 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:manage

Parameters

id
path · 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"