For AI agents: markdown of this page — /docs-content-en/entities/crm-traces/delete.md documentation index — /llms.txt
Delete a trace
DELETE /v1/crm-traces/:id
Deletes a sales-intelligence trace together with its bindings to CRM records. A deleted trace cannot be restored via the API — create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionTrace identifier — a positive integer. Returned in data.id when creating a trace |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-traces/2025" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-traces/2025" \
-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/2025', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
if (res.status === 204) {
console.log('Trace deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-traces/2025', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Trace deleted')
}
Response
On successful deletion, HTTP status 204 No Content is returned with an empty body — success is checked by the status.
Response example
HTTP/1.1 204 No Content
Error response example
400 — id is not a positive integer:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "id must be a positive safe integer"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the deletion. The error text is returned in error.message |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key does not have the crm scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key works in read-only mode |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no configured tokens |
Full list of common API errors — Errors.
Known specifics
Deletion is idempotent. A nonexistent or already deleted trace also returns 204. The response does not say whether the trace existed. You cannot check in advance whether a trace exists: there is no method for reading traces.
Partial permissions. If you have update permission for only some of the bound CRM records, the bindings to the accessible records are removed. The other bindings and the trace itself remain, and the response is still 204.