#Task chat
GET /v1/tasks/:taskId/chat/messages
Reads the task's chat feed — newest messages first. Every task in Bitrix24 has a group chat; this endpoint resolves the chat from the task ID itself, so you never need to know the chat id. A typical scenario is pulling the final messages of a task (e.g. "deployed in im 24.500.0" to extract a release version).
Bitrix24 API: im.v2.Chat.Message.tail (on older portals — im.dialog.messages.get)
Scope: task (the key also needs the im B24 scope — see below)
#Query parameters
| Parameter | Type | Req. | Description |
|---|---|---|---|
limit |
number | Messages per page, 1..200, default 50 | |
lastId |
number | Cursor: return messages older than this id. For the next page pass the minimal id of the current one |
#Example
curl "https://vibecode.bitrix24.com/v1/tasks/53/chat/messages?limit=50" \
-H "X-Api-Key: YOUR_API_KEY"
Response:
{
"success": true,
"data": {
"messages": [
{
"id": 9123,
"authorId": 20294,
"text": "deployed in im 24.500.0",
"createdAt": "2026-06-10T14:51:00+02:00",
"isSystem": false
}
],
"hasNextPage": true
}
}
#Message fields
| Field | Description |
|---|---|
id |
Message ID — use the minimal one from the page as lastId for the next page |
authorId |
Author (0 for system messages) |
text |
Text with normalized BB-codes |
createdAt |
Creation date, ISO 8601 |
isSystem |
System message ("task created", "deadline changed", …) — filter on this flag when you only need human replies |
#What to know before you start
- The
imB24 scope is required. The endpoint reads the chat through Bitrix24im.*methods — the key's webhook/OAuth grant must include theimscope in addition totask, otherwise the portal returnsinsufficient_scope. - Access follows chat membership. Bitrix24 returns messages only when the key's B24 user is a member of the task chat (creator, assignee, watcher) or a portal administrator.
- Messages come newest-first. The first element is the most recent message. Cursor pagination via
lastIdgoes back through history. - 404 when there is no chat yet. Bitrix24 creates the task chat lazily — a task with no chat messages may have no chat at all (
TASK_CHAT_NOT_FOUND). - Older portals. On portals without the modern
im.v2surface the API transparently switches to the legacy method: the page is capped at 50 messages there andhasNextPageis derived from page fullness. - Comments vs chat. `GET /v1/tasks/:taskId/comments` returns only human comments; this endpoint returns the raw chat feed in full, including system messages.
#Errors
| HTTP | Code | Cause |
|---|---|---|
| 400 | INVALID_PARAMS |
Non-numeric taskId, non-numeric/non-positive limit or lastId (limit above 200 is not an error — it is silently capped to 200) |
| 403 | SCOPE_DENIED |
The key lacks the task scope |
| 404 | TASK_CHAT_NOT_FOUND |
The task has no chat (or the task does not exist) |
| 422 | BITRIX_ERROR |
Bitrix24 error: insufficient_scope (no im), ACCESS_ERROR (not a chat member) |
#See also
- Tasks — the parent entity
- Task comments — filtered human comments + posting
- Scrum — epics and scrum placement of tasks