Register or change your webhook URL
PUT/tenant/webhookProbar
La llamada la hace tu navegador, contra el servidor que elijas arriba. Si la documentación no está servida desde el mismo origen que la API, el navegador puede bloquear la respuesta por CORS: en ese caso abre estas páginas desde la propia API (/docs) o usa el curl de arriba.
const url = 'http://localhost:3000/v1/tenant/webhook';const options = { method: 'PUT', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"url":"https://tu-dominio.com/webhooks/bolivar"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://localhost:3000/v1/tenant/webhook \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "url": "https://tu-dominio.com/webhooks/bolivar" }'Where we push events to you. You can change it whenever you want with your own key: no need to write to us. Scope tenant:write or webhooks:write (the latter only touches the webhook: it is the one to give an agent).
In a production account the URL also serves live traffic: change it with an sk_live_ key. With an sk_test_ it returns 403 insufficient_scope. In a test account it works with your sk_test_.
It must be https and point to a public address. Any destination in a non-routable range (127/8, 10/8, 172.16/12, 192.168/16, 169.254/16 and their IPv6 equivalents) is rejected, and it is checked again on every delivery, not only when registered.
url: null turns pushing off. You lose nothing: events remain available at GET /v1/events, a legitimate way to integrate if you prefer polling.
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»object
Example
https://tu-dominio.com/webhooks/bolivarResponses
Sección titulada «Responses»Webhook registrado
object
Examplegenerated
{ "tenantId": "example", "webhookUrl": "example", "next": "example"}insufficient_scope: la key no tiene el scope, o es una sk_test_ de una cuenta real (la URL sirve también a lo live; usa una key sk_live_).
object
object
Contexto estructurado del error cuando lo hay: qué límite se superó y de cuánto, qué campo es inválido, cuánto saldo había. No aparece en errores internos.
object
Código ESTABLE. Programa contra esto.
Example
{ "error": { "type": "invalid_request_error", "code": "insufficient_balance", "request_id": "req_8a0312ba896772bc441134cd" }}La URL no es válida, no es https o apunta a una dirección no pública. El mensaje dice exactamente cuál de las tres.