> **The method ships in the `crm 26.2100.0` update and is not yet available on all Bitrix24 accounts.** If the method is not yet available on your Bitrix24 account, the API returns `422 METHOD_NOT_YET_AVAILABLE` — this means the update has not reached your account yet, not that the integration is broken.

## List advertising accounts

`GET /v1/crm-tracking/sources/:id/ad-accounts`

List the advertising accounts available for an end-to-end analytics source before connecting one.

Requires the `crm` scope and the `crm-tracking-v3` flag. `READONLY` keys can use this endpoint.

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` (path) | number | yes | Positive integer source ID from the [source list](/docs/entities/crm-tracking/sources-list). |

Query parameters and request bodies are not supported. The endpoint returns the available accounts in one response, without pagination.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/crm-tracking/sources/2/ad-accounts" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/crm-tracking/sources/2/ad-accounts" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-tracking/sources/2/ad-accounts', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})
const result = await res.json()
console.log(result)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-tracking/sources/2/ad-accounts', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const result = await res.json()
console.log(result)
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | `true` on success. |
| `data` | array | Available advertising accounts. |
| `data[].provider` | string | Advertising provider identifier. |
| `data[].clientId` | string | Client identifier to pass when [connecting an advertising account](/docs/entities/crm-tracking/ad-account-connect). |
| `data[].accountId` | string or null | Advertising account identifier for [connecting an account](/docs/entities/crm-tracking/ad-account-connect); `null` if not specified. |
| `data[].name` | string | Account name. |
| `data[].capabilities` | object | Supported advertising operations. |
| `data[].capabilities.import` | boolean | Whether expense import is supported. |
| `data[].capabilities.tree` | string[] | Supported levels for the [advertising tree](/docs/entities/crm-tracking/ad-tree-list). |
| `data[].isConnected` | boolean | Whether the account is connected to this source. |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "provider": "google",
      "clientId": "DUMMY_CLIENT",
      "accountId": null,
      "name": "Campaign account",
      "capabilities": {
        "import": true,
        "tree": [
          "campaign"
        ]
      },
      "isConnected": true
    }
  ]
}
```

## Error response example

400 — the source does not support advertising accounts:

```json
{
  "success": false,
  "error": {
    "code": "CRM_TRACKING_AD_PROVIDER_UNSUPPORTED",
    "message": "CRM_TRACKING_AD_PROVIDER_UNSUPPORTED"
  }
}
```

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `CRM_TRACKING_AD_PROVIDER_UNSUPPORTED` | The source does not support advertising account operations. |
| 400 | `INVALID_PARAMS` | The path ID is not a positive safe integer, or a request body was supplied. |
| 400 | `UNKNOWN_FILTER_FIELD` | An unsupported query parameter was supplied. |
| 404 | `ENTITY_NOT_FOUND` | The source was not found or is unavailable. |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope. |
| 401 | `TOKEN_MISSING` | The key has no configured tokens. |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The flag is off or the method is not enabled in the Bitrix24 account. `error.release` is `crm 26.2100.0`. |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 returned an invalid response. |

Other Bitrix24 refusal codes, HTTP statuses, and messages are preserved. Common API errors: [Errors](/docs/errors).

## See also

- [End-to-end analytics](/docs/entities/crm-tracking)
- [List analytics sources](/docs/entities/crm-tracking/sources-list)
- [Get an advertising authorization link](/docs/entities/crm-tracking/ad-account-authorization)
- [Connect an advertising account](/docs/entities/crm-tracking/ad-account-connect)
