Webhook endpoints
/v1/webhook-endpoints — configura a dónde Rekurra te envía eventos
(subscription.created, charge.approved, etc.). Ver la guía completa de
verificación de firma en Webhooks.
El objeto WebhookEndpoint
{
"id": "we_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
"url": "https://tuapp.com/webhooks/rekurra",
"secret": "whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"events": ["subscription.created", "charge.approved"],
"active": true
}| Campo | Tipo | Descripción |
|---|---|---|
id | string | Identificador único del endpoint |
url | string | URL a la que Rekurra entrega los eventos |
secret | string | Secreto de firma (solo en la respuesta de creación) |
events | string[] | Tipos de evento suscritos |
active | boolean | Si el endpoint está activo |
Crear un webhook endpoint
POST /v1/webhook-endpoints
Request body
{
"url": "https://tuapp.com/webhooks/rekurra",
"events": ["subscription.created", "charge.approved", "charge.declined", "subscription.canceled"]
}curl -X POST https://api.rekurra.dev/v1/webhook-endpoints \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"url": "https://tuapp.com/webhooks/rekurra",
"events": ["subscription.created", "charge.approved"]
}'Response — 201 Created
Devuelve el objeto con secret incluido — guárdalo, no se vuelve a
mostrar.
Errores posibles
| Status | error.type | Causa |
|---|---|---|
400 | invalid_request | url inválida o events con un tipo desconocido |
Listar webhook endpoints
GET /v1/webhook-endpoints
curl https://api.rekurra.dev/v1/webhook-endpoints \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"Nota: los objetos devueltos en el listado no incluyen secret.
Actualizar un webhook endpoint
PATCH /v1/webhook-endpoints/{id}
curl -X PATCH https://api.rekurra.dev/v1/webhook-endpoints/we_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{ "active": false }'Errores posibles
| Status | error.type | Causa |
|---|---|---|
404 | invalid_request | El webhook endpoint no existe |
Eliminar un webhook endpoint
DELETE /v1/webhook-endpoints/{id}
curl -X DELETE https://api.rekurra.dev/v1/webhook-endpoints/we_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"