Skip to main content
POST
/
folder_locks
cURL
curl -i -X POST "https://api.box.com/2.0/folder_locks" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "folder": {
         "type": "folder",
         "id": "33552487093"
       },
       "locked_operations": {
         "move": true,
         "delete": true
       }
     }'
{
  "folder": {
    "id": "12345",
    "type": "folder",
    "etag": "1",
    "sequence_id": "3",
    "name": "Contracts"
  },
  "id": "12345678",
  "type": "folder_lock",
  "created_by": {
    "id": "11446498",
    "type": "user"
  },
  "created_at": "2020-09-14T23:12:53Z",
  "locked_operations": {
    "move": true,
    "delete": true
  },
  "lock_type": "freeze"
}
This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.Learn more about Box SDK versioning strategy.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
folder
object
required

The folder to apply the lock to.

locked_operations
object

The operations to lock for the folder. If locked_operations is included in the request, both move and delete must also be included and both set to true.

Response

Returns the instance of the folder lock that was applied to the folder, including the user that applied the lock and the operations set.

Folder locks define access restrictions placed by folder owners to prevent specific folders from being moved or deleted.

folder
Folder (Mini) · object

The folder that the lock applies to.

id
string

The unique identifier for this folder lock.

Example:

"12345678"

type
string

The object type, always folder_lock.

Example:

"folder_lock"

created_by
User (Base) · object

The user or group that created the lock.

created_at
string<date-time>

When the folder lock object was created.

Example:

"2020-09-14T23:12:53Z"

locked_operations
object

The operations that have been locked. Currently the move and delete operations cannot be locked separately, and both need to be set to true.

lock_type
string

The lock type, always freeze.

Example:

"freeze"