For AI agents: markdown of this page — /docs-content-en/bots/ui/text-field.md documentation index — /llms.txt

Input field control

POST /v1/bots/:botId/text-field

Enables or disables the text input field in a chat with the bot. Useful when the bot accepts input only via the keyboard (buttons).

Parameters

Parameter Type Required Description
ParameterbotId (path) Typenumber Requiredyes DescriptionBot ID. Bot list: GET /v1/bots

Request fields (body)

Parameter Type Required Description
ParameterdialogId Typestring Requiredyes DescriptionDialog ID: numeric user ID for direct chats (user list: GET /v1/users), chatXXX for group chats — from the Create a chat response
Parameterenabled Typeboolean Requiredyes Descriptiontrue — enable the input field, false — disable it

Examples

curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/bots/42/text-field \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "dialogId": "chat123", "enabled": false }'

curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/bots/42/text-field \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "dialogId": "chat123", "enabled": false }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/text-field', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ dialogId: 'chat123', enabled: false }),
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/text-field', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ dialogId: 'chat123', enabled: false }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionResult of the change
Fielddata.result Typeboolean Descriptiontrue if the change succeeded. The current input field state is data.chat.textFieldEnabled in the Get a chat response

Response example

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

Error response example

404 — bot not found:

JSON
{
  "success": false,
  "error": {
    "code": "BOT_NOT_FOUND",
    "message": "Bot 999 not found. Register it first via POST /v1/bots."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_BOT_ID DescriptionbotId is not a number
HTTP404 CodeBOT_NOT_FOUND DescriptionNo bot found with this ID
HTTP403 CodeBOT_ACCESS_DENIED DescriptionThe bot belongs to a different API key
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 error (error text in message)
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the imbot scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only — see access rights
HTTP410 CodeBOT_DISABLED DescriptionThe bot is disabled and does not process API calls. How to restore it — Bot disabled
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

Full list of common API errors — Errors.

See also