> **The methods are rolling out in update `crm 26.2100.0`.** They are not available on every Bitrix24 account. Until a method is available, the API returns `422 METHOD_NOT_YET_AVAILABLE`.

# Analytics sources and channels

Sources attribute visits to campaigns and referrals. You can read built-in sources, configure them by code and create custom sources. Channels show which acquisition methods are configured on the account.

Bitrix24 API: `crm.tracking.source.*`, `crm.tracking.channel.list`
Scope: `crm`

The `crm-tracking-v3` flag and the REST v3 analytics capability in the Bitrix24 account must be enabled. `READONLY` keys may read; writes require `READWRITE`.

## Operations

- [POST /v1/crm-tracking/sources — create a source](/docs/entities/crm-tracking/sources-create)
- [GET /v1/crm-tracking/sources — list sources](/docs/entities/crm-tracking/sources-list)
- [GET /v1/crm-tracking/sources/:id — get a source](/docs/entities/crm-tracking/sources-get)
- [GET /v1/crm-tracking/sources/by-code/:code — get a built-in source](/docs/entities/crm-tracking/sources-get)
- [PATCH /v1/crm-tracking/sources/:id — update a source](/docs/entities/crm-tracking/sources-update)
- [PATCH /v1/crm-tracking/sources/by-code/:code — update a built-in source](/docs/entities/crm-tracking/sources-update)
- [POST /v1/crm-tracking/sources/:id/archive — archive](/docs/entities/crm-tracking/sources-archive)
- [POST /v1/crm-tracking/sources/by-code/:code/archive — archive by code](/docs/entities/crm-tracking/sources-archive)
- [POST /v1/crm-tracking/sources/:id/unarchive — restore](/docs/entities/crm-tracking/sources-unarchive)
- [POST /v1/crm-tracking/sources/by-code/:code/unarchive — restore by code](/docs/entities/crm-tracking/sources-unarchive)
- [GET /v1/crm-tracking/channels — list channels](/docs/entities/crm-tracking/channels-list)

- [GET /v1/crm-tracking/sources/:id/expenses — list manual expenses](/docs/entities/crm-tracking/expenses-list)
- [POST /v1/crm-tracking/sources/:id/expenses — add manual expenses](/docs/entities/crm-tracking/expenses-create)
- [DELETE /v1/crm-tracking/expenses/:id — delete manual expenses](/docs/entities/crm-tracking/expenses-delete)
- [GET /v1/crm-tracking/analytics/sources — source analytics](/docs/entities/crm-tracking/analytics-sources-list)
- [GET /v1/crm-tracking/sources/:id/ad-account/authorization — Get an authorization link](/docs/entities/crm-tracking/ad-account-authorization)
- [GET /v1/crm-tracking/sources/:id/ad-accounts — List advertising accounts](/docs/entities/crm-tracking/ad-account-list)
- [POST /v1/crm-tracking/sources/:id/ad-account — Connect an advertising account](/docs/entities/crm-tracking/ad-account-connect)
- [DELETE /v1/crm-tracking/sources/:id/ad-account — Disconnect an advertising account](/docs/entities/crm-tracking/ad-account-disconnect)
- [GET /v1/crm-tracking/sources/:id/ad-tree — Read the advertising tree](/docs/entities/crm-tracking/ad-tree-list)
- [POST /v1/crm-tracking/sources/:id/ad-expenses — Run an expense report step](/docs/entities/crm-tracking/ad-expenses-start)
- [GET /v1/crm-tracking/sources/:id/ad-expenses — Read report progress](/docs/entities/crm-tracking/ad-expenses-get-status)

## Key fields

| Field | Description |
|---|---|
| `id` | Record identifier from the [source list](/docs/entities/crm-tracking/sources-list). `null` for an unconfigured built-in source. |
| `code` | Built-in source code from the [source list](/docs/entities/crm-tracking/sources-list), such as `google`. `null` for a custom source. |
| `kind` | `builtIn` for a built-in source, `own` for a custom one. |
| `isActive` | Whether the source is active. Read archived records with `archived=true`. |
| `refDomains`, `utmSources` | Referring domains and UTM source values. Writing a list replaces it completely. |

## Before you start

1. Address a source by exactly one value: numeric `id` or string `code` in the path. A second address in the request is refused.
2. The first update of a built-in source by code creates its record. A missing identifier does not mean that the built-in source itself is absent.
3. The default list includes active sources and unconfigured built-in sources. `archived=true` selects archived records.
4. Creation returns `data.id`; an update returns the source read back after the write. Archive and restore are idempotent and return `204` without a body. Traces and expenses are retained.
5. Bitrix24 checks restrictions on built-in source changes and permissions. Names and codes in responses are account data.

## Typical workflow

1. Read [sources](/docs/entities/crm-tracking/sources-list) and [channels](/docs/entities/crm-tracking/channels-list).
2. [Create a source](/docs/entities/crm-tracking/sources-create) with a name and UTM source values.
3. [Update the source](/docs/entities/crm-tracking/sources-update), providing only fields to change.
4. [Archive the source](/docs/entities/crm-tracking/sources-archive) and [restore it](/docs/entities/crm-tracking/sources-unarchive) when needed.

## Limits

| Limit | Value |
|---|---|
| Page size | `limit`: 1 to 500, default 50. |
| Offset | `offset`: nonnegative integer, default 0. One request reads one page. |
| Domain and UTM source lists | Up to 100 values each, checked by Bitrix24. |
| Name and individual list values | Up to 255 characters, checked by Bitrix24. |
| Source filter | Only `archived=true` or `false`. No sorting. |
| Channels | No filter or sort, with `limit` and `offset`. |

## See also

- [Analytics traces](/docs/entities/crm-traces)
- [Keys and authorization](/docs/keys-auth)
- [Errors](/docs/errors)
