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

Get file info

GET
/file/info
Auth: JWT Optional
Get info of a given file by URI of file ID. Additional info is available if requested.

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Query Params
uri
string 
optional
URI of the target file. If it's empty, id is required.
Example:
cloudreve://my/file.txt
id
string 
optional
ID of the file. If it's empty, uri is required. Getting file info by ID is only available to the owner of the file or administrators.
Example:
98XDX8Sr
extended
boolean 
optional
Whether to get additional info about this file.
folder_summary
boolean 
optional
For folders, whether to calculate the size of this folder. The result might be cached.
Header Params
X-Cr-Purchase-Ticket
string 
optional
Can be used to authenticate to paid share links with a anonymous identity. The ticket value can be obtained after an anonymous user purchase a paid share link.
Example:
1f63aa26-edc0-40ce-950a-cb4d4323158e

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 GET '/file/info?uri=cloudreve://my/file.txt&id=98XDX8Sr&extended&folder_summary' \
--header 'X-Cr-Purchase-Ticket: 1f63aa26-edc0-40ce-950a-cb4d4323158e'

Responses

🟢200Success
application/json
Body
data
object (FileResponse) 
required
type
enum<integer> 
required
Type of this file.
Allowed values:
01
id
string 
required
ID of this file.
name
string 
required
Name of this file.
It might not be expected display name. For files under trash bin, this field is a non-readable UUID. The expected display name should be retrieved from metadata with name sys:restore_uri, which can be parsed as a URI.
Example:
btn_google_signin_dark_normal_web@2x.png
permission
string  | null 
optional
Boolset encoded permissions granted by current authenticated user. For null, all permissions are granted.
Permission definition can be found at File Permissions
created_at
string <date-time>
required
Datetime when the file is created.
Example:
2025-05-24T10:55:22+08:00
updated_at
string <date-time>
required
Datetime when the file is last updated.
Example:
2025-05-24T10:55:22+08:00
size
integer 
required
Size of the file, also the size of current primary version blob.
Example:
7536
metadata
object 
required
Key-value map of all metadata.
Some special metadata might affect the file's behavior, please refer to Metadata for details.
path
string 
required
URI of this file.
Example:
cloudreve://my/%E9%97%A8%E7%A5%A8/btn_google_signin_dark_normal_web%402x.png
shared
boolean 
optional
Whether this file has share links.
capability
string  | null 
optional
Boolset encoded set of capabilities supported.
Example:
39/9
owned
boolean 
required
Whether this file is owned by current authenticated user.
primary_entity
string  | null 
optional
ID of the primary version blob.
extended_info
optional
Extended info for this file, by default it's not presented.
folder_summary
optional
Statistics of this folder, by default it's not presented.
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
Examples
{
    "code": 0,
    "data": {
        "type": 0,
        "id": "98XDX8Sr",
        "name": "melk-abbey-library.jpg",
        "permission": null,
        "created_at": "2025-05-13T14:31:52+08:00",
        "updated_at": "2025-05-13T14:31:55+08:00",
        "size": 1682177,
        "metadata": {
            "exif:camera_make": "NIKON",
            "exif:camera_model": "E5700",
            "exif:des": "",
            "exif:exposure_bias": "0.000000",
            "exif:exposure_time": "1/7",
            "exif:f": "2.800000",
            "exif:flash": "0",
            "exif:focal_length": "35",
            "exif:iso": "100",
            "exif:orientation": "1",
            "exif:software": "E5700v1.1",
            "exif:taken_at": "2003-09-22T14:13:44Z",
            "exif:x": "2560",
            "exif:y": "1920"
        },
        "path": "cloudreve://my/Inspirations/test_folder/images/melk-abbey-library.jpg",
        "capability": "39/9AQ==",
        "owned": true,
        "primary_entity": "mxB6SM",
        "extended_info": {
            "storage_policy": {
                "id": "eVtl",
                "name": "OneDrive",
                "type": "onedrive",
                "max_size": 0
            },
            "storage_policy_inherited": false,
            "storage_used": 1682177,
            "entities": [
                {
                    "id": "mxB6SM",
                    "size": 1682177,
                    "type": 0,
                    "created_at": "2025-05-13T14:31:52+08:00",
                    "storage_policy": {
                        "id": "eVtl",
                        "name": "OneDrive",
                        "type": "onedrive",
                        "max_size": 0
                    },
                    "created_by": {
                        "id": "bnUn",
                        "nickname": "Luke Skywalker",
                        "avatar": "file",
                        "created_at": "2023-08-06T19:21:59+08:00"
                    }
                }
            ],
            "direct_links": [
                {
                    "id": "xMxIa",
                    "url": "http://localhost:5173/f/xMxIa/melk-abbey-library.jpg",
                    "downloaded": 0,
                    "created_at": "2025-06-26T17:55:30+08:00"
                }
            ]
        }
    },
    "msg": ""
}
Modified at 2025-06-27 02:54:32
Previous
List file activities
Next
Get thumbnail URL
Built with