For AI agents: markdown of this page — /docs-content-en/feed/posts/create.md documentation index — /llms.txt

Create a post

POST /v1/posts

Publishes a post to the Bitrix24 Feed and returns its identifier. The text supports BB-code for formatting.

A poll cannot be added to a post through the API.

Request body fields

Field Type Required Default Description
Fieldtext Typestring Requiredyes Default— DescriptionPost text. Supports BB-code: [b], [i], [url] and other formatting tags
Fieldtitle Typestring Requiredno Default— DescriptionPost title
Fieldrecipients Typestring[] Requiredyes Default— DescriptionWho sees the post. Prefixes:
UA — all employees in the Bitrix24 account, only without other recipients,
U<id> — employee (GET /v1/users),
D<id> — department without sub-departments,
DR<id> — department with sub-departments (GET /v1/departments),
SG<id> — workgroup or project (GET /v1/workgroups).
ID is a positive integer without leading zeros. At most 100 distinct recipients and 1000 array entries. An empty or omitted array is refused
Fieldfiles Typearray Requiredno Default— DescriptionFiles to attach to the post. Each element is a ["file_name", "<base64 content>"] pair. The file is uploaded to the author's Drive and attached to the post.
Example: [["estimate.pdf", "JVBERi0xLjQ…"]]

Examples

curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/posts \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "New version release",
    "text": "An update shipped today. [b]Details[/b] are in the comments.",
    "recipients": ["U1"]
  }'

curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/posts \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "New version release",
    "text": "An update shipped today. [b]Details[/b] are in the comments.",
    "recipients": ["U1"]
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'New version release',
    text: 'An update shipped today. [b]Details[/b] are in the comments.',
    recipients: ['U1'],
  }),
})

const { success, data } = await res.json()
console.log('Post ID:', data.id)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'New version release',
    text: 'An update shipped today. [b]Details[/b] are in the comments.',
    recipients: ['U1'],
  }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionThe created post
Fielddata.id Typenumber DescriptionIdentifier of the created post. Post address in your Bitrix24 account: https://<portal>.bitrix24.com/company/personal/user/<authorId>/blog/<id>/, where authorId is the authorId field from the GET /v1/posts response
Fielddata.recipients Typestring[] DescriptionExplicitly supplied recipients the post is shared with, in the original order

Response example

JSON
{
  "success": true,
  "data": {
    "id": 303,
    "recipients": ["U1"]
  }
}

Error response example

400 — text not provided:

JSON
{
  "success": false,
  "error": {
    "code": "MISSING_PARAMS",
    "message": "Required: text (string — post content)"
  }
}

Errors

HTTP Code Description
HTTP400 CodeMISSING_PARAMS Descriptiontext not provided, or recipients is omitted or contains an empty array
HTTP400 CodeINVALID_PARAMS DescriptionInvalid recipient type or code, UA mixed with other recipients, or an audience limit exceeded
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the log scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no access tokens configured
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected post creation (error text in message)
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable

The full list of common API errors — Errors.

See also