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

# Accounts

> Learn about the /accounts endpoint.

Learn about the `/accounts` endpoint.

* Account objects represent payroll accounts that your users connect via Argyle Link.
* You can query accounts by account ID or user ID that you might have obtained through one of the Argyle Link callbacks.

<Note>
  Accounts that have never successfully connected are removed after 30 days.
</Note>

## The account object

### Attributes

* `id` (string (uuid), optional): Unique ID of the payroll account.
* `user` (string (uuid), optional): ID of the user associated with the payroll account.
* `employers` (array of strings, optional): A list of names of all employers associated with this payroll account. In most cases, this returns a single employer. However, sometimes the same payroll provider (for example, MyADP) is associated with more than one employer.
* `link_item` (string, optional)
* `source` (string, optional)
* `was_connected` (boolean, optional)
* `status` (note, optional)
* `error_message` (string, optional)
* `status` (note, optional)
* `error_code` (string, optional)
* `error_message` (string, optional)
* `availability` (object, optional)
* `status` (note, optional)
* `available_count` (integer, optional)
* `available_to` (string (timestamp), optional)
* `available_from` (string (timestamp), optional)

```json theme={}

<Accordion title="Additional example object — Document upload after invalid credentials">
{
"id": "ac81e2bc-2157-4535-8ca4-fb1f068df1fc",
"user": "53fe928d-9c6a-460b-b5ac-19d67304d106",
"employers": [
"homedepot"
],
"link_item": "homedepot",
"data_partner": "homedepot",
"item": "item_000019016",
"source": "workday",
"created_at": "2019-11-27T15:55:56.771Z",
"updated_at": "2019-11-29T08:37:42.164Z",
"was_connected": true,
"connection": {
"status": "connected",
"error_code": null,
"error_message": null,
"updated_at": "2019-11-29T08:37:42.112859"
},
"pay_distribution": {
"status": "success",
"error": null,
"error_message": null,
"updated_at": "2019-11-29T08:37:42.164Z"
},
"availability": {
"profiles": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"employments": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"finances": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"reputations": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"documents": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"vehicles": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"pay_allocations": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z"
},
"payouts": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z",
"available_count": 3,
"available_from": "2019-10-30T00:00:00Z",
"available_to": "2018-11-27T00:00:00Z"
},
"activities": {
"status": "synced",
"updated_at": "2019-11-29T08:37:42.164Z",
"available_count": 146,
"available_to": "2019-11-29T08:37:42.164Z",
"available_from": "2018-12-15T20:40:50.399Z"
},
"forms": null,
"user_uploads": null
}
},
null,
2
</Accordion>

```

<Accordion title="Additional example object — Document upload after invalid credentials">
  ```json theme={}
        {
            "id": "ac81e2bc-2157-4535-8ca4-fb1f068df1fc",
            "user": "53fe928d-9c6a-460b-b5ac-19d67304d106",
            "employers": [
                "homedepot"
            ],
            "link_item": "homedepot",
            "source": "workday",
            "created_at": "2019-11-27T15:55:56.771Z",
            "updated_at": "2019-11-29T08:37:42.164Z",
            "was_connected": true,
            "connection": {
                "status": "error",
                "error_code": "invalid_credentials",
                "error_message": null,
                "updated_at": "2019-11-29T08:37:42.112859"
            },
            "pay_distribution": {
                "status": "idle",
                "error": null,
                "error_message": null,
                "updated_at": "2019-11-29T08:37:42.164Z"
            },
            "availability": {
                "activities": null,
                "payouts": null,
                "documents": null,
                "profiles": null,
                "employments": null,
                "reputations": null,
                "vehicles": null,
                "pay_allocations": null,
                "forms": {
                    "status": "synced",
                    "updated_at": "2021-11-23T14:19:43.569Z",
                    "available_count": 1,
                    "files_count": 1,
                    "in_progress_count": 0
                },
                "user_uploads": {
                    "status": "synced",
                    "updated_at": "2021-11-23T15:19:43.569Z",
                    "files_count": 1,
                    "in_progress_count": 0
                }
            }
        }
  ```
