Bulk Restore Files
## Bulk Restore Files
Restores multiple files from **trash** in a single request.
**Method:** `POST`
**URL:** `{{base_url}}/files/bulk-restore`
---
## Authentication
This endpoint requires authentication.
- **Recommended:** Bearer token in the `Authorization` header:
```http
Authorization: Bearer {{access_token}}
```
Notes:
- If your collection/folder already sets auth, this request can **inherit auth**.
- Ensure `{{access_token}}` is a valid, non-expired token.
---
## Headers
| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer {{access_token}}` |
---
## Required variables
Set these variables at the **environment** or **collection** level:
| Variable | Required | Description |
| --- | --- | --- |
| `base_url` | Yes | Base API URL (e.g. `https://app.getgabs.com/partners/wp-gallery/manage`) |
| `access_token` | Yes | Access token used to authorize the request |
---
## Body (raw JSON)
Send the request body as **raw JSON**.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `file_ids` | array | Yes | Array of file IDs to restore from trash |
Example body:
```json
{
"file_ids": [
37
]
}
```
Notes:
- You can include **one or multiple file IDs** in the array.
- All specified files will be **restored from trash**.
---
## Sample request
```bash
curl --request POST "{{base_url}}/files/bulk-restore" \
--header "Authorization: Bearer {{access_token}}" \
--header "Content-Type: application/json" \
--data '{
"file_ids": [37]
}'
```
---
## Sample success response
A successful request typically returns **HTTP 200 OK**.
```json
{
"success": true,
"message": "1 file(s) restored"
}
```
---
## Common errors
- **400 Bad Request**
- Missing `file_ids`
- Invalid file ID format
- **401 Unauthorized / 403 Forbidden**
- Missing/invalid `Authorization` header
- Expired `{{access_token}}`
- **404 Not Found**
- One or more files do not exist
- Files are not in trash
---
## Notes
- This endpoint restores **multiple soft-deleted files** in a single request.
- All files must currently exist in **trash** to be restored.
- Restored files will return to their **original folders**.
- Useful for **bulk recovery operations in file manager interfaces**.
```
Request
This endpoint expects an object.
file_ids
Response
OK
message
success
