Cloudreve API Docs
4.0.0
  • 4.0.0
  • dev
  1. Token
Cloudreve API Docs
4.0.0
  • 4.0.0
  • dev
  • Site
    • WebDAV
    • Ping
      GET
    • Get CAPTCHA
      GET
    • Get site settings
      GET
  • Session
    • Token
      • Password sign-in
        POST
      • Finish sign-in with 2FA
        POST
      • Refresh Token
        POST
      • Sign out
        DELETE
    • 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
      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
    • List files
    • List file activities
    • Get file info
    • Get thumbnail URL
    • Update file content
    • Create viewer session
    • Create direct links
    • 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. Token

Password sign-in

POST
http://localhost:5212/api/v4/session/token
Auth: None

Request

Body Params application/json
captcha
string  | null 
optional
User input value of the graphical CAPTCHA. Required if graphic CAPTCHA enabled for current action.
Example:
z3ds
ticket
string  | null 
optional
Ticket/Token of the CAPTCHA. Required if CAPTCHA is enabled for current action. Can be obtained from Get CAPTCHA.
Example:
4qXv7KmbYajJ0yFDKcmJ
email
string 
required
Email of the desired user.
Example:
user@cloudreve.org
password
string 
required
Password of the desired user.
Example:
P@ssw0rd
Example
{
    "captcha": "z3ds",
    "ticket": "4qXv7KmbYajJ0yFDKcmJ",
    "email": "user@cloudreve.org",
    "password": "P@ssw0rd"
}

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 POST 'http://localhost:5212/api/v4/session/token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "captcha": "z3ds",
    "ticket": "4qXv7KmbYajJ0yFDKcmJ",
    "email": "user@cloudreve.org",
    "password": "P@ssw0rd"
}'

Responses

🟢200Success
application/json
Body
data
#/definitions/176052892
required
Response content
Could not resolve '#/definitions/176052892'
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,
    "data": {
        "user": {
            "id": "lpua",
            "email": "admin@cloudreve.org",
            "nickname": "Aaron Liu2",
            "status": "active",
            "avatar": "file",
            "created_at": "2023-08-06T19:21:59+08:00",
            "credit": 23000,
            "group": {
                "id": "z4u4",
                "name": "管理员",
                "permission": "/f8B",
                "direct_link_batch_size": 999,
                "trash_retention": 604800
            },
            "pined": [
                {
                    "uri": "cloudreve://my/1"
                },
                {
                    "uri": "cloudreve://my/1/2"
                },
                {
                    "uri": "cloudreve://my/1/2/3/soft-delete"
                },
                {
                    "uri": "cloudreve://my/0/1/2/3/4/5/6/7/8/9/Q3%E5%A4%B4%E8%84%91%E9%A3%8E%E6%9A%B4"
                },
                {
                    "uri": "cloudreve://bnUn@my"
                }
            ],
            "language": "en-US"
        },
        "token": {
            "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwic3ViIjoibHB1YSIsImV4cCI6MTc0NTY1NTU3OCwibmJmIjoxNzQ1NjUxOTc4fQ.L1ETHHBNImNevze00QAgrrY1maZO2nefyIwdT4cb68c",
            "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsInN1YiI6ImxwdWEiLCJleHAiOjE3NjEyMDM5NzgsIm5iZiI6MTc0NTY1MTk3OCwic3RhdGVfaGFzaCI6Ikk1OCtSbmsrTHVpTkxBbjBqek9KNG45OUorV3hqL0pzbjJoRVYrUXBhelE9In0.Q2s75zxPVA3bzZyIIBau3TBvqSxIdzbiEmK1zCd-_zk",
            "access_expires": "2025-04-26T16:19:38.833494+08:00",
            "refresh_expires": "2025-10-23T15:19:38.833495+08:00"
        }
    },
    "msg": ""
}
🟢2002FA required
Modified at 2025-04-26 08:48:29
Previous
Get site settings
Next
Finish sign-in with 2FA
Built with