> 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/~/changes/ZwrMx5xpgOpgFGNOVADb/developers/webhooks.md).

# Webhooks

{% hint style="info" %}
This feature is only available for our Enterprise customers. For more information, please contact us at <enterprise@countercyclical.io> or [schedule an enterprise demo](https://cal.com/countercyclical/enterprise-demo)!
{% endhint %}

## 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 webooks 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**

* Log in to your Enterprise account on the platform.
* Go to the `Settings > Workspace > Advanced > Developers`
* Scroll to the `Webhooks` section.

### **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 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.countercyclical.io/~/changes/ZwrMx5xpgOpgFGNOVADb/developers/webhooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
