> **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 |
|---|---|---|
| `id` (path) | number | Positive integer source ID from the [source list](/docs/entities/crm-tracking/sources-list). Required for the numeric path. |
| `code` (path) | string | Nonempty built-in source code from the [source list](/docs/entities/crm-tracking/sources-list), such as `google`. Required for the `by-code` path. |

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
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 |
|---|---|---|
| `success` | boolean | `true` |
| `data` | object | Source. |
| `data.id` | number or null | Source ID. `null` for a built-in source without saved configuration. |
| `data.code` | string or null | Built-in source code. `null` for a custom source. |
| `data.kind` | string | `own` for a custom source, `builtIn` for a built-in source. |
| `data.name` | string | Source name. |
| `data.color` | string or null | Source color. |
| `data.isActive` | boolean | Whether the source is active. |
| `data.isConfigurable` | boolean | Whether the source can be configured. |
| `data.isConfigured` | boolean | Whether source configuration has been saved. |
| `data.refDomains` | string[] | Referring domains. |
| `data.utmSources` | string[] | Values 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 |
|---|---|---|
| 400 | `INVALID_PARAMS` | Invalid source ID or empty source code. |
| 400 | `UNKNOWN_FILTER_FIELD` | A query parameter was supplied, including a second source address. |
| 404 | `ENTITY_NOT_FOUND` | Source not found. |
| 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 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. For common API errors, see [Errors](/docs/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

- [List analytics sources](/docs/entities/crm-tracking/sources-list)
- [Update an analytics source](/docs/entities/crm-tracking/sources-update)
- [List analytics channels](/docs/entities/crm-tracking/channels-list)
