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

# Pay Allocations Webhooks

> Learn about pay allocations webhooks.

Pay allocation webhooks notify your system when:

* A new pay allocation was **added**.
* A pay allocation was **updated**.
* A pay allocations was **removed**.

Pay allocations webhooks are useful to monitor individual changes to an account's pay allocations that can happen as a result of a periodic scan by Argyle, or occur because of independent changes the user makes.

<Note>
  To instead monitor the success of a direct deposit update you initiate, we recommend using these webhooks:

  * [Pay Distribution updated](/legacy/api-reference/accounts-webhooks#pay-distribution-updated)
  * [Pay Distribution failed](/legacy/api-reference/accounts-webhooks#pay-distribution-failed)
</Note>

## Added

**POST** `/v1/webhooks`

Implement the `pay_allocations.added` webhook to know when a user adds a new pay allocation.

The pay\_allocations.added webhook is triggered when:

* Argyle adds a new pay allocation described in your [DDS configuration](/legacy/api-reference/dds-configurations) after it is confirmed by the user.
* Argyle scans the user's pay allocations for the first time.
* Periodic scans detect that the user or employer added a new pay allocation.

### Request body

### Webhook message

* `name` (string, optional): Name used for the webhook subscription.
* `data` (object, optional)
* `account` (string (uuid), optional): ID of the account.
* `user` (string (uuid), optional): ID of the user.
* `pay_allocation` (string (uuid), optional): ID of the pay allocation.

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request POST \\
    --url https://api.argyle.com/v1/webhooks \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json' \\
    --data '{
    "events": ["pay_allocations.added"],
    "name": "name-for-the-webhook-subscription",
    "url": "https://your-webhook-backend.com",
    "secret": "optional-secret"
    }'
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/webhooks"
    payload = {
    "events": ["pay_allocations.added"],
    "name": "name-for-the-webhook-subscription",
    "url": "https://your-webhook-backend.com",
    "secret": "optional-secret"
    }
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.post(url, json=payload, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
"event": "pay_allocations.added",
"name": "A pay allocation was added",
"data": {
"account": "ada143be-3c90-4534-b7ea-9899674dc6e0",
"user": "3823026e-a964-45f6-b201-6b8c096b30d3",
"pay_allocation": "4334r6e-a964-45eef6-b201-64464"
}
},
null,
2

```

<RefSubLayout.Divider />

## Updated

**POST** `/v1/webhooks`

Implement the `pay_allocations.updated` webhook to know when a user updates a pay allocation.

The pay\_allocations.updated webhook is triggered when:

* Argyle updates a user's pay allocation based on details in your [DDS configuration](/legacy/api-reference/dds-configurations) after it is confirmed by the user.
* Periodic scans detect that the user or employer **updated** an existing pay allocation.

### Request body

### Webhook message

* `name` (string, optional): Name used for the webhook subscription.
* `data` (object, optional)
* `account` (string (uuid), optional): ID of the account.
* `user` (string (uuid), optional): ID of the user.
* `pay_allocation` (string (uuid), optional): ID of the pay\_allocation.

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request POST \\
    --url https://api.argyle.com/v1/webhooks \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json' \\
    --data '{
    "events": ["pay_allocations.updated"],
    "name": "name-for-the-webhook-subscription",
    "url": "https://your-webhook-backend.com",
    "secret": "optional-secret"
    }'
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/webhooks"
    payload = {
    "events": ["pay_allocations.updated"],
    "name": "name-for-the-webhook-subscription",
    "url": "https://your-webhook-backend.com",
    "secret": "optional-secret"
    }
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.post(url, json=payload, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
"event": "pay_allocations.updated",
"name": "A pay allocation was updated",
"data": {
"account": "ada143be-3c90-4534-b7ea-9899674dc6e0",
"user": "3823026e-a964-45f6-b201-6b8c096b30d3",
"pay_allocation": "4334r6e-a964-45eef6-b201-64464"
}
},
null,
2

```

<RefSubLayout.Divider />

## Removed

**POST** `/v1/webhooks`

Implement the `pay_allocations.removed` webhook to know when a user removes a pay allocation.

* The `pay_allocations.removed` webhook is triggered when the user removes a pay allocation in Argyle Link.
* Learn more in the [removing bank accounts section](/legacy/guides/argyle-link/flows/direct-deposit-switching#remove-a-bank-account) of our direct deposit switching guide.

### Request body

### Webhook message

* `name` (string, optional): Name used for the webhook subscription.
* `data` (object, optional)
* `account` (string (uuid), optional): ID of the account.
* `user` (string (uuid), optional): ID of the user.
* `pay_allocation` (string (uuid), optional): ID of the pay\_allocation.

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request POST \\
    --url https://api.argyle.com/v1/webhooks \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json' \\
    --data '{
    "events": ["pay_allocations.removed"],
    "name": "name-for-the-webhook-subscription",
    "url": "https://your-webhook-backend.com",
    "secret": "optional-secret"
    }'
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/webhooks"
    payload = {
    "events": ["pay_allocations.removed"],
    "name": "name-for-the-webhook-subscription",
    "url": "https://your-webhook-backend.com",
    "secret": "optional-secret"
    }
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.post(url, json=payload, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
"event": "pay_allocations.removed",
"name": "A pay allocation was removed",
"data": {
"account": "ada143be-3c90-4534-b7ea-9899674dc6e0",
"user": "3823026e-a964-45f6-b201-6b8c096b30d3",
"pay_allocation": "4334r6e-a964-45eef6-b201-64464"
}
},
null,
2

```
