Skip to content

Restore file

Restore a file from the deleted state. Minor version will be incremented for restore operation.

The file will be restored to the original location if the request body is empty. If there is already active file in original location, deleted file can be restored to different location by specifying targetParentId. To restore the file in same location during conflict, specify different name for the resource through name attribute.

  • A file should be in soft deleted state. To know more about deleting a file refer here
  • Target parent folder should be created in case of conflict. To know more about creating a folder refer here
POST {baseUrl}/spaces/{spaceId}/files/{fileId}/restore

Restore file will be synchronously restored to the location.

  • HEADER:

    • Authorization: Bearer {tid token}

In case of conflict if user wants to restore the deleted file in different location with different name, user can provide those details.

POST {baseUrl}/spaces/{spaceId}/files/{fileId}/restore
  • HEADER:

    • Authorization: Bearer {tid token}
  • BODY:

    • name - name of file to be restored
    • targetParentId - target where the source file need to be restored
{
"name": "new_name",
"targetParentId": "6529d0b3-5856-41ab-88b3-86f7955cddf1"
}

To know more about the restore file API refer here.