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

Add recipients

POST /v1/posts/:id/share

Grants additional recipients access to the post — they see it in their Bitrix24 Feed. Adds recipients to those the post was already addressed to.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionPost ID. List: GET /v1/posts

Request body fields

Field Type Required Description
Fieldrecipients Typestring[] Requiredyes DescriptionAdditional post recipients (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)

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/posts/293/share" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"recipients": ["SG5", "U1"]}'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/posts/293/share" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipients": ["SG5", "U1"]}'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/293/share', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ recipients: ['SG5', 'U1'] }),
})
const { data } = await res.json()
console.log('Recipients added:', data)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/293/share', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ recipients: ['SG5', 'U1'] }),
})
const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeboolean Descriptiontrue — the post is shared with the specified recipients

Response example

JSON
{
  "success": true,
  "data": true
}

Error response example

404 — post not found:

JSON
{
  "success": false,
  "error": {
    "code": "POST_NOT_FOUND",
    "message": "Post 999999999 not found or not accessible with this key."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_POST_ID DescriptionPost ID is not a positive integer
HTTP400 CodeMISSING_PARAMS Descriptionrecipients not provided, not an array, or empty
HTTP400 CodeINVALID_RECIPIENTS DescriptionBitrix24 rejected the recipients as invalid
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no access tokens configured
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the log scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionNo permission to change recipients of 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
HTTP404 CodePOST_NOT_FOUND DescriptionPost with the given ID not found or not accessible to the key
HTTP404 CodePOST_NOT_FOUND_OR_INVALID_RECIPIENTS DescriptionThe post exists, but Bitrix24 rejected adding recipients — the post is inaccessible or one of the recipients is invalid

The full list of common API errors — Errors.

Known specifics

  • Recipients are added, not replaced. Recipients passed in recipients are added to the audience the post was shared with at creation. To replace the entire recipient list, update the post via PATCH /v1/posts/:id.

See also