> For the complete documentation index, see [llms.txt](https://docs.countercyclical.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.countercyclical.io/developers/webhooks.md).

# Webhooks

Subscribe to real-time events on Countercyclical with webhooks.

{% hint style="info" %}
**Before Setting Up Webhooks**

Webhook setup requires API & Webhooks access. Ask a workspace administrator to check your plan and permissions, then open [Settings › Workspace › Developers › Webhooks](https://dashboard.countercyclical.io/settings/workspace/developers/webhooks).
{% endhint %}

See also [Event Types Catalog](https://docs.countercyclical.io/developers/webhooks/event-types-catalog) and [Stage Actions](https://docs.countercyclical.io/workspaces/stage-actions).

## What are Webhooks?

Webhooks are user-defined HTTP callbacks that are triggered by specific events on the platform. When such an event occurs, the platform makes an HTTP POST request to the URL you have configured for the webhook. This allows you to receive immediate notifications and take appropriate actions based on the event data.

## Adding a Webhook <a href="#best-practices" id="best-practices"></a>

{% hint style="info" %}
We allow you to test your webhooks right in Countercyclical with [Svix Play](https://www.svix.com/play/)
{% endhint %}

### **Create a Webhook URL**

First, you need to set up a URL on your server that can accept incoming HTTP POST requests. This URL will be the endpoint that our platform sends webhook events to.

To register a webhook, follow these steps:

### **Navigate to the Webhooks Section**

* Sign in and select the workspace where you want to create the webhook.
* Go to the [`Settings › Workspace › Developers › Webhooks`](https://dashboard.countercyclical.io/settings/workspace/developers/webhooks)
* The Webhooks tab lists the workspace's registered webhooks.

### **Create a New Webhook**

* Click on the `Create Webhook` button.
* Fill in the required details:
  * **Name:** A name for your webhook (e.g., "New Report Published")
  * **URL:** The subscriber endpoint URL where you want to receive the webhook events
  * **Events:** Select the events you want to subscribe to

### **Save the Webhook:**

* Once you have filled in all the details, click `Save`.

### Managing Webhooks

You can manage your webhooks through the platform's Webhooks section:

* **Edit Webhooks:** Modify the details of an existing webhook (e.g., change the URL or events).
* **Delete Webhooks:** Remove a webhook if you no longer need it.
* **View Logs:** Access logs to see the history of webhook events sent to your endpoint.

## Best Practices <a href="#best-practices" id="best-practices"></a>

### Securing your Webhook Endpoints <a href="#best-practices" id="best-practices"></a>

To ensure the security of your webhook, consider the following:

* **Validate the Source:** Verify that the incoming requests are actually coming from our platform. This can be done by checking the request headers or using a shared secret.
* **Use HTTPS:** Ensure your webhook URL uses HTTPS to encrypt the data in transit.
* **Rate Limiting:** Implement rate limiting to prevent abuse of your webhook endpoint.

#### Related Pages

{% content-ref url="/pages/WDdfGlmzXyB63TQeL1sY" %}
[Event Types Catalog](https://docs.countercyclical.io/developers/webhooks/event-types-catalog.md)
{% endcontent-ref %}

{% content-ref url="/pages/SCKkJzOQmkavrgSEVNVK" %}
[Stage Actions](https://docs.countercyclical.io/workspaces/stage-actions.md)
{% endcontent-ref %}

{% content-ref url="/pages/mw3PAMlSCrUy2Rne4WCx" %}
[Rate Limiting](https://docs.countercyclical.io/developers/rate-limiting.md)
{% endcontent-ref %}
