Add the power of the Box AI API to your custom apps at Content Cloud Summit on May 15

Learn more and register!

Create folder lock


Creates a folder lock on a folder, preventing it from being moved and/or deleted.

You must be authenticated as the owner or co-owner of the folder to use this endpoint.



Request Body

objectin body

The folder to apply the lock to.

stringin bodyrequired

The ID of the folder.

stringin bodyrequired

The content type the lock is being applied to. Only folder is supported.

objectin body

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.

booleanin bodyoptional

Whether deleting the folder should be locked.

booleanin bodyoptional

Whether moving the folder should be locked.


application/jsonFolder Lock

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

application/jsonClient error

Returns an error when the request body is not valid.

  • schema_validation_failed - The request body contains a value for a field that either does not exist, or for which the value or type does not match the expected field type. An example might be an unknown option for an enum or multiSelect field.
application/jsonClient error

Returns an error when the folder was not found.

  • not_found - The folder could not be found, the user does not have access to the folder, or the user making call is not an owner or co-owner of folder.
application/jsonClient error

An unexpected client error.

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

Request Example

curl -i -X POST "" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "folder": {
         "type": "folder",
         "id": "33552487093"
       "locked_operations": {
         "move": true,
         "delete": true
client.folders.createLock(folderId: "22222") { (result: Result<FolderLock, BoxSDKError>) in
    guard case let .success(folderLock) = result else {
        print("Error creating folder lock")

    print("Created folder lock with id \"\(\" inside of folder with id \"\(folderLock.folder?.id)\"")
TypeScript (Beta)
await client.folderLocks.createFolderLock({
  folder: {
    type: 'folder',
  } satisfies CreateFolderLockRequestBodyFolderField,
  lockedOperations: {
    move: true,
    delete: true,
  } satisfies CreateFolderLockRequestBodyLockedOperationsField,
} satisfies CreateFolderLockRequestBody);
Python (Beta)
client.folder_locks.create_folder_lock(CreateFolderLockFolder(, type='folder'), locked_operations=CreateFolderLockLockedOperations(move=True, delete=True))
.NET (Beta)
await client.FolderLocks.CreateFolderLockAsync(requestBody: new CreateFolderLockRequestBody(folder: new CreateFolderLockRequestBodyFolderField(id: folder.Id, type: "folder"), lockedOperations: new CreateFolderLockRequestBodyLockedOperationsField(move: true, delete: true)));

Response Example

  "id": "12345678",
  "type": "folder_lock",
  "created_at": "2020-09-14T23:12:53Z",
  "created_by": {
    "id": "11446498",
    "type": "user"
  "folder": {
    "id": "12345",
    "type": "folder",
    "etag": "1",
    "name": "Contracts",
    "sequence_id": "3"
  "lock_type": "freeze",
  "locked_operations": {
    "delete": true,
    "move": true