Referência REST

Webhooks

As rotas de Webhooks. Todo corpo é JSON, e o erro sempre volta como um objeto com código e mensagem.

GET

/v1/webhooks

List webhook endpoints

Resposta (object[])

idstringObrigatório
Zaiped id (developerWebhooks)
urlstringObrigatório
eventsstring[]Obrigatório
enabledbooleanObrigatório
createdAtnumberObrigatório
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.

Corpo da requisição

urlstringObrigatório
eventsstring[]Obrigatório

Resposta (object)

idstringObrigatório
Zaiped id (developerWebhooks)
urlstringObrigatório
eventsstring[]Obrigatório
secretstringObrigatório
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

Parâmetros de caminho

webhookIdstringObrigatório
The webhook id, as returned by list_webhooks.

Resposta (object)

idstringObrigatório
Zaiped id (developerWebhooks)
urlstringObrigatório
eventsstring[]Obrigatório
enabledbooleanObrigatório
createdAtnumberObrigatório
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

Parâmetros de caminho

webhookIdstringObrigatório
The webhook id.

Corpo da requisição

urlstring
eventsstring[]
enabledboolean

Resposta (object)

idstringObrigatório
Zaiped id (developerWebhooks)
urlstringObrigatório
eventsstring[]Obrigatório
enabledbooleanObrigatório
createdAtnumberObrigatório
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

Parâmetros de caminho

webhookIdstringObrigatório
The webhook id.

Resposta (object)

oktrueObrigatório
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.

Parâmetros de caminho

webhookIdstringObrigatório
The webhook id.

Resposta (object)

deliveryIdstringObrigatório
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.

Parâmetros de caminho

webhookIdstringObrigatório
The webhook id.

Resposta (object[])

idstringObrigatório
Zaiped id (developerWebhookDeliveries)
eventstringObrigatório
status"pending" | "delivered" | "failed"Obrigatório
attemptsnumberObrigatório
lastStatusCodenumber
lastErrorstring
nextAttemptAtnumber
createdAtnumberObrigatório
curl -X GET "https://zaiped.com/v1/webhooks/YOUR_WEBHOOK_ID/deliveries" \
  -H "Authorization: Bearer zp_..."
Referência REST