Webhooks
Cadastre endpoints e acompanhe as entregas de eventos.
Permissões: webhooks.view para consultas; webhooks.manage para cadastro, exclusão, teste e retry.
/v1/webhooks200 OKfull_accessinvoices_read_write
Lista as configurações de webhook da conta.
curl "$BASE_URL/webhooks" -H "X-API-Key: $CORVO_API_KEY"Resposta — 200 OK
{
"data": [
{
"id": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
"url": "https://integracao.example.com/webhooks/corvo",
"events": [
"nfse.invoice.authorized",
"nfse.invoice.documents_ready"
],
"active": true,
"createdAt": "2026-10-10T12:00:00.000Z",
"updatedAt": "2026-10-10T12:00:00.000Z"
}
],
"pagination": {
"limit": 50,
"hasMore": false,
"nextCursor": null
}
}/v1/webhooks201 Createdfull_access
Cadastra uma configuração de webhook.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| url | string | ✓ | Deve incluir protocolo HTTP ou HTTPS e não apontar para hosts privados/loopback/link-local. |
| events | string[] | ✓ | Array não vazio contendo somente eventos públicos aceitos (lista abaixo). |
curl -X POST "$BASE_URL/webhooks" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://integracao.example.com/webhooks/corvo",
"events": [
"nfse.invoice.authorized",
"nfse.invoice.documents_ready",
"nfse.invoice.email_sent",
"nfse.invoice.email_failed"
]
}'Resposta — 201 Created
{
"data": {
"id": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
"url": "https://integracao.example.com/webhooks/corvo",
"events": [
"nfse.invoice.authorized",
"nfse.invoice.documents_ready",
"nfse.invoice.email_sent",
"nfse.invoice.email_failed"
],
"active": true,
"createdAt": "2026-10-10T12:00:00.000Z",
"updatedAt": "2026-10-10T12:00:00.000Z",
"secret": "segredo-exibido-apenas-na-criacao"
}
}Eventos aceitos
nfse.invoice.authorizednfse.invoice.rejectednfse.invoice.failednfse.invoice.reconciliation_requirednfse.invoice.manual_reviewnfse.invoice.documents_readynfse.invoice.email_sentnfse.invoice.email_failednfse.invoice.fiscal_discrepancynfse.invoice.cancellednfse.invoice.cancellation_rejected
/v1/webhooks/:id200 OKfull_access
Exclui uma configuração de webhook.
curl -X DELETE "$BASE_URL/webhooks/$WEBHOOK_ID" \
-H "X-API-Key: $CORVO_API_KEY"Resposta — 200 OK
{
"data": {
"deleted": true
}
}/v1/webhooks/:id/test200 OKfull_access
Envia o evento webhook.test para a URL cadastrada.
curl -X POST "$BASE_URL/webhooks/$WEBHOOK_ID/test" \
-H "X-API-Key: $CORVO_API_KEY"Resposta — 200 OK
{
"data": {
"sent": true
}
}/v1/webhooks/deliveries200 OKfull_accessinvoices_read_write
Lista as entregas de webhook, ordenadas por criação decrescente.
Query
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| hours | number | Janela em horas (padrão 24); fica fixa nas páginas seguintes. | |
| limit | integer | Padrão 50; aceita inteiros de 1 a 1000 (valor inválido retorna 400). | |
| cursor | string | nextCursor da página anterior, mantendo os mesmos filtros. | |
| environment | string | test ou live. |
curl "$BASE_URL/webhooks/deliveries?hours=24&limit=50" \
-H "X-API-Key: $CORVO_API_KEY"Resposta — 200 OK
{
"data": [
{
"id": "d4e5f6a7-8b9c-4d0e-1f2a-3b4c5d6e7f8a",
"eventType": "nfse.invoice.authorized",
"environment": "test",
"url": "https://integracao.example.com/webhooks/corvo",
"statusCode": 200,
"status": "sent",
"retryCount": 0,
"createdAt": "2026-10-10T12:02:00.000Z"
}
],
"pagination": {
"limit": 50,
"hasMore": true,
"nextCursor": "eyJ2IjoxLCJjcmVhdGVkQXQiOiIyMDI2LTEwLTA5VDEyOjAwOjAwLjAwMDAwMFoiLCJpZCI6IjNmMWM4YTkwIn0"
}
}/v1/webhooks/deliveries/stats200 OKfull_accessinvoices_read_write
Consulta estatísticas das entregas recentes.
Query
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| hours | integer | Padrão 24. | |
| environment | string | test ou live. |
curl "$BASE_URL/webhooks/deliveries/stats?hours=24" \
-H "X-API-Key: $CORVO_API_KEY"Resposta — 200 OK
{
"data": {
"total": 10,
"sent": 7,
"failed": 1,
"pending": 1,
"delayed": 1
}
}/v1/webhooks/deliveries/:id/retry200 OKfull_access
Agenda nova tentativa de entrega de um webhook.
curl -X POST "$BASE_URL/webhooks/deliveries/$DELIVERY_ID/retry" \
-H "X-API-Key: $CORVO_API_KEY"Resposta — 200 OK
{
"data": {
"retried": true
}
}