Cloudreve API Docs
  1. File
Cloudreve API Docs
  • Site
    • Ping
      GET
    • Get CAPTCHA
      GET
    • Get site settings
      GET
  • Session
    • Token
      • Password sign-in
      • Finish sign-in with 2FA
      • Refresh Token
      • Sign out
    • OpenID
      • Prepare OpenID sign-in
      • Finish OpenID sign-in
      • Unlink OpenID
    • Passkey
      • Prepare Passkey sign-in
      • Finish Passkey sign-in
    • Prepare login
      GET
  • User
    • Passkey
      • Prepare passkey registration
      • Finish passkey registration
      • Delete passkey
    • Setting
      • List available storage policies
      • List available nodes
      • Get preferences
      • Prepare enabling 2FA
      • Update preference setting
      • Update profile pricture
    • Sign up
    • Send reset password email
    • Reset password via temp link
    • Get profile picture
    • Get user
    • List user's share links
    • Get storage capacity
    • Search user
    • List credit changes
    • List payments
  • Callback
    • Complete OneDrive upload
    • Complete COS upload
    • Complete S3 upload
    • Complete OBS upload
  • Workflow
    • Remote Download
      • Create remote download
      • Select files to download
      • Cancel task
    • List tasks
    • Get task progress
    • Create archive
    • Extract archive
    • Relocate storage policy
    • Import external files
  • File
    • Permission
      • Set permission
      • Delete permission setting
    • Upload
      • Create upload session
      • Upload file chunk
      • Delete upload session
    • Pin
      • Pin to sidebar
      • Delete a pin
    • Version
      • Set file version
      • Delete file version
    • Direct Link
      • Create direct links
      • Delete direct link
    • List files
      GET
    • List file activities
      GET
    • Get file info
      GET
    • Get thumbnail URL
      GET
    • Update file content
      PUT
    • Create viewer session
      PUT
    • Create file
      POST
    • Rename file
      POST
    • Move or copy files
      POST
    • Create download URL
      POST
    • Restore from trash bin
      POST
    • Delete file
      DELETE
    • Force unlock
      DELETE
    • Patch metadata
      PATCH
    • Mount storage policy
      PATCH
    • Update view setting
      PATCH
  • Share
    • Create share link
    • Edit share link
    • Get share link info
    • List my share links
    • Delete share link
  • VAS
    • Payment
      • Create a payment
      • Get payment status
    • GiftCode
      • Check gift code
      • Redeem gift code
  • Group
    • List groups
  • WebDAV
    • List accounts
    • Create account
    • Update account
    • Delete account
  1. File

Force unlock

DELETE
/file/lock
Auth: None
If a file is locked by other user/application, file mutation might fail with errors like below:
{
    "code": 40073,
    "data": [
        {
            "path": "cloudreve://my/newdfox.docx",
            "token": "cool-lock0a4b4f68",
            "owner": {
                "owner": "bnUn",
                "application": {
                    "type": "viewer",
                    "viewer_id": "af01b85b-f57d-46d2-8ad6-1d9b96548e78"
                }
            },
            "type": 0
        }
    ],
    "msg": "Lock conflict",
    "error": "conflict with locked resource: \"cloudreve://my/newdfox.docx\"",
    "correlation_id": "64210cda-5bd1-4fe1-9102-77b86f768395"
}
The lock token cool-lock0a4b4f68 in above example is only visable to file owners. This method can be used to force unlock files if the file owners wish to do so.

Request

Body Params application/json
tokens
array[string]
required
List of lock tokens, can be retrieved in lock conflict error response.
Example
{
    "tokens": [
        "string"
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request DELETE '/file/lock' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tokens": [
        "string"
    ]
}'

Responses

🟢200Success
application/json
Body
code
integer 
required
Response code.
0 - Success.
Default:
0
Example:
0
msg
string 
optional
Human readable error message (if any).
error
string  | null 
optional
Internal error message, only visable in debug mode.
aggregated_error
object  | null 
optional
Map of multiple error in batch request. The key is the failed resource ID, it could be a file URI or a resource ID, the value is a Response.
Additional properties
object (Response) 
optional
correlation_id
string <uuid> | null 
optional
Correlation ID of the request. Only presented on failed reqeust.
Example:
b4351ecc-ee1a-4455-bc94-2c3dbcc58538
Example
{
    "code": 0,
    "msg": ""
}
Modified at 2025-06-10 04:09:33
Previous
Delete file
Next
Patch metadata
Built with