Box Developer Documentation
 
    Latest version

    Restore folder

    post
    https://api.box.com/2.0
    /folders/:folder_id

    This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

    Restores a folder that has been moved to the trash.

    An optional new parent ID can be provided to restore the folder to in case the original folder has been deleted.

    During this operation, part of the file tree will be locked, mainly the source folder and all of its descendants, as well as the destination folder.

    For the duration of the operation, no other move, copy, delete, or restore operation can performed on any of the locked folders.

    Request

    bearer [ACCESS_TOKEN]
    application/json

    Path Parameters

    stringin pathrequired
    12345

    The unique identifier that represent a folder.

    The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/folder/123 the folder_id is 123.

    The root folder of a Box account is always represented by the ID 0.

    Query Parameters

    string arrayin queryoptional
    id,type,name

    A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

    Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

    Request Body

    stringin bodyoptional
    "Restored Photos"

    An optional new name for the folder.

    objectin body

    Specifies an optional ID of a folder to restore the folder to when the original folder no longer exists.

    Please be aware that this ID will only be used if the original folder no longer exists. Use this ID to provide a fallback location to restore the folder to if the original location has been deleted.

    stringin bodyoptional
    "123"

    The ID of parent item

    Response

    Returns a folder object when the folder has been restored.

    application/jsonClient error

    Returns an error if the user does not have access to the folder the folder is being restored to, or the user does not have permission to restore folders from the trash.

    application/jsonClient error

    Returns an error if the folder is not in the trash.

    application/jsonClient error
    • Returned an error if there is a folder with the same name in the destination folder.

    • operation_blocked_temporary: Returned if either of the destination or source folders is locked due to another move, copy, delete or restore operation in process.

      The operation can be retried at a later point.

    application/jsonClient error

    An unexpected client error.

    post
    Restore folder
    You can now try out some of our APIs live, right here in the documentation.
    Log in

    Request Example

    Response Example

    {
      "id": "123456789",
      "type": "folder",
      "content_created_at": "2012-12-12T10:53:43-08:00",
      "content_modified_at": "2012-12-12T10:53:43-08:00",
      "created_at": "2012-12-12T10:53:43-08:00",
      "created_by": {
        "id": "11446498",
        "type": "user",
        "login": "ceo@example.com",
        "name": "Aaron Levie"
      },
      "description": "Legal contracts for the new ACME deal",
      "etag": "1",
      "folder_upload_email": "null",
      "item_status": "active",
      "modified_at": "2012-12-12T10:53:43-08:00",
      "modified_by": {
        "id": "11446498",
        "type": "user",
        "login": "ceo@example.com",
        "name": "Aaron Levie"
      },
      "name": "Contracts",
      "owned_by": {
        "id": "11446498",
        "type": "user",
        "login": "ceo@example.com",
        "name": "Aaron Levie"
      },
      "parent": {
        "id": "12345",
        "type": "folder",
        "etag": "1",
        "name": "Contracts",
        "sequence_id": "3"
      },
      "path_collection": {
        "entries": [
          {
            "etag": "1",
            "id": "12345",
            "type": "folder",
            "name": "Contracts",
            "sequence_id": "3"
          }
        ],
        "total_count": 1
      },
      "purged_at": "null",
      "sequence_id": "3",
      "shared_link": "null",
      "size": 629644,
      "trashed_at": "null"
    }