Webhooks
Atualizar Webhook
PUT
/v1/users/webhooks/:idBase URL Produção:
https://api.validapay.com.brBase URL Sandbox:
https://sandbox.validapay.com.brAutenticação
bearerAuthorizationstring · header · obrigatório
Envie no header:
Authorization: Bearer {{token}}Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Id |
Atualiza o endereço ou os eventos que disparam a notificação.
Atualizar webhook
| Campo | Obrig. | Tipo | Descrição |
|---|---|---|---|
url | ❌ | string | Novo endpoint |
events | ❌ | string[] | Novos eventos |
status | ❌ | string | active inactive |
authToken | ❌ | string | Novo token |
Body
application/json
Content-Type:application/json
{
"url": "https://meusite.com/novo-webhook",
"events": [
"payment.success",
"payment.failed"
],
"status": "active",
"authToken": "novo-token"
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
url | string | - | - |
events[2] | array | - | - |
status | string | - | - |
authToken | string | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/users/webhooks/:id';
const options = {
method: 'PUT',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https://meusite.com/novo-webhook",
"events": [
"payment.success",
"payment.failed"
],
"status": "active",
"authToken": "novo-token"
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"webhookId": "wh_xxx",
"url": "https://meusite.com/novo-webhook",
"status": "active"
}404404
{
"code": "WEBHOOK_NOT_FOUND"
}