Webhooks

Overview

Webhooks send real-time notifications to your server when events occur in Pelcro. Configure webhook endpoints to receive notifications about subscriptions, payments, customers, and other events. This enables you to build integrations and automate workflows.


How It Works

  1. Create a webhook — Register your endpoint URL and select events to receive
  2. Events occur — When selected events happen, Pelcro sends a POST request
  3. Your server responds — Process the event and return a 2xx status code
  4. Retry on failure — Failed deliveries are retried with exponential backoff

Example: Create a webhook for subscription_canceled events. When a customer cancels, Pelcro posts the subscription details to your endpoint. Your server updates your CRM and sends a win-back email.


API Endpoints

MethodEndpointDescription
GET/api/v1/core/webhooksList webhooks
POST/api/v1/core/webhooksCreate webhook
GET/api/v1/core/webhooks/{id}Get webhook
PUT/api/v1/core/webhooks/{id}Update webhook
DELETE/api/v1/core/webhooks/{id}Delete webhook

Webhook Object

AttributeTypeDescription
idintegerUnique identifier for the webhook
urlstringThe endpoint URL where events are sent
descriptionstringA description of what this webhook is for
eventsarrayArray of subscribed event type names
all_events_enabledbooleanWhether all event types are enabled
statusstringenabled or disabled
created_attimestampUnix timestamp of creation
updated_attimestampUnix timestamp of last update

Important Behaviors

  • Max 10 webhooks per account. Returns 400 if the limit is reached.
  • URL validation: The endpoint URL must return HTTP 200 when called via POST during creation and update.
  • URL uniqueness: Each URL can only be used once per account.
  • Secret: A unique secret is auto-generated on creation for signature verification. It is not returned in API responses.
  • Event names: Use lowercase snake_case format (e.g. subscription_created, invoice_payment_succeeded, customer_updated). Case-insensitive on input.