> **The method is rolling out in update `crm 26.2000.0`.** It is not available on every Bitrix24 account. If the method is not yet available on your account, the API returns `422 METHOD_NOT_YET_AVAILABLE` — this indicates that the update has not reached the account yet, rather than an integration error.

## Delete an analytics trace

Endpoint: `DELETE /v1/crm-traces/:id`

Deletes an analytics trace and its links to CRM records. A deleted trace cannot be restored through the API.

> The key needs the `crm` scope. How the deletion runs depends on whether the `crm-tracking-v3` platform flag is on for the Bitrix24 account. The differences are described under "Known specifics".

Writes require a `READWRITE` key.

## Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `id` (path) | number | yes | — | Positive trace ID from the [list](/docs/entities/crm-traces/v3-list) or [create response](/docs/entities/crm-traces/v3-create). |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-traces/1" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-traces/1" \
  -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-traces/1', {
  "method": "DELETE",
  "headers": {
    "X-Api-Key": "YOUR_API_KEY"
  }
})
console.log(res.status === 204)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-traces/1', {
  "method": "DELETE",
  "headers": {
    "X-Api-Key": "YOUR_APP_KEY",
    "Authorization": "Bearer USER_SESSION_TOKEN"
  }
})
console.log(res.status === 204)
```

## Response

Success is `204 No Content` with an empty body. Check the status without parsing JSON.

## Response example

```http
HTTP/1.1 204 No Content
```

## Error response example

404: trace not found. Error messages follow the Bitrix24 account language.

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Entity with ID 1 was not found."
  }
}
```

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `INVALID_PARAMS` | Invalid request type or shape, or an invalid ID. |
| 403 | `SCOPE_DENIED` | Missing `crm` scope. |
| 401 | `TOKEN_MISSING` | The key has no configured tokens. |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The platform flag is on, but RestV3Tracking is not yet enabled on the Bitrix24 portal. `error.release` is `crm 26.2000.0`. |
| 502 | `BITRIX_UNAVAILABLE` | Invalid Bitrix24 response. |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only. |
| 404 | `ENTITY_NOT_FOUND` | The trace is absent or not readable. |
| 403 | `BITRIX_REST_V3_EXCEPTION_ACCESSDENIEDEXCEPTION` | Insufficient permissions for linked CRM records. |
| — | `CRM_TRACKING_TRACE_TOO_MANY_BINDINGS` | Only with the flag on: the trace has more than 500 links. Nothing was deleted. The HTTP status is passed through from Bitrix24 unchanged. |

Other Bitrix24 refusal codes, statuses and messages are preserved. See [Errors](/docs/errors) for common failures.

## Known specifics

With the flag enabled, deletion requires permission to update every linked CRM record and removes the whole trace. If permission for any record is missing, nothing is deleted.

With the flag off, the legacy REST v1 path applies: the API returns 204 even if the trace does not exist, and accessible links may be removed without deleting the whole trace.

## See also

- [List analytics traces](/docs/entities/crm-traces/v3-list)
- [Get an analytics trace](/docs/entities/crm-traces/v3-get)
- [Create an analytics trace](/docs/entities/crm-traces/v3-create)
