Per gli agenti AI: markdown di questa pagina — /docs-content-en/posts.md indice della documentazione — /llms.txt

Gli articoli della documentazione sono attualmente disponibili solo in inglese.

Posts

Reading an employee's comments on all posts in the Bitrix24 Feed: text, files and the identifiers for deleting a comment.

Scope: log | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key

Documentation sections

  • User comments — an employee's comments across the whole feed and the two identifiers of each comment

What to know about comments

The GET /v1/posts/comments method selects one employee's comments across the whole feed, not the comments of a single post. The post of each comment is given in the postId field: the client uses it to pick out the comments of the post it needs.

Each comment has two identifiers. id is the comment ID in the feed: it is accepted by the firstId and lastId cursors and by the Delete a feed comment method. commentId is the post comment ID: together with postId, it is accepted by the Delete a comment method.

The posts themselves — creating, listing, updating and deleting them — are described in the Posts section of the Feed. Adding a comment to a single post and deleting it are described in the Comments section.

Quick start

The two most recent comments of the key's user:

Terminal
curl "https://vibecode.bitrix24.com/v1/posts/comments?limit=2" \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

JSON
{
  "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": []
  }
}

Full example

Collect all comments of the key's user and count how many each post has. The method returns comments in pages, from newest to oldest. The script requests the next page with lastId equal to the smallest id on the previous one.

Terminal
BASE='https://vibecode.bitrix24.com/v1'
LAST_ID=0
: > comments.jsonl

# 1. Pages from newest to oldest: the next page starts after the smallest id of the previous one
while true; do
  PAGE=$(curl -s "$BASE/posts/comments?limit=100&lastId=$LAST_ID" \
    -H "X-Api-Key: YOUR_API_KEY")
  [ "$(echo "$PAGE" | jq '.data.comments | length')" -eq 0 ] && break
  echo "$PAGE" | jq -c '.data.comments[]' >> comments.jsonl
  LAST_ID=$(echo "$PAGE" | jq '[.data.comments[].id] | min')
done

# 2. How many comments each post has
jq -s 'group_by(.postId) | map({postId: .[0].postId, comments: length})' comments.jsonl

The loop ends when a page comes back with an empty data.comments array. Step 2 prints:

JSON
[
  {
    "postId": 327,
    "comments": 3
  }
]

Endpoint reference

Method Path Bitrix24 method Description
MethodGET Path/v1/posts/comments Bitrix24 methodlog.blogcomment.user.get DescriptionRead an employee's comments on all feed posts

Error codes

Section errors

HTTP Code When
HTTP400 CodeINVALID_PARAMS WhenuserId, firstId, lastId or limit is not a positive integer. firstId and lastId also accept 0
HTTP400 CodeINVALID_PARAMS WhenThe request contains a parameter the method does not accept
HTTP403 CodeBITRIX_ACCESS_DENIED WhenBitrix24 denied access
HTTP422 CodeBITRIX_ERROR WhenBitrix24 rejected the request. The error text is in error.message
HTTP502 CodeBITRIX_ERROR WhenThe Bitrix24 response does not have the expected shape: Invalid comment response

System errors

HTTP Code When
HTTP401 CodeMISSING_API_KEY WhenThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY WhenThe key is not found or has been revoked
HTTP401 CodeTOKEN_MISSING WhenThe key has no portal tokens. An OAuth application key requires the Authorization: Bearer header
HTTP403 CodeSCOPE_DENIED WhenThe key does not have the log scope
HTTP429 CodeRATE_LIMITED WhenThe request rate to Bitrix24 was exceeded
HTTP502 CodeBITRIX_UNAVAILABLE WhenBitrix24 is unavailable
HTTP503 CodeBITRIX_TIMEOUT WhenBitrix24 accepted the request but did not respond in time

Full list of common API errors — Errors.

See also