> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withbenji.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a webhook subscription

> Update a webhook subscription for a specific event or all entity events on the Benji Platform

> [!NOTE]
>
> The `x-api-key` header value to be used on this API is your **partner API key**, which can be generated through the dashboard.

**endpoint** `string` *required*

Your endpoint URL that will receive the event webhooks

**event\_name** `string`

The event you are subscribing to. Note that if an event is not specified, all events for the entity type specified will be subscribed to.

**entity\_type** `integer`

Integer representing an enum of one of the following entity type values to subscribe to:

**possible entity type values**

* **USER (1)** : Indicating a user entity \\

* **CAMPAIGN (2)** : Indicating a campaign entity  \\

* **TRANSACTION (3)** : Indicating a reward transaction entity

> [!NOTE]
>
> To delete an endpoint subscription, just use this API with an empty endpoint parameter.

### Return values

**subscribed** `boolean` *required*

A true or false value indicating whether the subscription was successful.

```json 200 theme={null}
{
    "code": "ok",
    "data": {
        "subscribed": true
    }
}
```

```json 400 theme={null}
{
  "error": "invalid_subscription",
  "message": "Invalid entity or event"
}
```

```json 401 theme={null}
{
  "error": "unauthorized_partner",
  "message": "Invalid key, or key is not authorized to make this call"
}
```

```json 404 theme={null}
{
  "error": "event_not_exists",
  "message": "The specified event subscription does not exist"
}
```

```json 500 theme={null}
{
  "error": "unexpected_error",
  "message": "An unexpected error has occurred"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.