For AI agents: markdown of this page — /docs-content-en/entities/tasks/results-v3-from-chat-message.md documentation index — /llms.txt

Create a task result from a chat message

POST /v1/task-results/from-chat-message

Turns a message from a task's chat into a result of that task: the method takes the result text from the message and determines the task from the chat where the message was posted.

Request fields (body)

Field Type Required Description
Fieldfields Typeobject Requiredyes DescriptionObject with the message ID
Fieldfields.messageId Typenumber Requiredyes DescriptionID of a message in the task chat. List: GET /v1/tasks/:taskId/chat/messages. Number only: for the string "43121" the method returns 400

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/task-results/from-chat-message" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "messageId": 43121
    }
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/task-results/from-chat-message" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "messageId": 43121
    }
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/task-results/from-chat-message', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      messageId: 43121,
    },
  }),
})

const { success, data } = await res.json()
console.log('Result ID:', data.item.id, 'task:', data.item.taskId)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/task-results/from-chat-message', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      messageId: 43121,
    },
  }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue if the result was created
Fielddata Typeobject DescriptionWrapper with the created result
Fielddata.item Typeobject DescriptionThe created result
Fielddata.item.id Typenumber DescriptionResult ID. Needed to update and delete the result
Fielddata.item.taskId Typenumber DescriptionID of the task whose chat the message belongs to
Fielddata.item.text Typestring DescriptionResult text — the text of the message
Fielddata.item.authorId Typenumber DescriptionID of the result author. List: GET /v1/users
Fielddata.item.createdAt Typestring DescriptionCreation date and time in ISO 8601 format with a time zone offset
Fielddata.item.updatedAt Typestring DescriptionDate and time of the last change, in the same format
Fielddata.item.status Typestring DescriptionResult status. A new result has open
Fielddata.item.fileIds Typenull DescriptionResult files. A result without files has null
Fielddata.item.rights Typeobject DescriptionPermissions on the result
Fielddata.item.rights.edit Typeboolean Descriptiontrue — the result text can be changed
Fielddata.item.rights.remove Typeboolean Descriptiontrue — the result can be deleted
Fielddata.item.messageId Typenumber DescriptionID of the message the result was created from

Response example

JSON
{
  "success": true,
  "data": {
    "item": {
      "id": 23,
      "taskId": 4205,
      "text": "The report is ready, the files are in the project folder",
      "authorId": 1295,
      "createdAt": "2026-10-16T09:44:58+00:00",
      "updatedAt": "2026-10-16T09:44:58+00:00",
      "status": "open",
      "fileIds": null,
      "rights": {
        "edit": true,
        "remove": true
      },
      "messageId": 43121
    }
  }
}

Error response example

403 — the message was not posted in a task chat:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ACCESS_DENIED",
    "message": "Access denied",
    "hint": "Bitrix24 reports an access-rights refusal for tasks.task.result.addfromchatmessage, not a scope error. The Bitrix24 user this call runs as lacks access; ask a portal admin to grant it, or call under a user who has it.",
    "cause": "b24_permission",
    "method": "tasks.task.result.addfromchatmessage",
    "fix": {
      "action": "grant_b24_rights",
      "via": "portal_admin"
    }
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe body is not a JSON object or has no fields object. Message: fields must be an object
HTTP400 CodeINVALID_PARAMS DescriptionmessageId is passed as a string. The reason is in error.validation
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionNo message with this messageId exists, or it was not posted in a task chat
HTTP403 CodeSCOPE_DENIED DescriptionThe key has no task scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode. error.details.switchUrl contains the URL of the section where the mode is changed
HTTP415 CodeFST_ERR_CTP_INVALID_MEDIA_TYPE DescriptionA non-empty body with a Content-Type other than application/json
HTTP422 CodeBITRIX_ERROR Descriptionfields has no messageId. The missing field is named in error.validation
HTTP429 CodeRATE_LIMITED DescriptionRequest rate exceeded. The effective cap is in the x-ratelimit-limit header

The full list of common API errors — Errors.

Known specifics

A repeated call creates another result. Each request with the same messageId adds a new result with the same text to the task. Results already created are listed by GET /v1/tasks/:taskId/results.

See also