For AI agents: markdown of this page — /docs-content-en/entities/crm-tracking/ad-account-list.md documentation index — /llms.txt
The method ships in the
crm 26.2100.0update and is not yet available on all Bitrix24 accounts. If the method is not yet available on your Bitrix24 account, the API returns422 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 |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionPositive integer source ID from the source list. |
Query parameters and request bodies are not supported. The endpoint returns the available accounts in one response, without pagination.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/crm-tracking/sources/2/ad-accounts" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
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
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
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 |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success. |
Fielddata |
Typearray | DescriptionAvailable advertising accounts. |
Fielddata[].provider |
Typestring | DescriptionAdvertising provider identifier. |
Fielddata[].clientId |
Typestring | DescriptionClient identifier to pass when connecting an advertising account. |
Fielddata[].accountId |
Typestring or null | DescriptionAdvertising account identifier for connecting an account; null if not specified. |
Fielddata[].name |
Typestring | DescriptionAccount name. |
Fielddata[].capabilities |
Typeobject | DescriptionSupported advertising operations. |
Fielddata[].capabilities.import |
Typeboolean | DescriptionWhether expense import is supported. |
Fielddata[].capabilities.tree |
Typestring[] | DescriptionSupported levels for the advertising tree. |
Fielddata[].isConnected |
Typeboolean | DescriptionWhether the account is connected to this source. |
Response example
{
"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:
{
"success": false,
"error": {
"code": "CRM_TRACKING_AD_PROVIDER_UNSUPPORTED",
"message": "CRM_TRACKING_AD_PROVIDER_UNSUPPORTED"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeCRM_TRACKING_AD_PROVIDER_UNSUPPORTED |
DescriptionThe source does not support advertising account operations. |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe path ID is not a positive safe integer, or a request body was supplied. |
| HTTP400 | CodeUNKNOWN_FILTER_FIELD |
DescriptionAn unsupported query parameter was supplied. |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThe source was not found or is unavailable. |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the crm scope. |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no configured tokens. |
| HTTP422 | CodeMETHOD_NOT_YET_AVAILABLE |
DescriptionThe flag is off or the method is not enabled in the Bitrix24 account. error.release is crm 26.2100.0. |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 returned an invalid response. |
Other Bitrix24 refusal codes, HTTP statuses, and messages are preserved. Common API errors: Errors.