The Webhooks routes. Every body is JSON, and an error always comes back as an object with a code and a message.
GET
/v1/webhooks
List webhook endpoints
Response (object[])
- idstringRequired
- Zaiped id (developerWebhooks)
- urlstringRequired
- eventsstring[]Required
- enabledbooleanRequired
- createdAtnumberRequired
- lastDeliveryAtnumber
- lastFailureAtnumber
curl -X GET "https://zaiped.com/v1/webhooks" \
-H "Authorization: Bearer zp_..."
POST
/v1/webhooks
Create a webhook endpoint
Registers an HTTPS URL for the given events (`message.received`, `message.status`, `template.status`, `number.update`, `account.notice`, `call.event`). The signing secret is returned once: verify `X-Zaiped-Signature` (`t=TIMESTAMP,v1=HEX`, where HEX is the HMAC-SHA256 of `TIMESTAMP.BODY`) with it.
Request body
- urlstringRequired
- eventsstring[]Required
Response (object)
- idstringRequired
- Zaiped id (developerWebhooks)
- urlstringRequired
- eventsstring[]Required
- secretstringRequired
curl -X POST "https://zaiped.com/v1/webhooks" \
-H "Authorization: Bearer zp_..." \
-H "Content-Type: application/json" \
-d '{
"url": "…",
"events": []
}'GET
/v1/webhooks/{webhookId}
Get a webhook endpoint
Path parameters
- webhookIdstringRequired
- The webhook id, as returned by list_webhooks.
Response (object)
- idstringRequired
- Zaiped id (developerWebhooks)
- urlstringRequired
- eventsstring[]Required
- enabledbooleanRequired
- createdAtnumberRequired
- lastDeliveryAtnumber
- lastFailureAtnumber
curl -X GET "https://zaiped.com/v1/webhooks/YOUR_WEBHOOK_ID" \
-H "Authorization: Bearer zp_..."
PUT
/v1/webhooks/{webhookId}
Update a webhook endpoint
Path parameters
- webhookIdstringRequired
- The webhook id.
Request body
- urlstring
- eventsstring[]
- enabledboolean
Response (object)
- idstringRequired
- Zaiped id (developerWebhooks)
- urlstringRequired
- eventsstring[]Required
- enabledbooleanRequired
- createdAtnumberRequired
- lastDeliveryAtnumber
- lastFailureAtnumber
curl -X PUT "https://zaiped.com/v1/webhooks/YOUR_WEBHOOK_ID" \
-H "Authorization: Bearer zp_..." \
-H "Content-Type: application/json" \
-d '{}'DELETE
/v1/webhooks/{webhookId}
Delete a webhook endpoint
Path parameters
- webhookIdstringRequired
- The webhook id.
Response (object)
- oktrueRequired
curl -X DELETE "https://zaiped.com/v1/webhooks/YOUR_WEBHOOK_ID" \
-H "Authorization: Bearer zp_..."
POST
/v1/webhooks/{webhookId}/test
Send a test event
Queues a `test` event to this endpoint, signed like any other.
Path parameters
- webhookIdstringRequired
- The webhook id.
Response (object)
- deliveryIdstringRequired
- Zaiped id (developerWebhookDeliveries)
curl -X POST "https://zaiped.com/v1/webhooks/YOUR_WEBHOOK_ID/test" \
-H "Authorization: Bearer zp_..."
GET
/v1/webhooks/{webhookId}/deliveries
List recent deliveries
The last deliveries to this endpoint, newest first, with the attempt count and the last HTTP status.
Path parameters
- webhookIdstringRequired
- The webhook id.
Response (object[])
- idstringRequired
- Zaiped id (developerWebhookDeliveries)
- eventstringRequired
- status"pending" | "delivered" | "failed"Required
- attemptsnumberRequired
- lastStatusCodenumber
- lastErrorstring
- nextAttemptAtnumber
- createdAtnumberRequired
curl -X GET "https://zaiped.com/v1/webhooks/YOUR_WEBHOOK_ID/deliveries" \
-H "Authorization: Bearer zp_..."