Crear un endpoint de webhook
post/v1/webhooks/endpoints
Registra una URL para recibir eventos salientes firmados. El secret se devuelve una sola vez: guardalo para verificar la firma Cauril-Signature.
Request
BASH
curl -X POST https://api.cauril.com/v1/webhooks/endpoints \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"url": "https://tuapp.com/webhooks/cauril",
"enabled_events": [
"payment.succeeded",
"payment.failed",
"refund.succeeded"
],
"description": "string"
}'Cuerpo CreateWebhookEndpoint
| urlreq | string · uri | |
| enabled_events | string[] | Tipos de evento a recibir. Vacío = todos. |
| description | string |
Respuestas
| 201 | Endpoint creado | WebhookEndpoint |
| 400 | Error | Error |
Ejemplo de respuesta · 201
JSON
{
"object": "webhook_endpoint",
"id": "whe_01J...",
"url": "string",
"enabled_events": [
"string"
],
"status": "active",
"secret": "string",
"created_at": "2026-06-01T12:00:00Z"
}