[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ffolders\u002Fshares":3,"docs-tabs-entities\u002Ffolders\u002Fshares":6},{"content":4,"lastmod":5},"## Share a folder with a user\n\n`POST \u002Fv1\u002Ffolders\u002F:id\u002Fshares`\n\nGrants a Bitrix24 account user access to a folder at the selected level. Access takes effect immediately, before the user responds to the invitation.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | Folder ID. List: `GET \u002Fv1\u002Ffolders?parentId=X` |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `userId` | number | yes | ID of the Bitrix24 account user who receives access. List: `GET \u002Fv1\u002Fusers` |\n| `access` | string | yes | Access level: `read` — read access, `add` — add access, `edit` — edit access, `full` — full access. A numeric `id` from [`GET \u002Fv1\u002Ffolders\u002Faccess-levels`](\u002Fdocs\u002Fentities\u002Ffolders\u002Faccess-levels) is not accepted |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffolders\u002F10741\u002Fshares\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"userId\":8,\"access\":\"read\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffolders\u002F10741\u002Fshares\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"userId\":8,\"access\":\"read\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffolders\u002F10741\u002Fshares', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ userId: 8, access: 'read' }),\n})\nconst body = await res.json()\nif (!body.success) throw new Error(body.error.code)\nconsole.log('Access granted, user verified:', body.meta.recipientVerified)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffolders\u002F10741\u002Fshares', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ userId: 8, access: 'read' }),\n})\nconst body = await res.json()\nif (!body.success) throw new Error(body.error.code)\nconsole.log('Access granted, user verified:', body.meta.recipientVerified)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` — access granted |\n| `data.folderId` | number | Folder ID |\n| `data.userId` | number | ID of the user who received access |\n| `data.access` | string | Granted level: `read`, `add`, `edit` or `full` |\n| `meta.recipientVerified` | boolean | `true` — before access was granted, the API verified that the user exists and is not dismissed. `false` — no check was made: the key has no `user`, `user_basic` or `user_brief` scope |\n\n## Response example\n\nAccess granted — HTTP status `201 Created`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"folderId\": 10741,\n    \"userId\": 8,\n    \"access\": \"read\"\n  },\n  \"meta\": {\n    \"recipientVerified\": true\n  }\n}\n```\n\n## Error response example\n\n409 — the user owns the storage that contains the folder:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"DISK_SHARE_NOT_CREATED\",\n    \"message\": \"No access was granted: the recipient may own this storage.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_ID` | The folder `id` is not a positive integer |\n| 400 | `MISSING_REQUIRED_FIELDS` | The `userId` or `access` field is missing |\n| 400 | `INVALID_PARAMS` | `userId` is not a positive integer, or `access` is not one of `read`, `add`, `edit`, `full` |\n| 400 | `INVALID_PARAMS` | The user is dismissed. Checked when the key has the `user`, `user_basic` or `user_brief` scope |\n| 401 | `TOKEN_MISSING` | The key's portal has no authorization tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `disk` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode, and granting access changes portal data |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused to let the key owner grant access to this folder |\n| 404 | `ENTITY_NOT_FOUND` | There is no folder with this `id` |\n| 404 | `ENTITY_NOT_FOUND` | The user was not found. Checked when the key has the `user`, `user_basic` or `user_brief` scope |\n| 409 | `DISK_SHARE_NOT_CREATED` | Access was not granted: the user owns the storage that contains the folder |\n| 409 | `DISK_ALREADY_SHARED` | The user already has access to this folder. The level cannot be changed through the API |\n| 422 | `DISK_SHARE_REFUSED` | Bitrix24 did not confirm that access was granted |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused to grant access; the reason is in `message` |\n| 429 | `RATE_LIMITED` | Request limit exceeded — wait 1-2 seconds and retry |\n| 502 | `DISK_OUTCOME_UNKNOWN` | The connection to Bitrix24 dropped after the request was sent. The outcome is unknown, and no retry was made. If access was granted, a repeat call returns `409 DISK_ALREADY_SHARED` |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or did not return the user's data during the check; access was not granted |\n\nFull list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Invitation.** The user receives a notification inviting them to accept or decline the folder. The rights apply from the moment they are granted; accepting only connects the folder to the user's Drive. On Bitrix24 accounts with auto-connection, the folder is connected immediately.\n\n**User check.** The check runs with the key owner's permissions: if the key owner cannot see the user in `GET \u002Fv1\u002Fusers`, the response is `404`. Without the `user`, `user_basic` and `user_brief` scopes there is no check, and the rights may be assigned to a nonexistent user — verify `userId` yourself before the call.\n\n**Access cannot be changed or revoked through the API.** Granting a level higher than the key owner's own level is not possible either.\n\n**Storage types.** Access is granted to folders in user storages, group storages and the shared drive.\n\n**Batch calls.** The method is not part of [`POST \u002Fv1\u002Fbatch`](\u002Fdocs\u002Fbatch) — call it as a separate request.\n\n## See also\n\n- [Folder access levels](\u002Fdocs\u002Fentities\u002Ffolders\u002Faccess-levels)\n- [Get a folder](\u002Fdocs\u002Fentities\u002Ffolders\u002Fget)\n- [Public link to a folder](\u002Fdocs\u002Fentities\u002Ffolders\u002Fpublic-link)\n- [List users](\u002Fdocs\u002Fentities\u002Fusers\u002Flist)\n- [Folders](\u002Fdocs\u002Fentities\u002Ffolders)\n","2026-10-15",{},1795415252882]