Skip to content

Restore item

Restore one or many file or folder from the trash.

Endpoint

http
POST /api/v1/trash/restore

Parameters

Body parameters

ParameterTypeRequiredDescription
to_homebooleanyesIf value is true, then move restored content to the home.
itemsarrayyesThe array of items which has to be restored.
items.*.typestringyesThe type of the restoring item. Allowed types are folder or file
items.*.iduuidyesThe 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."
    ]
  }
}