Per gli agenti AI: markdown di questa pagina — /docs-content-en/posts/comments/read.md indice della documentazione — /llms.txt
Gli articoli della documentazione sono attualmente disponibili solo in inglese.
Read user comments
GET /v1/posts/comments
Returns an employee's comments on all Feed posts, from newest to oldest.
The method has no post filter: the post of each comment is given in the postId field.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ParameteruserId (query) |
Typenumber | Requiredno | Defaultthe key's user | DescriptionID of the employee whose comments you need. List: GET /v1/users. Applies only if the key's user is a Bitrix24 account administrator. If the key belongs to an employee without administrator rights, the parameter has no effect: that employee's own comments are returned, with no error |
ParameterlastId (query) |
Typenumber | Requiredno | Default— | DescriptionComment ID in the feed — the data.comments[].id field. Returns the nearest comments older than it. 0 — start from the newest comment |
ParameterfirstId (query) |
Typenumber | Requiredno | Default— | DescriptionComment ID in the feed — the data.comments[].id field. Returns the nearest comments newer than it. 0 — start from the oldest comment. If both firstId and lastId are passed, only firstId applies |
Parameterlimit (query) |
Typenumber | Requiredno | Default100 |
DescriptionHow many comments to return, a positive integer. A value greater than 1000 is replaced with 1000 |
Other query parameters are rejected with 400 INVALID_PARAMS.
Pagination: to move toward older comments, request the next page with lastId equal to the smallest id on the current page; to move toward newer ones, use firstId equal to the largest. Within a page, comments are always sorted from newest to oldest, even with firstId: the largest id comes first. An empty data.comments array means there are no more comments in that direction.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/posts/comments?limit=2" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/posts/comments?limit=2" \
-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/posts/comments?limit=2', {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const result = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/comments?limit=2', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const result = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on a successful response |
Fielddata.comments |
Typearray | DescriptionThe employee's comments, from newest to oldest. An empty array means there are no comments |
Fielddata.comments[].id |
Typenumber | DescriptionComment ID in the feed. Accepted by the firstId and lastId cursors and by DELETE /v1/feed-comments/:id |
Fielddata.comments[].commentId |
Typenumber | DescriptionPost comment ID. Used together with postId in DELETE /v1/posts/:id/comments/:commentId |
Fielddata.comments[].postId |
Typenumber | DescriptionID of the post the comment was left on. List of posts: GET /v1/posts |
Fielddata.comments[].date |
Typestring | DescriptionDate and time of the comment in ISO 8601 format with a time zone offset |
Fielddata.comments[].text |
Typestring | DescriptionComment text. When an administrator requests another employee's comments via userId, an empty string is returned. The exception is system comments that Bitrix24 creates on its own, for example about a task created from a comment |
Fielddata.comments[].attach |
Typearray | DescriptionIDs of the files attached to the comment, as numbers. These are the keys of data.files and link a file to its comment. If there are no files, an empty array [] is returned |
Fielddata.files |
Typeobject or array | DescriptionFiles attached to the comments. Each key is a Drive file ID. If there are no files, an empty array [] is returned |
Fielddata.files.<id>.id |
Typenumber | DescriptionDrive file ID |
Fielddata.files.<id>.name |
Typestring | DescriptionFile name |
Fielddata.files.<id>.type |
Typestring | DescriptionFile kind: image — an image, video — a video, file — any other file |
Fielddata.files.<id>.size |
Typenumber | DescriptionFile size in bytes |
Fielddata.files.<id>.date |
Typestring | DescriptionDate and time the file was uploaded, in ISO 8601 format |
Fielddata.files.<id>.authorId |
Typenumber | DescriptionID of the employee who uploaded the file. List: GET /v1/users |
Fielddata.files.<id>.authorName |
Typestring | DescriptionName of the employee who uploaded the file |
Fielddata.files.<id>.image |
Typeobject or false |
DescriptionDimensions in pixels — the width and height fields. For a video — the dimensions of the preview frame, or 0 if there is no preview. For files of the file kind — false |
Fielddata.files.<id>.urlPreview |
Typestring or null |
DescriptionPreview URL on the Bitrix24 account. null — there is no preview |
Fielddata.files.<id>.urlShow |
Typestring | DescriptionURL for viewing the file on the Bitrix24 account. For files other than images, it matches urlDownload |
Fielddata.files.<id>.urlDownload |
Typestring | DescriptionURL for downloading the file from the Bitrix24 account |
File URLs point to the Bitrix24 account, not to the Vibecode API. A response string that contains Bitrix24 authorization data — for example, an auth or token parameter in a URL — is replaced entirely with [REDACTED]: this happens both to a file URL and to comment text that contains such a link. This value is not a URL and cannot be opened.
Response example
{
"success": true,
"data": {
"comments": [
{
"id": 6217,
"commentId": 75,
"postId": 327,
"date": "2026-10-23T02:18:37+00:00",
"text": "Moved the call with the contractor to Friday.",
"attach": []
},
{
"id": 6215,
"commentId": 73,
"postId": 327,
"date": "2026-10-23T02:18:37+00:00",
"text": "Added the quarterly results to the agenda.",
"attach": []
}
],
"files": []
}
}
Error response example
400 — limit is not a positive integer:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "limit must be a positive integer (cursor also accepts zero)"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionuserId, firstId, lastId or limit is not a positive integer. firstId and lastId also accept 0 |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe request contains a parameter the method does not accept |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 denied access |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the request. The error text is in error.message |
| HTTP502 | CodeBITRIX_ERROR |
DescriptionThe Bitrix24 response does not have the expected shape: Invalid comment response |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe key is not found or has been revoked |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no portal tokens. An OAuth application key requires the Authorization: Bearer header |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key does not have the log scope |
| HTTP429 | CodeRATE_LIMITED |
DescriptionThe Bitrix24 request rate limit was exceeded. Retry after the delay in the Retry-After header |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable |
| HTTP503 | CodeBITRIX_TIMEOUT |
DescriptionBitrix24 accepted the request but did not respond in time |
Full list of common API errors — Errors.