Criar webhook
curl --request POST \
--url https://api.upag.io/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": {},
"events": [
{}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}]})
};
fetch('https://api.upag.io/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/webhooks';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}]})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Endpoints
Criar webhook
Registra URL e eventos; retorna o signing secret
POST
https://api.upag.io
/
v1
/
webhooks
Criar webhook
curl --request POST \
--url https://api.upag.io/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": {},
"events": [
{}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}]})
};
fetch('https://api.upag.io/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/webhooks';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}]})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Endpoint
curl -X POST https://api.upag.io/v1/webhooks \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"description": "Order events",
"url": "https://example.com/webhooks",
"events": ["charge.paid", "transfer.completed"],
"active": true,
"headers": { "X-Custom": "value" }
}'
Parâmetros
string (uri)
required
URL HTTPS de destino.
array
required
Um ou mais eventos (lista em Webhooks — overview).
string
Rótulo interno.
boolean
Padrão
true.object
Cabeçalhos extras enviados em cada POST.
Resposta
201 Created
Response
{
"id": "aa0e8400-e29b-41d4-a716-446655440000",
"description": "Order events",
"active": true,
"url": "https://example.com/webhooks",
"headers": { "X-Custom": "value" },
"events": ["charge.paid", "transfer.completed"],
"secret": "whsec_abc123...",
"createdAt": "2026-03-18T09:00:00.000Z",
"updatedAt": "2026-03-18T09:00:00.000Z"
}
secret para validar assinaturas.