Webhooks

Atualizar Webhook

PUT/v1/users/webhooks/:id
Base URL Produção:https://api.validapay.com.br
Base URL Sandbox:https://sandbox.validapay.com.br

Autenticação

bearerAuthorizationstring · header · obrigatório

Envie no header:

Authorization: Bearer {{token}}

Path Parameters

NameTypeRequiredDescription
idstringRequiredId

Atualiza o endereço ou os eventos que disparam a notificação.

Atualizar webhook

CampoObrig.TipoDescrição
urlstringNovo endpoint
eventsstring[]Novos eventos
statusstringactive inactive
authTokenstringNovo 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

FieldTypeRequiredDescription
url
string-
-
events[2]
array-
-
status
string-
-
authToken
string-
-

Headers

NameTypeValueRequired
Content-Type-application/jsonOptional
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"
}