Cloudreve API Docs
  1. Setting
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
        GET
      • List available nodes
        GET
      • Get preferences
        GET
      • Prepare enabling 2FA
        GET
      • Update preference setting
        PATCH
      • Update profile pricture
        PUT
    • Sign up
      POST
    • Send reset password email
      POST
    • Reset password via temp link
      PATCH
    • Get profile picture
      GET
    • Get user
      GET
    • List user's share links
      GET
    • Get storage capacity
      GET
    • Search user
      GET
    • List credit changes
      GET
    • List payments
      GET
  • Callback
    • Complete OneDrive upload
      GET
    • Complete COS upload
      GET
    • Complete S3 upload
      GET
    • Complete OBS upload
      GET
  • 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
    • List file activities
    • Get file info
    • Get thumbnail URL
    • Update file content
    • Create viewer session
    • Create file
    • Rename file
    • Move or copy files
    • Create download URL
    • Restore from trash bin
    • Delete file
    • Force unlock
    • Patch metadata
    • Mount storage policy
    • Update view setting
  • 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. Setting

Update preference setting

PATCH
/user/setting
Auth: JWT Required
Only non-null fields in request body will be updated.

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Body Params application/json
nick
string  | null 
optional
Display name.
>= 1 characters<= 255 characters
Example:
Aaron Liu
group_expires
boolean  | null 
optional
Set this to true to manually cancel membership before expiration. Only appliable to Pro edition.
language
string  | null 
optional
Preferred UI and Email language.
Example:
zh-CN
preferred_theme
string  | null 
optional
Set preferred theme color. Available options can be get from Get site settings.
Example:
#1976d2
version_retention_enabled
boolean  | null 
optional
Whether file version retention is enabled.
version_retention_ext
array[string] | null 
optional
List of file extensions enabling file version retention. For null or empty list, all extensions are enabled.
version_retention_max
integer  | null 
optional
Max preserved version. For value 0, all version will be preserved.
current_password
string  | null 
optional
Current user password, required for updating password.
new_password
string  | null 
optional
New password. If set, current_password is required.
>= 6 characters<= 128 characters
two_fa_enabled
boolean  | null 
optional
Whether 2FA is enabled.
two_fa_code
string  | null 
optional
Required if two_fa_enabled is not null.
If two_fa_enabled is true, this is the 6-digts code for the new 2FA secret.
If two_fa_enabledisfalse`, this is the 6-digts code for current enabled secret.
disable_view_sync
boolean  | null 
optional
Whether explorer view setting sync is disabled.
Example
{
    "nick": "Aaron Liu",
    "group_expires": true,
    "language": "zh-CN",
    "preferred_theme": "#1976d2",
    "version_retention_enabled": true,
    "version_retention_ext": [
        "string"
    ],
    "version_retention_max": 0,
    "current_password": "string",
    "new_password": "string",
    "two_fa_enabled": true,
    "two_fa_code": "string",
    "disable_view_sync": true
}

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 PATCH '/user/setting' \
--header 'Content-Type: application/json' \
--data-raw '{
    "nick": "Aaron Liu",
    "group_expires": true,
    "language": "zh-CN",
    "preferred_theme": "#1976d2",
    "version_retention_enabled": true,
    "version_retention_ext": [
        "string"
    ],
    "version_retention_max": 0,
    "current_password": "string",
    "new_password": "string",
    "two_fa_enabled": true,
    "two_fa_code": "string",
    "disable_view_sync": true
}'

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.
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-13 05:32:53
Previous
Prepare enabling 2FA
Next
Update profile pricture
Built with