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

Unpin a chat

DELETE /v1/chats/:dialogId/pin

Unpins a chat in the current user's dialog list: the chat returns to its position according to its last activity time. The chat's messages and members do not change.

Parameters

Parameter Type Required Description
ParameterdialogId (path) Typestring Requiredyes DescriptionDialog ID: a numeric user ID for a direct dialog, chatXXX for a group chat, me for the current user's own dialog. Pinned chats are the rows with pinned: true in recent dialogs

No request body is sent. Any query parameter or body field is rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X DELETE https://vibecode.bitrix24.com/v1/chats/chat456/pin \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

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

const { success, data } = await res.json()

JavaScript — OAuth application

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

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.result Typeboolean Descriptiontrue — the chat is not pinned. A call for a chat that was not pinned also returns true

Response example

JSON
{
  "success": true,
  "data": {
    "result": true
  }
}

Error response example

400 — a request body was passed:

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

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA query parameter or a body field was passed. Checked before the Bitrix24 call
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error; the Bitrix24 code is in error.b24Code
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 answered "not found"; the Bitrix24 code is in error.b24Code
HTTP502 CodeME_ALIAS_RESOLUTION_FAILED DescriptionThe user could not be resolved for the me alias
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe user has no access to the chat
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionRead-only key: unpinning is a write, see access rights
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error

Full list of common API errors — Errors.

Known specifics

It removes a chat's pin, not a message's. A message pinned inside a chat is unpinned through a separate path, DELETE /v1/chats/messages/:messageId/pin, with the message ID in the path.

The call may make you a member. When the chat allows auto-join — for example, a comment chat, a collab or a task chat — the call adds the current user as a member, just as opening the chat in the Bitrix24 interface does.

See also