لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/storages/folders.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Create a folder at storage root
POST /v1/storages/:id/folders
Creates a folder at storage root. Unlike POST /v1/folders, no parentId lookup is needed. Requires disk scope. READONLY keys receive 403.
Request fields
Path id is a positive integer storage ID. Find it through GET /v1/storages, for example with filter[entityType]=user. The type dictionary is incomplete.
Body: name is a required nonempty string. Unknown fields, including rights, are refused. Rights are inherited from the root. Bitrix24 refuses duplicate names; no automatic renaming occurs.
Examples
curl — personal key
curl -X POST 'https://vibecode.bitrix24.com/v1/storages/3/folders' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name":"Reports"}'
curl — OAuth application
curl -X POST 'https://vibecode.bitrix24.com/v1/storages/3/folders' \
-H 'X-Api-Key: YOUR_APP_KEY' \
-H 'Authorization: Bearer USER_SESSION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"name":"Reports"}'
JavaScript — personal key
const response = await fetch('https://vibecode.bitrix24.com/v1/storages/3/folders', {
method: 'POST',
headers: {"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
body: JSON.stringify({"name": "Reports"}),
})
const result = await response.json()
console.log(result)
JavaScript — OAuth application
const response = await fetch('https://vibecode.bitrix24.com/v1/storages/3/folders', {
method: 'POST',
headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN", "Content-Type": "application/json"},
body: JSON.stringify({"name": "Reports"}),
})
const result = await response.json()
console.log(result)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionSuccessful request |
Fielddata |
Typeobject | DescriptionCreated folder |
HTTP 201, a folder in the folders projection.
{"success":true,"data":{"id":7,"type":"folder","name":"Reports","parentId":9,"storageId":3}}
The write is not automatically replayed after network failure or timeout. Its outcome may be unknown: reread root contents before retrying.
Errors
Example refusal (400):
{"success":false,"error":{"code":"INVALID_ID","message":"id must be a positive integer."}}
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_ID |
DescriptionInvalid storage ID |
| HTTP400 | CodeMISSING_REQUIRED_FIELDS |
DescriptionMissing name, empty or invalid name, unknown fields |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionMissing name, empty or invalid name, unknown fields |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionScope, key access mode or Bitrix24 permissions |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionScope, key access mode or Bitrix24 permissions |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionScope, key access mode or Bitrix24 permissions |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionStorage not found |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionDuplicate name, Bitrix24 business refusal or no folder returned |
| HTTP422 | CodeOPERATION_FAILED |
DescriptionDuplicate name, Bitrix24 business refusal or no folder returned |
Common refusals: Errors.