Apiable Webhooks API
# How Webhooks Work Webhooks are a way for services to communicate with each other in real time. When an event occurs, the Webhook sends an HTTP POST request to the URL that you've configured. The Webhook itself is unaware of any specific authorization mechanisms like the Apiable Lambda authorizer, and the Webhook URL can be any endpoint capable of receiving HTTP POST requests. Optionally, you can include custom headers in the request. These headers will be appended automatically by the Webhook to the HTTP POST request, adding any additional information required for the endpoint. ## Testing a Webhook before posting You can test a Webhook by sending a POST request to the Webhook URL manually. Here’s an example curl command that simulates the Webhook sending a POST request: ```bash curl -X POST https:/apiable.example.io/webhook \ -H "Content-Type: application/json" \ -H "api-key: MY-API-KEY" \ -H "Custom-Header-1: value1" \ -H "Custom-Header-2: value2" \ -d '{ "id": "67040bcb1eb964694d999a68", "events": [ "SUBSCRIPTION_CREATED" ], "whsec": "whsec_CoX***pc=" }' ``` ## Example Webhook Configuration In the following example, a Webhook is configured to send an HTTP POST request to a URL upon the occurrence of a `SUBSCRIPTION_CREATED` event. The parameters "whsec" and "headers" are optional. ```json { "id": "67040bcb1eb964694d999a68", "events": [ "SUBSCRIPTION_CREATED" ], "url": "https:/apiable.example.io/webhook", "headers": { "api-key": "MY-API-KEY", "Custom-Header-1": "value1", "Custom-Header-2": "value2" } } ```