Restore item
Restore one or many file or folder from the trash.
Endpoint
http
POST /api/v1/trash/restoreParameters
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to_home | boolean | yes | If value is true, then move restored content to the home. |
items | array | yes | The array of items which has to be restored. |
items.*.type | string | yes | The type of the restoring item. Allowed types are folder or file |
items.*.id | uuid | yes | The id of the restoring item |
Request example
sh
curl --location --request POST 'https://files.ro/api/v1/trash/restore' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
"to_home": true,
"items": [
{
"type": "folder",
"id": "{item_id}"
}
]
}'Response
json
{
"type": "success",
"message": "The item was successfully restored."
}json
{
"type": "error",
"message": "You are not authorized"
}json
{
"message": "The given data was invalid.",
"errors": {
"field": [
"The field is required."
]
}
}