> **The method ships in the `crm 26.2100.0` update and is not yet available on all Bitrix24 accounts.** If the method is not enabled yet, the API returns `422 METHOD_NOT_YET_AVAILABLE`.

## Run a step of the advertising expense report

`POST /v1/crm-tracking/sources/:id/ad-expenses`

Start or continue building an advertising expense report for a period. Each request runs one step.

Requires the `crm` scope, the `crm-tracking-v3` flag, and method availability in the Bitrix24 account. A `READONLY` key cannot run this request.

## Parameters

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

## Request body fields

| Field | Type | Required | Description |
|---|---|---|---|
| `dateFrom` | string | yes | Period start, `YYYY-MM-DD`. |
| `dateTo` | string | yes | Period end, `YYYY-MM-DD`. |

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/crm-tracking/sources/42/ad-expenses" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dateFrom":"2026-10-01","dateTo":"2026-10-07"}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/crm-tracking/sources/42/ad-expenses" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dateFrom":"2026-10-01","dateTo":"2026-10-07"}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-tracking/sources/42/ad-expenses', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ dateFrom: '2026-10-01', dateTo: '2026-10-07' }),
})
const result = await res.json()
console.log(result)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-tracking/sources/42/ad-expenses', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ dateFrom: '2026-10-01', dateTo: '2026-10-07' }),
})
const result = await res.json()
console.log(result)
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | `true` |
| `data` | object | Report progress. |
| `data.complete` | boolean | Whether the report is complete. |
| `data.label` | string or null | Current step label or `null`. Its language depends on the Bitrix24 account. |

## Response example

```json
{
  "success": true,
  "data": {
    "complete": false,
    "label": null
  }
}
```

## Error response example

400 — the source does not support advertising reports:

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

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `INVALID_PARAMS` | Invalid source ID or field type. |
| 400 | `BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION` | Dates are missing, or Bitrix24 rejected the parameter values. |
| 400 | `UNKNOWN_FILTER_FIELD` | Unknown query parameter. |
| 400 | `CRM_TRACKING_AD_PROVIDER_UNSUPPORTED` | The source does not support the advertising operation. |
| 404 | `ENTITY_NOT_FOUND` | Source not found. |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope. |
| 403 | `BITRIX_REST_V3_EXCEPTION_ACCESSDENIEDEXCEPTION` | Insufficient permissions on the Bitrix24 portal. |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | A `READONLY` key cannot build the report. |
| 401 | `TOKEN_MISSING` | Bitrix24 access is not configured for the key. |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The flag is off or the method is not enabled in the portal. `error.release` is `crm 26.2100.0`. |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 returned an invalid response structure. |

Other Bitrix24 refusal codes, statuses, and messages are preserved. For common API errors, see [Errors](/docs/errors).

## Known specifics

If `complete` is `false`, run the next step by [repeating the POST request with the same period](/docs/entities/crm-tracking/ad-expenses-start). Reading progress alone does not continue building the report.

## See also

- [List analytics sources](/docs/entities/crm-tracking/sources-list)
- [List the advertising tree of a source](/docs/entities/crm-tracking/ad-tree-list)
- [Get advertising expense report progress](/docs/entities/crm-tracking/ad-expenses-get-status)
