For AI agents: markdown of this page — /docs-content-en/chats/service/desktop-logout.md documentation index — /llms.txt

Desktop app logout

POST /v1/chats/desktop/logout

Marks the caller's desktop app and the caller themselves "offline" in the messenger — as the Bitrix24 desktop app does when it logs out.

Parameters

There are no parameters. Any body field or query parameter is rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/chats/desktop/logout" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/chats/desktop/logout" \
  -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/chats/desktop/logout', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success } = await res.json()
console.log('Marked:', success)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/desktop/logout', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success } = await res.json()
console.log('Marked:', success)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionAlways an empty array

Response example

JSON
{
  "success": true,
  "data": []
}

Error response example

400 — a body field was passed:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Body field `dialogId` is not accepted by POST /v1/chats/desktop/logout. It takes no body fields."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA body field or query parameter was passed — the operation accepts none
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error. The Bitrix24 code is in error.b24Code
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error

For the full list of common API errors, see Errors.

Known specifics

  • The call does not sign out of Bitrix24 and does not revoke keys — only the presence status changes.
  • Any subsequent messenger call from the same user, such as a request for the update state, marks them "online" again.

See also