For AI agents: markdown of this page — /docs-content-en/chats/management/parent-delete.md documentation index — /llms.txt
Detach from the parent chat
DELETE /v1/chats/:dialogId/parent
The chat stops being a child and becomes standalone. Detaching does not remove the members that attaching added to the parent chat. A chat can be detached by whoever has that permission in the chat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParameterdialogId (path) |
Typestring | Requiredyes | DescriptionThe child chat as chatN, for example chat42 — the dialogId field of recent dialogs |
The endpoint accepts no query parameters and no request body: any parameter or body field is rejected with 400 INVALID_PARAMS before any call to Bitrix24.
Examples
curl — personal key
curl -X DELETE https://vibecode.bitrix24.com/v1/chats/chat42/parent \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE https://vibecode.bitrix24.com/v1/chats/chat42/parent \
-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/chats/chat42/parent', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { success, data } = await res.json()
console.log('Detached:', data.result) // true
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat42/parent', {
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 detached |
Response example
{
"success": true,
"data": {
"result": true
}
}
Error response example
422 — the chat has no parent:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "CHAT_HAS_NO_PARENT",
"b24Code": "CHAT_HAS_NO_PARENT"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA query parameter or a body field was sent — the endpoint accepts neither — or the body is not a JSON object |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe caller has no permission to detach this chat |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionBitrix24 returned "not found"; the portal code is in error.b24Code |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned an error; the portal code is in error.b24Code. CHAT_HAS_NO_PARENT — the chat has no parent, CHAT_NOT_FOUND — the chat does not exist on the portal |
| HTTP502 | CodeME_ALIAS_RESOLUTION_FAILED |
DescriptionFailed to resolve the user when using the me alias |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable or returned a server error |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the im scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is read-only — see access rights |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no Bitrix24 tokens configured |
The full list of common API errors — Errors.