[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fservice\u002Ftask-form-message":3,"docs-tabs-chats\u002Fservice\u002Ftask-form-message":6},{"content":4,"lastmod":5},"## Task form for a message\n\n`POST \u002Fv1\u002Fchats\u002Fmessages\u002F:messageId\u002Ftask-form`\n\nPrepares the data for the form that creates a task from a chat message, but does not create the task itself: the user fills in and saves the form in Bitrix24.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `messageId` (path) | number | yes | Message ID, a positive integer — the `id` field of a message from the [message history](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) or [chat loading](\u002Fdocs\u002Fchats\u002Fmessages\u002Fload). The chat is resolved from the message |\n\nThe request has no body and no query parameters: any body field or query parameter is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Ftask-form\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Ftask-form\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Ftask-form', {\n  method: 'POST',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { data } = await res.json()\nconsole.log('Quote:', data.params.description)\nconsole.log('Files:', data.params.ufTaskWebdavFilesData?.map((f) => f.name))\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Ftask-form', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\nconsole.log('Form:', data.link)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | Form data |\n| `data.link` | string | Relative link to the task creation form in Bitrix24: to open the form, prepend your Bitrix24 address to it |\n| `data.params` | object | Form fields. The set depends on the chat — see the paragraph after the table |\n| `data.params.responsibleId` | number | Assignee — the calling user |\n| `data.params.imChatId` | number | ID of the message's chat |\n| `data.params.auditors` | string | Observers — comma-separated IDs of the chat members except the caller, no more than 50. A group or project chat has no observers |\n| `data.params.groupId` | number \\| null | Group or project ID — for a group or project chat |\n| `data.params.imMessageId` | number | Message ID |\n| `data.params.ufTaskWebdavFiles` | string[] | IDs of the file copies on Drive in the `n\u003Cid>` format — present only if the message has files |\n| `data.params.ufTaskWebdavFilesSign` | string | Bitrix24 signature over the list of copies — the form sends it back when the task is saved |\n| `data.params.ufTaskWebdavFilesData[]` | object[] | File copies |\n| `data.params.ufTaskWebdavFilesData[].id` | string | Copy ID in the `n\u003Cid>` format, as in `ufTaskWebdavFiles` |\n| `data.params.ufTaskWebdavFilesData[].objectId` | number | Copy ID on Drive |\n| `data.params.ufTaskWebdavFilesData[].name` | string | Copy name |\n| `data.params.ufTaskWebdavFilesData[].type` | string | File type |\n| `data.params.ufTaskWebdavFilesData[].url` | string | Download link of the copy |\n| `data.params.ufTaskWebdavFilesData[].previewUrl` | string | Preview link. An empty string if there is no preview |\n| `data.params.ufTaskWebdavFilesData[].height`, `data.params.ufTaskWebdavFilesData[].width` | number | Image height and width in pixels. `0` for files without dimensions |\n| `data.params.isTasksV2` | boolean | `true` — the new version of tasks is enabled in Bitrix24. The response then includes the fields below |\n| `data.params.entityId` | number | Chat ID |\n| `data.params.subEntityId` | number | Message ID |\n| `data.params.taSec`, `data.params.taEl` | string | Source labels for Bitrix24 analytics |\n| `data.params.description` | string | Message quote with BB codes: the chat name, the author, the text |\n\nThe contents of `params` depend on the chat and the Bitrix24 settings: Open Channels chats carry a CRM binding, and with the previous version of tasks the `isTasksV2` field and the fields below it are absent.\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"link\": \"\u002Fcompany\u002Fpersonal\u002Fuser\u002F1\u002Ftasks\u002Ftask\u002Fedit\u002F0\u002F?ta_sec=chat&ta_el=chat_context_menu\",\n    \"params\": {\n      \"responsibleId\": 1,\n      \"imChatId\": 42,\n      \"auditors\": \"4\",\n      \"imMessageId\": 1002,\n      \"subEntityId\": 1002,\n      \"isTasksV2\": true,\n      \"entityId\": 42,\n      \"taSec\": \"chat\",\n      \"taEl\": \"chat_context_menu\",\n      \"groupId\": null,\n      \"description\": \"[QUOTE][B]Chat:[\u002FB] [URL=\u002Fonline\u002F?IM_DIALOG=chat42&IM_MESSAGE=1002]Project[\u002FURL]\\n[B]Maria Smith[\u002FB]\\nThe report is attached[File: report.txt]\\n[\u002FQUOTE]\",\n      \"ufTaskWebdavFiles\": [\"n6773\"],\n      \"ufTaskWebdavFilesSign\": \"\u003Csignature>\",\n      \"ufTaskWebdavFilesData\": [\n        {\n          \"id\": \"n6773\",\n          \"objectId\": 6773,\n          \"name\": \"report (1).txt\",\n          \"type\": \"txt\",\n          \"url\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fbitrix\u002Fservices\u002Fmain\u002Fajax.php?action=disk.api.file.download&SITE_ID=s1&humanRE=1&fileId=6773&exact=N&fileName=report%20%281%29.txt\",\n          \"height\": 0,\n          \"width\": 0,\n          \"previewUrl\": \"\"\n        }\n      ]\n    }\n  }\n}\n```\n\n## Error response example\n\n400 — `messageId` is not a positive integer:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"messageId must be a positive integer.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `messageId` is not a positive integer, or a body field or query parameter was passed |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned \"not found\". The Bitrix24 code is in `error.b24Code` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error. The Bitrix24 code is in `error.b24Code`. `TASK_ACCESS_ERROR` — no access to the message or its chat, `TASKS_NOT_INSTALLED` — the tasks module is not installed |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- If the message has files, every call creates new copies of them in the \"Uploaded files\" folder on the caller's Drive. Copies that do not make it into a task are deleted on a schedule.\n- The operation may make the caller a chat member if the chat allows auto-join (a collab or a comment chat, for example), just as opening the chat in Bitrix24 does.\n\n## See also\n\n- [Task form](\u002Fdocs\u002Fchats\u002Fservice\u002Ftask-form)\n- [Flow form](\u002Fdocs\u002Fchats\u002Fservice\u002Fflow-form)\n- [Messages around a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcontext)\n- [Service methods](\u002Fdocs\u002Fchats\u002Fservice)\n","2026-10-07",{},1795377122000]