Box Developer Documentation
 
    Latest version

    Delete folder

    delete
    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.

    Deletes a folder, either permanently or by moving it to the trash.

    Request

    bearer [ACCESS_TOKEN]
    application/json

    Request Headers

    stringin headeroptional
    1

    Ensures this item hasn't recently changed before making changes.

    Pass in the item's last observed etag value into this header and the endpoint will fail with a 412 Precondition Failed if it has changed since.

    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

    booleanin queryoptional
    true

    Delete a folder that is not empty by recursively deleting the folder and all of its content.

    Response

    none

    Returns an empty response when the folder is successfully deleted or moved to the trash.

    application/jsonClient error

    Returns an error if the user makes a bad request.

    • folder_not_empty: Returned if the folder is not empty. Use the recursive query parameter to recursively delete the folder and its contents.
    application/jsonClient error

    Returns an error if the user does not have the required access to perform the action.

    • access_denied_insufficient_permissions: Returned when the user does not have access to the folder, or when a folder lock has been applied to the folder to prevent deletion.

    • insufficient_scope: Returned an error if the application does not have the right scope to delete folders. Make sure your application has been configured to read and write all files and folders stored in Box.

    application/jsonClient error

    Returns an error if the folder could not be found, or the authenticated user does not have access to the folder.

    • not_found when the authenticated user does not have access to the folder.
    application/jsonClient error
    • operation_blocked_temporary: Returned if the folder is locked due to another move, copy, delete or restore operation in progress.

      The operation can be retried at a later point.

    application/jsonClient error

    Returns an error when the If-Match header does not match the current etag value of the folder. This indicates that the folder has changed since it was last requested.

    application/jsonClient error

    Returns an error when the operation takes longer than 60 seconds. The operation will continue after this response has been returned.

    application/jsonClient error

    An unexpected client error.

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