# List accounts

> Every connected account in one profile.

Canonical: <https://www.tryadeli.com/docs/api/accounts/list-accounts>

`GET https://app.tryadeli.com/api/v1/accounts`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

Returns every connected account in one profile, sorted by platform and
then by id. Uses the [aggregate response contract](https://www.tryadeli.com/docs/concepts#partial-responses).
Each account has the fields described in [The account object](https://www.tryadeli.com/docs/api/accounts#the-account-object).

**Query parameters**

| Name        | Type                                                                     | Required | Description                                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `platform`  | `"instagram" \| "tiktok" \| "facebook" \| "youtube" \| "x" \| "bluesky"` |          | Narrow to one provider.                                                                                                                                                               |
| `accountId` | `uuid`                                                                   |          | Narrow to one connection. It names its profile, so `profileId` can be left out. An id outside your organization returns `404 account_not_found`.                                      |
| `profileId` | `uuid`                                                                   |          | The profile to list. Required unless you pass `accountId`; with neither, the API returns `400 profile_required`. A profile outside your organization returns `404 profile_not_found`. |

**Errors** — `401 unauthorized`, `400 invalid_request`, `404 profile_not_found`,
`404 account_not_found`, `502 provider_error`.

## Request examples

**cURL**

```bash
curl --fail-with-body "https://app.tryadeli.com/api/v1/accounts?profileId=00000000-0000-4000-8000-000000000001&platform=instagram" \
  -H "Authorization: Bearer $ADELI_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/accounts?profileId=00000000-0000-4000-8000-000000000001&platform=instagram", {
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
  },
});
console.log(await response.json());
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://app.tryadeli.com/api/v1/accounts",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    params={
        "profileId": "00000000-0000-4000-8000-000000000001",
        "platform": "instagram",
    },
)
print(response.json())
```

## Responses

### 200

```json
{
  "status": "complete",
  "accounts": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "accountId": "00000000-0000-0000-0000-000000000000",
      "profileId": "00000000-0000-4000-8000-000000000001",
      "platform": "instagram",
      "providerId": "17841400000000000",
      "displayName": "@adeli",
      "displayIdentifier": "adeli",
      "authMethod": "instagram_login",
      "connectionStatus": "connected"
    }
  ],
  "errors": []
}
```

### 400

```json
{
  "error": {
    "code": "profile_required",
    "message": "Pass profileId, or an accountId that belongs to a profile"
  }
}
```
