Atualizar webhook
curl --request PATCH \
--url https://api.upag.io/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": {},
"events": [
{}
],
"description": {},
"active": true,
"headers": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}], description: {}, active: true, headers: {}})
};
fetch('https://api.upag.io/v1/webhooks/{webhookId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/webhooks/{webhookId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}], description: {}, active: true, headers: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Endpoints
Atualizar webhook
Altera URL, eventos, headers ou status do webhook
PATCH
https://api.upag.io
/
v1
/
webhooks
/
{webhookId}
Atualizar webhook
curl --request PATCH \
--url https://api.upag.io/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": {},
"events": [
{}
],
"description": {},
"active": true,
"headers": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}], description: {}, active: true, headers: {}})
};
fetch('https://api.upag.io/v1/webhooks/{webhookId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/webhooks/{webhookId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: {}, events: [{}], description: {}, active: true, headers: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Permissão:
Todos os campos são opcionais; só os enviados mudam. O
webhook.write
Endpoint
curl -X PATCH https://api.upag.dev/v1/webhooks/aa0e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"active": false,
"events": ["charge.paid"]
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const webhook = await upag.webhooks.update('aa0e8400-e29b-41d4-a716-446655440000', {
active: false,
events: ['charge.paid'],
});
Em produção use
https://api.upag.io/v1 com sk_live_.... O SDK escolhe o host pela chave.Parâmetros
string (uuid)
required
ID do webhook.
string (uri)
Nova URL de destino.
array
Substitui a lista de eventos inteira (mínimo de um).
string | null
Rótulo interno.
boolean
Ativa ou desativa as entregas.
object
Substitui os headers extras por inteiro.
secret não é alterável.
Resposta
200 OK
Response
{
"id": "aa0e8400-e29b-41d4-a716-446655440000",
"description": "Order events",
"active": false,
"url": "https://example.com/webhooks",
"headers": { "X-Custom": "value" },
"events": ["charge.paid"],
"secret": "whsec_abc123...",
"createdAt": "2026-03-18T09:00:00.000Z",
"updatedAt": "2026-03-18T10:00:00.000Z"
}