For AI agents: markdown of this page — /docs-content-en/feed/posts/update.md documentation index — /llms.txt
Update a post
PATCH /v1/posts/:id
Modifies an existing post in the Bitrix24 Feed. Pass only the fields you want to change — but at least one of text, title, recipients, files: a request with none of them is refused before Bitrix24 is called.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | yes | Post ID (path parameter). List: GET /v1/posts |
Request body fields
| Field | Type | Description |
|---|---|---|
text |
string | New post text. Supports BB-code: [b], [i], [url] and other formatting tags |
title |
string | New post title |
recipients |
string[] | New recipient list (can be combined in an array):UA — all employees in your 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) |
files |
array | 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 PATCH https://vibecode.bitrix24.com/v1/posts/303 \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Updated post text. [b]Important[/b]: deadlines have shifted."
}'
curl — OAuth application
curl -X PATCH https://vibecode.bitrix24.com/v1/posts/303 \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"text": "Updated post text. [b]Important[/b]: deadlines have shifted."
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/303', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
text: 'Updated post text. [b]Important[/b]: deadlines have shifted.',
}),
})
const { success, data } = await res.json()
console.log('Updated post:', data)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/303', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
text: 'Updated post text. [b]Important[/b]: deadlines have shifted.',
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
data |
number | ID of the updated post |
Response example
{
"success": true,
"data": 303
}
Error response example
404 — post not found:
{
"success": false,
"error": {
"code": "POST_NOT_FOUND",
"message": "Post 999999999 not found or not accessible with this key."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 404 | POST_NOT_FOUND |
Post with the given id not found |
| 400 | MISSING_PARAMS |
The body has none of the text, title, recipients, files fields (including when the text is sent under a different field name — message names that field). Nothing was sent to Bitrix24 |
| 400 | INVALID_POST_ID |
Invalid post id |
| 400 | INVALID_RECIPIENTS |
Invalid values in recipients |
| 403 | BITRIX_ACCESS_DENIED |
No permission to change this post. message is the fixed text Bitrix24 denied access to this post., and the cause and what to do are in the cause, fix and hint fields. Details — Authorization, keys and permissions |
| 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 the post update (error text in message) |
The full list of common API errors — Errors.
Known specifics
Nothing to change — a refusal, not "updated". Previously a request without changeable fields (for example {}, or the text sent as message) returned 200 and changed nothing. Now such a request gets 400 MISSING_PARAMS right away — so a typo in a field name does not look like a success.
Partial update preserves the title. A request with only the text field (without title) does not reset the title — the previous title value remains, only the text is updated.