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 |
|---|---|---|---|
Parameterid |
Typenumber | Requiredyes | DescriptionPost ID (path parameter). List: GET /v1/posts |
Request body fields
| Field | Type | Description |
|---|---|---|
Fieldtext |
Typestring | DescriptionNew post text. Supports BB-code: [b], [i], [url] and other formatting tags |
Fieldtitle |
Typestring | DescriptionNew post title |
Fieldrecipients |
Typestring[] | DescriptionNew 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) |
Fieldfiles |
Typearray | 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 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 |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typenumber | DescriptionID 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 |
|---|---|---|
| HTTP404 | CodePOST_NOT_FOUND |
DescriptionPost with the given id not found |
| HTTP400 | CodeMISSING_PARAMS |
DescriptionThe 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 |
| HTTP400 | CodeINVALID_POST_ID |
DescriptionInvalid post id |
| HTTP400 | CodeINVALID_RECIPIENTS |
DescriptionInvalid values in recipients |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionNo 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 |
| 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 the post update (error text in message) |
The full list of common API errors — Errors.
Known specifics
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.