Remover webhook
curl --request DELETE \
--url https://api.sandbox.z2pay.com/v1/webhooks/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/webhooks/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"checkoutLinkIds": [
"<string>"
],
"isActive": true,
"hasSecret": true,
"secretHint": "<string>",
"autoDisabledAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Webhook not found"
}
}{
"error": "A request with this idempotency key is already being processed"
}{
"error": "Idempotency key already used with a different request body"
}Webhooks
Remover webhook
Apaga o cadastro de um webhook e encerra o envio de notificações para aquele endereço.
DELETE
/
webhooks
/
{id}
Remover webhook
curl --request DELETE \
--url https://api.sandbox.z2pay.com/v1/webhooks/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/webhooks/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"checkoutLinkIds": [
"<string>"
],
"isActive": true,
"hasSecret": true,
"secretHint": "<string>",
"autoDisabledAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Webhook not found"
}
}{
"error": "A request with this idempotency key is already being processed"
}{
"error": "Idempotency key already used with a different request body"
}DELETE /webhooks/:id
Faz parte do recurso Webhooks — o cadastro e o catálogo de eventos estão lá.
Remove o webhook e devolve 200 com o registro removido. A partir daí nenhum evento é enviado
para aquele endereço.
deletedAt preenchido é a confirmação da remoção. Ele só aparece nesta resposta: as demais
leituras nunca devolvem registro removido — o webhook some da
listagem e passa a responder 404 na
busca por ID.Não há como desfazer, e o
secret vai junto. Para voltar a receber é preciso
criar outro webhook, que nasce com um segredo novo — o seu receptor
precisa passar a verificar a assinatura com ele.Se a intenção é só parar por um tempo, desative em vez de remover: o
cadastro e o segredo permanecem.As entregas já registradas continuam consultáveis em
Listar deliveries — o histórico não é apagado com o cadastro. O que
não dá mais é reprocessá-las: sem o webhook, o reenvio
responde
404 WEBHOOK_NOT_FOUND.Exemplo
curl -X DELETE https://api.sandbox.z2pay.com/v1/webhooks/whk_k9clfafnldd96dbbxruh34233 \
-H "x-api-key: SUA_CHAVE_DE_SANDBOX"
Resposta 200
{
"id": "whk_k9clfafnldd96dbbxruh34233",
"name": "Notificações de pagamento",
"url": "https://meusite.com/webhooks/z2pay",
"events": ["transaction.paid", "transaction.refunded"],
"isActive": false,
"hasSecret": true,
"secretHint": "whsec_kQ8v…rS8t",
"autoDisabledAt": null,
"createdAt": "2026-06-24T13:45:00.000Z",
"updatedAt": "2026-06-24T14:25:00.000Z",
"deletedAt": "2026-06-24T14:25:00.000Z"
}
Response
Webhook removido