For AI agents: markdown of this page — /docs-content-en/notifications/delete-all.md documentation index — /llms.txt
Delete all notifications
DELETE /v1/notifications
Irreversible: deletes all notifications of the key owner, and they cannot be restored. Call it only when the feed has to be cleared completely.
Parameters
There are no parameters and no body — only the URL. Any query string parameter and any body field are rejected with 400 INVALID_PARAMS before the Bitrix24 call, and nothing is deleted: an identifier passed outside the path does not result in deleting the whole feed. An empty {} object in the body is allowed.
DELETE /v1/notifications/:id deletes a single notification, and DELETE /v1/notifications/by-tag/:tag deletes notifications with a given tag.
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/notifications" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/notifications" \
-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/notifications', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success } = await res.json()
if (success) {
console.log('All notifications deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success } = await res.json()
if (success) {
console.log('All notifications deleted')
}
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | true on successful deletion |
data |
boolean | Always true. The success indicator is the HTTP code 200, not the value |
Response example
HTTP 200:
{
"success": true,
"data": true
}
Error response example
400 — a body field was passed, nothing was deleted:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "Body field `id` is not accepted by DELETE /v1/notifications. It takes no body fields."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS |
A query string parameter or a body field was passed, or the body is not a JSON object. The parameter is named in the message. Checked before the Bitrix24 call — nothing is deleted |
| 403 | SCOPE_DENIED |
The key lacks the im scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is in read-only mode |
| 401 | TOKEN_MISSING |
The key has no configured tokens |
Full list of common API errors — Errors.
Known specifics
- The call deletes the token owner's notifications: with a personal key, those of the key owner; with an OAuth application key and the
Authorization: Bearerheader, those of the user who owns the session. - The whole feed is deleted, not only the notifications of your application: system notifications and notifications of other applications on the Bitrix24 account are deleted too. To remove only your own, send them with a
tagand delete them by tag. - Verify success with the
200status code andsuccess: true. Deleting by id and by tag both return204with no body; this operation does not. - The response does not say how many notifications were deleted. The result is visible in the notification feed: after the call the
notificationsarray is empty, andtotalCountandtotalUnreadCountequal0.