لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/folders/restore.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Restore folder
POST /v1/folders/:id/restore
Restores a folder from the Bitrix24 trash together with everything deleted along with it. If the parent folder is also in the trash, the method restores it too, along with all folders above it.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionFolder ID. List: GET /v1/folders?parentId=X. Folders in the trash do not appear in the list — save the id before deleting |
No request body.
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/folders/10741/restore" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/folders/10741/restore" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/folders/10741/restore', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const body = await res.json()
if (!body.success) throw new Error(body.error.code)
console.log('Restored by this call:', body.meta.restored, 'name:', body.data.name)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/folders/10741/restore', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const body = await res.json()
if (!body.success) throw new Error(body.error.code)
console.log('Restored by this call:', body.meta.restored, 'name:', body.data.name)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata |
Typeobject | DescriptionThe folder after the call. For all fields, see Folder fields |
Fielddata.name |
Typestring | DescriptionCurrent folder name. If it changed during restoration, the previous name is returned in meta.renamedFrom |
Fielddata.deletedType |
Typenumber | DescriptionDeletion status: 0 — the folder is not in the trash |
Fielddata.deletedAt |
Typestring | null | DescriptionTime of the last deletion (ISO 8601). Restoration does not clear the field |
Fielddata.deletedBy |
Typenumber | null | DescriptionID of the user who deleted the folder. Restoration does not clear the field. List: GET /v1/users |
Fieldmeta.restored |
Typeboolean | Descriptiontrue — the folder was restored by this call. false — the folder was not in the trash, and the call changed nothing |
Fieldmeta.renamedFrom |
Typestring | null | DescriptionFolder name before restoration, if it changed because of a name collision. null — the name is unchanged |
Response example
{
"success": true,
"data": {
"id": 10741,
"name": "Reports",
"code": null,
"storageId": 1379,
"type": "folder",
"realObjectId": 10741,
"parentId": 10739,
"deletedType": 0,
"createdAt": "2026-10-15T18:25:16.000Z",
"updatedAt": "2026-10-15T18:27:36.000Z",
"deletedAt": "2026-10-15T18:27:34.000Z",
"createdBy": 1295,
"updatedBy": 1295,
"deletedBy": 1295,
"detailUrl": "https://<portal>.bitrix24.com/company/personal/user/1295/disk/path/Documents/Reports"
},
"meta": {
"restored": true,
"renamedFrom": null
}
}
Error response example
404 — the folder does not exist, including after permanent deletion:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Could not find entity with id '999999999'."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_ID |
Descriptionid is not a positive integer |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key's portal has no authorization tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the disk scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode, and restoration changes portal data |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe key owner has no permissions for the folder in Bitrix24 |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo folder with this id, including after permanent deletion |
| HTTP422 | CodeDISK_RESTORE_REFUSED |
DescriptionBitrix24 did not confirm the restoration. Re-read the folder via GET /v1/folders/:id |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 refused the restoration; the reason is in message |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRequest rate limit exceeded — wait 1-2 seconds and retry |
| HTTP502 | CodeDISK_OUTCOME_UNKNOWN |
DescriptionThe connection to Bitrix24 dropped after the restore request was sent. The outcome is unknown and the request was not retried — re-read the folder before calling the method again |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 was unavailable while the folder was being read; the restore request was not sent |
Full list of common API errors — Errors.
Known specifics
Sibling objects stay in the trash. If you restore a nested folder while its parent folder is in the trash, only that folder, its contents, and the folders above it come back. The rest of the parent folders' contents stays in the trash — restore it with separate calls.
Batch calls. Restoration is not available in POST /v1/batch — call it as a separate request.