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

Update view setting

PATCH
/file/view
Auth: JWT Required
Update view settings for given folder. Only owner of the folder can update view settings.

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
uri
string 
required
URI of the target folder.
view
optional
View settings. Set value to null to clear existing view settings for target folder.
Any of
page_size
integer 
required
The number of items to display per page.
>= 50
order
string 
optional
The field to order the results by.
<= 255 characters
order_direction
enum<string> 
optional
The direction to order the results.
Allowed values:
ascdesc
view
enum<string> 
optional
The view mode for the explorer.
Allowed values:
listgridgallery
thumbnail
boolean 
optional
Whether to display thumbnails in grid view.
gallery_width
integer 
optional
The width of a single item in gallery view.
>= 50<= 500
columns
array[object (ListViewColumn) {3}] 
optional
The columns to display in the list view.
<= 1000 items
Example
{
    "uri": "cloudreve://my/Inspirations",
    "view": {
        "page_size": 50,
        "order": "updated_at",
        "order_direction": "desc",
        "view": "list",
        "thumbnail": true,
        "columns": [
            {
                "type": 0
            },
            {
                "type": 2
            },
            {
                "type": 8
            },
            {
                "type": 7
            }
        ],
        "gallery_width": 50
    }
}

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 '/file/view' \
--header 'Content-Type: application/json' \
--data-raw '{
    "uri": "cloudreve://my/Inspirations",
    "view": {
        "page_size": 50,
        "order": "updated_at",
        "order_direction": "desc",
        "view": "list",
        "thumbnail": true,
        "columns": [
            {
                "type": 0
            },
            {
                "type": 2
            },
            {
                "type": 8
            },
            {
                "type": 7
            }
        ],
        "gallery_width": 50
    }
}'

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": "anim adipisicing ullamco dolore et"
}
Modified at 2025-06-10 08:12:31
Previous
Mount storage policy
Next
Create share link
Built with