</Accordion>

<Accordion title="Additional example object — Document upload via questionnaire form">
  ```json theme={}
        {
            "id": "ac81e2bc-2157-4535-8ca4-fb1f068df1fc",
            "user": "53fe928d-9c6a-460b-b5ac-19d67304d106",
            "employers": [],
            "link_item": "form_link_item",
            "source": "sandbox",
            "created_at": "2019-11-27T15:55:56.771Z",
            "updated_at": "2019-11-29T08:37:42.164Z",
            "was_connected": true,
            "connection": {
                "status": "connecting",
                "error_code": null,
                "error_message": null,
                "updated_at": "2019-11-29T08:37:42.112859"
            },
            "pay_distribution": {
                "status": "idle",
                "error": null,
                "error_message": null,
                "updated_at": "2019-11-29T08:37:42.164Z"
            },
            "availability": {
                "activities": null,
                "payouts": null,
                "documents": null,
                "profiles": null,
                "employments": null,
                "reputations": null,
                "vehicles": null,
                "pay_allocations": null,
                "forms": {
                    "status": "synced",
                    "updated_at": "2021-11-23T14:22:12.334Z",
                    "available_count": 1,
                    "files_count": 1,
                    "in_progress_count": 0
                },
                "user_uploads": null
            }
        }
  ```
</Accordion>

<RefSubLayout.Divider />

## Retrieve an account

**GET** `/v1/accounts/{id}`

* Retrieve an account object with the supplied ID.
* This request returns an account object if you provided a valid identifier.

### Path parameters

* `id` (string (uuid), required): The identifier of the account to be retrieved

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request GET \\
    --url https://api.argyle.com/v1/accounts/{id} \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'

    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/accounts/{id}"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.get(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
  "id": "0180519e-64f5-0107-603a-a460f85c2c50",
  "user": "0180519e-620f-a480-0a6d-307c086c0773",
  "availability": {
"activities": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:03.109Z",
  "available_count": 8,
  "available_from": "2021-12-24T14:12:58Z",
  "available_to": "2022-04-21T14:12:58Z"
},
"payouts": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:03.109Z",
  "available_count": 8,
  "available_from": "2021-12-24T14:12:58Z",
  "available_to": "2022-04-21T14:12:58Z"
},
"documents": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:10.346Z"
},
"profiles": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:03.109Z"
},
"employments": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:03.109Z"
},
"reputations": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:03.109Z"
},
"vehicles": {
  "status": "synced",
  "updated_at": "2022-04-22T14:13:03.109Z"
},
"pay_allocations": {
  "status": "synced",
  "updated_at": "2022-04-22T14:12:58.129Z"
},
"forms": null,
"user_uploads": null
  },
  "connection": {
"status": "connected",
"error_code": null,
"updated_at": "2022-04-22T14:12:57.372Z",
"error_message": null
  },
  "pay_distribution": {
"status": "idle",
"error_code": null,
"updated_at": "2022-04-22T14:12:56.694Z",
"error_message": null
  },
  "created_at": "2022-04-22T14:12:56.723Z",
  "updated_at": "2022-04-22T14:13:10.360Z",
  "status": "done",
  "error_code": null,
  "data_partner": "amazon",
  "link_item": "amazon",
  "item": "item_000002102",
  "source": "amazonwarehouse_remote",
  "employers": [
"amazon"
  ],
  "was_connected": true
},
null,
2

