Skip to main content

Webhook endpoints

The URLs that receive Régua de Cobrança events (charge.paid, agreement.accepted…). rotate-secret generates a new HMAC secret, test delivers a real webhook.test event, and deliveries lists the deliveries and requeues a failed one.

CommandHTTPDescription
webhook-endpoints listGET /v1/webhook-endpointsList webhook endpoints
webhook-endpoints createPOST /v1/webhook-endpointsCreate webhook endpoint
webhook-endpoints getGET /v1/webhook-endpoints/{id}Get webhook endpoint
webhook-endpoints updatePATCH /v1/webhook-endpoints/{id}Update webhook endpoint
webhook-endpoints deleteDELETE /v1/webhook-endpoints/{id}Delete webhook endpoint
webhook-endpoints rotate-secretPOST /v1/webhook-endpoints/{id}/rotate-secretRotate secret
webhook-endpoints testPOST /v1/webhook-endpoints/{id}/testSend test event
webhook-endpoints deliveries retryPOST /v1/webhook-endpoints/{id}/deliveries/{deliveryId}/retryRetry delivery
webhook-endpoints deliveries listGET /v1/webhook-endpoints/{id}/deliveriesList endpoint deliveries

Examples​

--params carries query, path and header parameters (id, page, filters, X-Workspace-Id); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# Create an endpoint for paid and overdue charges
kobana dunning webhook-endpoints create \
--json '{"url": "https://example.com/webhooks/kobana", "events": ["charge.paid", "charge.overdue"]}'

# Send a test event
kobana dunning webhook-endpoints test --params '{"id": "ENDPOINT_ID"}'

# Failed deliveries
kobana dunning webhook-endpoints deliveries list --params '{"id": "ENDPOINT_ID", "status": "failed"}'

# Retry a delivery
kobana dunning webhook-endpoints deliveries retry --params '{"id": "ENDPOINT_ID", "deliveryId": "DELIVERY_ID"}'

# Rotate the secret
kobana dunning webhook-endpoints rotate-secret --params '{"id": "ENDPOINT_ID"}' --dry-run

Next steps​