Webhooks
Endpoints para gerenciar os webhooks da sua conta. Para os payloads, headers e a verificação de assinatura, veja o guia de webhooks.
| Método | Endpoint | Descrição |
|---|---|---|
POST |
/api/webhooks |
Registra um endpoint |
GET |
/api/webhooks |
Lista os endpoints registrados |
POST |
/api/webhooks/{magic_id}/test |
Dispara uma entrega de teste assinada |
DELETE |
/api/webhooks/{magic_id} |
Remove um endpoint |
Registrar
Seção intitulada “Registrar”POST /api/webhooks
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
url |
string | Sim | URL HTTPS do seu servidor |
events |
string[] | Sim | Eventos assinados: transaction, withdraw, dispute |
curl --request POST \ --url https://api.avexus.app/api/webhooks \ --header 'Content-Type: application/json' \ --header 'x-api-key: <API_KEY>' \ --header 'x-token: <TOKEN>' \ --header 'idempotency-key: <UNIQUE_KEY>' \ --data '{ "url": "https://seu-servidor.com.br/webhooks/avexus", "events": ["transaction", "withdraw", "dispute"] }'curl --request POST \ --url https://api.avexus.app/api/webhooks \ --header 'Content-Type: application/json' \ --header 'x-api-key: <API_KEY>' \ --header 'x-token: <TOKEN>' \ --header 'idempotency-key: <UNIQUE_KEY>' \ --data '{ "url": "https://seu-servidor.com.br/webhooks/cobrancas", "events": ["transaction"] }'curl --request POST \ --url https://api.avexus.app/api/webhooks \ --header 'Content-Type: application/json' \ --header 'x-api-key: <API_KEY>' \ --header 'x-token: <TOKEN>' \ --header 'idempotency-key: <UNIQUE_KEY>' \ --data '{ "url": "https://seu-servidor.com.br/webhooks/saques", "events": ["withdraw"] }'{ "code": 201, "content": { "magic_id": "wh_03UdoKvLNLHg", "url": "https://seu-servidor.com.br/webhooks/avexus", "secret": "whsec_2f1f9e5cbe7b4b3c9a6d", "events": ["transaction", "withdraw", "dispute"], "active": true, "created_at": "2026-07-24T18:38:25.688Z", "updated_at": "2026-07-24T18:38:26.703Z" }, "message": "Webhook created", "timestamp": "2026-07-24T18:38:26.703Z"}POST /api/webhooks/{magic_id}/test
Enfileira uma entrega sintética e assinada para o endpoint — o jeito de validar a integração de ponta a ponta sem esperar um pagamento real.
| Campo | Tipo | Descrição |
|---|---|---|
event |
string | Opcional. Qual formato enviar: transaction, withdraw ou dispute. |
curl --request POST \ --url https://api.avexus.app/api/webhooks/wh_03UdoKvLNLHg/test \ --header 'Content-Type: application/json' \ --header 'x-api-key: <API_KEY>' \ --header 'x-token: <TOKEN>' \ --data '{ "event": "transaction" }'{ "code": 202, "content": { "delivery_id": "0f2c9a41-6c58-4d0e-9a3f-6d5a1c7b2e88", "magic_id": "wh_03UdoKvLNLHg", "url": "https://seu-servidor.com.br/webhooks/avexus", "event": "transaction", "test": true }, "message": "Test webhook queued", "timestamp": "2026-07-24T18:38:26.703Z"}GET /api/webhooks
curl --request GET \ --url https://api.avexus.app/api/webhooks \ --header 'x-api-key: <API_KEY>' \ --header 'x-token: <TOKEN>' \ --header 'x-timezone: America/Sao_Paulo'Os secret vêm mascarados:
{ "code": 200, "content": [ { "magic_id": "wh_03UdoKvLNLHg", "url": "https://seu-servidor.com.br/webhooks/avexus", "secret": "whsec_********", "events": ["transaction", "withdraw", "dispute"], "active": true, "created_at": "2026-07-24T18:38:25.688Z", "updated_at": "2026-07-24T18:38:26.703Z" } ], "message": "Webhooks returned", "timestamp": "2026-07-24T18:38:26.703Z"}Remover
Seção intitulada “Remover”DELETE /api/webhooks/{magic_id}
curl --request DELETE \ --url https://api.avexus.app/api/webhooks/wh_03UdoKvLNLHg \ --header 'x-api-key: <API_KEY>' \ --header 'x-token: <TOKEN>'{ "code": 200, "content": { "magic_id": "wh_03UdoKvLNLHg" }, "message": "Webhook deleted", "timestamp": "2026-07-24T18:38:26.703Z"}Veja também
Seção intitulada “Veja também”- Receber webhooks — payloads, headers e verificação HMAC.
- Cobranças — reenvio com
resend=true. - Códigos de erro.
