> ## 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.</Note>

<ParamField body="endpoint" type="string" required>
  Your endpoint URL that will receive the event webhooks
</ParamField>

<ParamField body="event_name" type="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.
</ParamField>

<ParamField body="entity_type" type="integer">
  Integer representing an enum of one of the following entity type values to subscribe to:

  <Expandable title="possible entity type values" type="enum">
    * **USER (1)** : Indicating a user entity <br />
    * **CAMPAIGN (2)** : Indicating a campaign entity  <br />
    * **TRANSACTION (3)** : Indicating a reward transaction entity
  </Expandable>
</ParamField>

<Note>To delete an endpoint subscription, just use this API with an empty endpoint parameter.</Note>

### Return values

<ResponseField name="subscribed" type="boolean" required>
  A true or false value indicating whether the subscription was successful.
</ResponseField>

<ResponseExample>
  ```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"
  }
  ```
</ResponseExample>
