# Configure a HTTP webhook

{% hint style="warning" %}
Webhooks are a premium feature that is not enabled for organizations by default. Make sure you reach out to <support@didomi.io> to enable this integration before configuring one for your organization.
{% endhint %}

### Introduction

Webhooks allow you to subscribe to events happening on the Didomi platform to implement custom workflows when your users change their consent preferences. When an event is triggered, we'll send a HTTP POST payload to the configured endpoint.

### Creating your integration configuration

To configure a HTTP Webhook integration for your organization, send a `POST /marketplace/integrations` request with the `webhook-http` type, the ID of your organization, and the URL (endpoint) through which the events will be received. By default, HTTP webhook authentication is disabled.

```json
POST https://api.didomi.io/v1/marketplace/integrations?organization_id=YOUR_ORG_ID

BODY
{
  "type_id": "webhook-http",
  "authentication": {},
  "properties": {
    "url": "https://api.my-site.com/consents"
  }
}

```

#### Authentication

The HTTP webhook integration supports OAuth as authentication mechanism. To enable it, you can specify the url and the oauth credentials to get a session token (this token will be sent inside the `Authorization` HTTP header in the event webhook request) inside the `authentication` object.

```json
POST https://api.didomi.io/v1/marketplace/integrations?organization_id=YOUR_ORG_ID

BODY
{
  "type_id": "webhook-http",
  "authentication": {
    "url": "https://api.my-site.com/oauth/token",
    "client_id": "***************",
    "client_secret": "******************"
  "properties": {
    "url": "https://api.my-site.com/consents"
  }
}
```

This will automatically start sending HTTP POST requests to your configured endpoint whenever a new Didomi event happens and your users consent preferences are updated.

For more information on HTTP webhooks, please visit the [Webhooks documentation](/integrations/generic-integrations/webhooks.md).


---

# Agent Instructions: 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:

```
GET https://developers.didomi.io/integrations/tutorials/configure-a-http-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