```

<RefSubLayout.Divider />

## List accounts

**GET** `/v1/accounts`

* List all accounts that your customers have connected through Argyle.
* This request returns an object with a `results` property that contains an array of up to `limit` account objects.

### Query parameters

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request GET \\
    --url https://api.argyle.com/v1/accounts?limit=2 \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'

    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/accounts?limit=2"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.get(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

[
  {
  "id": "018051a0-7cab-fe51-063f-90c36276a4ee",
  "user": "0180519e-a0e0-cfe9-cd25-9ec9df94b118",
  "availability": {
  "activities": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:20.648Z",
  "available_count": 8,
  "available_from": "2021-12-24T14:15:15Z",
  "available_to": "2022-04-21T14:15:15Z"
  },
  "payouts": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:20.648Z",
  "available_count": 8,
  "available_from": "2021-12-24T14:15:15Z",
  "available_to": "2022-04-21T14:15:15Z"
  },
  "documents": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:27.345Z"
  },
  "profiles": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:20.648Z"
  },
  "employments": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:20.648Z"
  },
  "reputations": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:20.648Z"
  },
  "vehicles": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:20.648Z"
  },
  "pay_allocations": {
  "status": "synced",
  "updated_at": "2022-04-22T14:15:15.295Z"
  },
  "forms": null,
  "user_uploads": null
  },
  "connection": {
  "status": "connected",
  "error_code": null,
  "updated_at": "2022-04-22T14:15:14.557Z",
  "error_message": null
  },
  "pay_distribution": {
  "status": "idle",
  "error_code": null,
  "updated_at": "2022-04-22T14:15:13.835Z",
  "error_message": null
  },
  "created_at": "2022-04-22T14:15:13.871Z",
  "updated_at": "2022-04-22T14:15:27.363Z",
  "status": "done",
  "error_code": null,
  "data_partner": "us_army",
  "link_item": "us_army",
  "item": "item_000041672",
  "source": "mypay",
  "employers": [
  "us_army"
  ],
  "was_connected": true
  },
  {
  "id": "0180519f-d9e8-59dc-29cc-c0446158b3a1",
  "user": "0180519e-a0e0-cfe9-cd25-9ec9df94b118",
  "availability": {
  "activities": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z",
  "available_count": 14,
  "available_from": "2021-12-24T14:14:34Z",
  "available_to": "2022-04-18T19:12:30Z"
  },
  "payouts": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z",
  "available_count": 13,
  "available_from": "2021-12-24T14:14:34Z",
  "available_to": "2022-04-22T05:20:48Z"
  },
  "documents": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z"
  },
  "profiles": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z"
  },
  "employments": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z"
  },
  "reputations": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z"
  },
  "vehicles": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:37.747Z"
  },
  "pay_allocations": {
  "status": "synced",
  "updated_at": "2022-04-22T14:14:33.552Z"
  },
  "forms": null,
  "user_uploads": null
  },
  "connection": {
  "status": "connected",
  "error_code": null,
  "updated_at": "2022-04-22T14:14:32.843Z",
  "error_message": null
  },
  "pay_distribution": {
  "status": "idle",
  "error_code": null,
  "updated_at": "2022-04-22T14:14:32.168Z",
  "error_message": null
  },
  "created_at": "2022-04-22T14:14:32.193Z",
  "updated_at": "2022-04-22T14:14:37.753Z",
  "status": "done",
  "error_code": null,
  "data_partner": "doordash",
  "link_item": "doordash",
  "item": "item_000012375",
  "source": "doordash",
  "employers": [
  "doordash"
  ],
  "was_connected": true
  }
],
null,
2

```

<RefSubLayout.Divider />

## Delete an account

**DELETE** `/v1/accounts/{id}`

* Delete an account and all resources associated with that account: profiles, vehicles, documents, incomes, etc.
* When the account is deleted successfully, the request responds with a `204` status and an empty response body.

### Path parameters

* `id` (string (uuid), required): ID of the account you wish to delete.

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request DELETE \\
    --url https://api.argyle.com/v1/accounts/{id} \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'

    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/accounts/{id}"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.delete(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

"204 status code: No content.",
null,
2

```
