لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/feed/posts.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Posts
Publishing posts to the Bitrix24 Feed: create, list, update, delete, and grant access to additional recipients.
Scope: log
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 |
|---|---|---|---|---|
Fieldtext |
Typestring | Requiredyes | Default— | DescriptionPost text. Supports BB-code: [b], [i], [url] and other formatting tags |
Fieldtitle |
Typestring | Requiredno | Default— | DescriptionPost title |
Fieldrecipients |
Typestring[] | Requiredno | Default["UA"] |
DescriptionWho 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).An empty or omitted array defaults to ["UA"] |
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
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 |
|---|---|---|
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[] | DescriptionRecipients 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 |
|---|---|---|
| HTTP400 | CodeMISSING_PARAMS |
DescriptionRequired parameter text not provided |
| 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.