For AI agents: markdown of this page — /docs-content-en/entities/crm-traces/v3-delete.md documentation index — /llms.txt
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 returns422 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
crmscope. How the deletion runs depends on whether thecrm-tracking-v3platform 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 |
|---|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | Default— | DescriptionPositive trace ID from the list or create response. |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-traces/1" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
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
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
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/1.1 204 No Content
Error response example
404: trace not found. Error messages follow the Bitrix24 account language.
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Entity with ID 1 was not found."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionInvalid request type or shape, or an invalid ID. |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionMissing crm scope. |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no configured tokens. |
| HTTP422 | CodeMETHOD_NOT_YET_AVAILABLE |
DescriptionThe platform flag is on, but RestV3Tracking is not yet enabled on the Bitrix24 portal. error.release is crm 26.2000.0. |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionInvalid Bitrix24 response. |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is read-only. |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThe trace is absent or not readable. |
| HTTP403 | CodeBITRIX_REST_V3_EXCEPTION_ACCESSDENIEDEXCEPTION |
DescriptionInsufficient permissions for linked CRM records. |
| HTTP— | CodeCRM_TRACKING_TRACE_TOO_MANY_BINDINGS |
DescriptionOnly 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 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.