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

# Webhooks

# Overview

Use Webhooks to be notified of events in the Manifest platform. Note: Currently, Manifest supports one webhook per event, per environment.

## Structure

When receiving a webhook notification, there will be an `event` and `id` fields:

```json theme={null}
{
    "event": "account_connection.update",
    "id": "acon_XXXXX",
    "timestamp": 1644893096,
    "user_data": {}
}
```

## Validation (Optional)

Validating that webhooks originate from Manifest ensures that a webhook notification is authentic. If a webhook object has been created with the `basic_user` or `basic_secret` fields, notifications from Manifest will include an additional `Authorization` header that is the base64-encoded value of `{basic_user}:{basic_secret}`. When the base64 header matches the value your application expects, the request is authentic.

```http Example Header theme={null}
Authorization: Basic YmVzdXJldG86ZHJpbmt5b3Vyb3ZhbHRpbmU=
```

***

# Methods

<Tabs>
  <Tab title="Create">
    <Card icon="square-plus" iconType="solid" color="#86B74B">
      **`POST`  /webhook**<br />
      Subscribe to a type of event.
    </Card>

    ## Body Parameters

    <ParamField body="url" type="string" required="true">
      The HTTPS URL where the event notification will be sent.
    </ParamField>

    <ParamField body="event" type="string" required="true">
      Event to subscribe to. See below for a list of available events.
    </ParamField>

    <ParamField body="basic_user" type="string">
      First value in base64(`basic_user:basic_secret`), sent as `Authorization` for request validation. This field will not appear in responses.
    </ParamField>

    <ParamField body="basic_secret" type="string">
      Second value in base64(`basic_user:basic_secret`), sent as `Authorization` for request validation. This field will not appear in responses.
    </ParamField>

    <ParamField body="user_data" type="object">
      User defined data that can be attached to the object. See the [User Data](/reference/user-data) page for details.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Request theme={null}
      // POST /webhook
      {
          "url": "https://app.yoursite.com/webhook",
          "event": "payout.update"
      }
      ```

      ```json Response theme={null}
      {
          "id": "wh_XXXXX",
          "url": "https://app.yoursite.com/webhook",
          "event": "payout.update"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Get">
    <Card icon="square-arrow-right" iconType="solid" color="#425BE0">
      **`GET`  /webhook/:id**<br />
      Get details of one of your webhooks.
    </Card>

    ## Path Parameters

    <ParamField path="id" type="string" required="true">
      The ID of the webhook to retrieve.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Response theme={null}
      {
          "id": "wh_XXXXX",
          "url": "https://app.yoursite.com/webhook",
          "event": "payout.update"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="List">
    <Card icon="square-list" iconType="solid" color="#BDE1CD">
      **`GET`  /webhook**<br />
      List all webhooks associated with your enterprise.
    </Card>

    ## Query Parameters

    <ParamField query="page" type="integer">
      The page number to return. Default is 1.
    </ParamField>

    <ParamField query="page_size" type="integer">
      The number of items to return per page. Default is 10.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Response theme={null}
      {
          "data": [
              {
                  "id": "wh_XXXXX",
                  "url": "https://app.yoursite.com/webhook",
                  "event": "payout.update"
              },
              {
                  "id": "wh_YYYYY",
                  "url": "https://app.yoursite.com/webhook",
                  "event": "account_connection.update"
              },
          ],
          "pagination": {
              "page": 1,
              "page_size": 10,
              "total": 2
          }
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Delete">
    <Card icon="square-x" iconType="solid" color="#E04B4B">
      **`DELETE`  /webhook/:id**<br />
      Remove one of your webhooks.
    </Card>

    ## Path Parameters

    <ParamField path="id" type="string" required="true">
      The ID of the webhook to delete.
    </ParamField>
  </Tab>
</Tabs>

***

# Properties

<ResponseField name="id" type="string">
  Identifier for this webhook.
</ResponseField>

<ResponseField name="url" type="string">
  The HTTPS URL where the event notification will be sent.
</ResponseField>

<ResponseField name="event" type="string">
  Event to subscribe to. Possible values are:

  * `account_connection.update`
  * `payout.update`
  * `buyer.update`
  * `purchase.update`
  * `contract.update`
</ResponseField>

<ResponseField name="basic_user" type="string">
  First value in base64(`basic_user:basic_secret`), sent as `Authorization` for request validation. This field will not appear in responses.
</ResponseField>

<ResponseField name="basic_secret" type="string">
  Second value in base64(`basic_user:basic_secret`), sent as `Authorization` for request validation. This field will not appear in responses.
</ResponseField>

<ResponseField name="user_data" type="object">
  User defined data that can be attached to the object. See the [User Data](/reference/user-data) section for details.
</ResponseField>
