For AI agents: markdown of this page — /docs-content-en/entities/crm-tracking/sources-get.md documentation index — /llms.txt

This method is rolling out in crm 26.2100.0. It is not available in every Bitrix24 account. If the method is not enabled yet, the API returns 422 METHOD_NOT_YET_AVAILABLE.

Get an end-to-end analytics source

GET /v1/crm-tracking/sources/by-code/:code

Retrieve an analytics source by its numeric ID or built-in source code.

Requires the crm scope, the crm-tracking-v3 flag, and the feature enabled in the Bitrix24 account. READONLY keys can read this resource.

Parameters

Use exactly one address: GET /v1/crm-tracking/sources/:id or GET /v1/crm-tracking/sources/by-code/:code. Query parameters are not accepted.

Parameter Type Description
Parameterid (path) Typenumber DescriptionPositive integer source ID from the source list. Required for the numeric path.
Parametercode (path) Typestring DescriptionNonempty built-in source code from the source list, such as google. Required for the by-code path.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-tracking/sources/by-code/google" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-tracking/sources/by-code/google" \
  -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/by-code/google', {
  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/by-code/google', {
  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
Fielddata Typeobject DescriptionSource.
Fielddata.id Typenumber or null DescriptionSource ID. null for a built-in source without saved configuration.
Fielddata.code Typestring or null DescriptionBuilt-in source code. null for a custom source.
Fielddata.kind Typestring Descriptionown for a custom source, builtIn for a built-in source.
Fielddata.name Typestring DescriptionSource name.
Fielddata.color Typestring or null DescriptionSource color.
Fielddata.isActive Typeboolean DescriptionWhether the source is active.
Fielddata.isConfigurable Typeboolean DescriptionWhether the source can be configured.
Fielddata.isConfigured Typeboolean DescriptionWhether source configuration has been saved.
Fielddata.refDomains Typestring[] DescriptionReferring domains.
Fielddata.utmSources Typestring[] DescriptionValues of the utm_source parameter.

Response example

JSON
{
  "success": true,
  "data": {
    "id": null,
    "code": "google",
    "kind": "builtIn",
    "name": "Google Ads",
    "color": "#3889db",
    "isActive": true,
    "isConfigurable": true,
    "isConfigured": false,
    "refDomains": [],
    "utmSources": []
  }
}

Error response example

400 — unsupported query parameter:

JSON
{
  "success": false,
  "error": {
    "code": "UNKNOWN_FILTER_FIELD",
    "message": "Source address belongs in exactly one path parameter"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionInvalid source ID or empty source code.
HTTP400 CodeUNKNOWN_FILTER_FIELD DescriptionA query parameter was supplied, including a second source address.
HTTP404 CodeENTITY_NOT_FOUND DescriptionSource not found.
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 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. For common API errors, see Errors.

Known specifics

The first update of a built-in source by code creates a saved record. Before that, the source remains addressable by code and may have id: null.

See also