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.
Request body fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
text |
string | yes | — | Post text. Supports BB-code: [b], [i], [url] and other formatting tags |
title |
string | no | — | Post title |
recipients |
string[] | no | ["UA"] |
Who sees the post. Prefixes (can be combined in an array):UA — all employees in the Bitrix24 account,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).Empty array or omission — ["UA"] |
files |
array | no | — | Files 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
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
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
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
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 |
|---|---|---|
data.id |
number | Identifier 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 |
data.recipients |
string[] | Recipients the post is shared with. If recipients is omitted or empty — ["UA"] is returned |
Response example
{
"success": true,
"data": {
"id": 303,
"recipients": ["U1"]
}
}
Error response example
400 — text not provided:
{
"success": false,
"error": {
"code": "MISSING_PARAMS",
"message": "Required: text (string — post content)"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | MISSING_PARAMS |
Required parameter text not provided |
| 403 | SCOPE_DENIED |
The API key lacks the log scope |
| 401 | TOKEN_MISSING |
The API key has no access tokens configured |
| 422 | BITRIX_ERROR |
Bitrix24 rejected post creation (error text in message) |
| 502 | BITRIX_UNAVAILABLE |
Bitrix24 is unavailable |
The full list of common API errors — Errors.