- Site
- Session
- User
- Callback
- Workflow
- File
- Permission
- Upload
- Pin
- Version
- Direct Link
- List filesGET
- List file activitiesGET
- Get file infoGET
- Get thumbnail URLGET
- Update file contentPUT
- Create viewer sessionPUT
- Create filePOST
- Rename filePOST
- Move or copy filesPOST
- Create download URLPOST
- Restore from trash binPOST
- Delete fileDELETE
- Force unlockDELETE
- Patch metadataPATCH
- Mount storage policyPATCH
- Update view settingPATCH
- Share
- VAS
- Group
- WebDAV
Create file
POST
/file/create
Auth: JWT Optional
uri
, they will be created automatically.Request
Authorization
Add the parameter
Authorization
to Headers,whose value is to concatenate the Token after the Bearer.Example:
Authorization: Bearer ********************
Header Params
X-Cr-Purchase-Ticket
string
optional
Example:
1f63aa26-edc0-40ce-950a-cb4d4323158e
Body Params application/json
type
enum<string>
required
Allowed values:
filefolder
metadata
object | null
optional
Additional properties
string
optional
err_on_conflict
string
optional
uri
:true
, an error will be returned;false
, no mutation is performed, the existing file in uri
will be returned.Examples
{
"type": "file",
"uri": "cloudreve://my/Inspirations/new.txt",
"err_on_conflict": 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
curl --location --request POST '/file/create' \
--header 'X-Cr-Purchase-Ticket: 1f63aa26-edc0-40ce-950a-cb4d4323158e' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "file",
"uri": "cloudreve://my/Inspirations/new.txt",
"err_on_conflict": true
}'
Responses
🟢200Success
application/json
Body
data
object
required
type
enum<integer>
required
Allowed values:
01
id
string
required
name
string
required
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
null
, all permissions are granted.Permission definition can be found at File Permissions
created_at
string <date-time>
required
Example:
2025-05-24T10:55:22+08:00
updated_at
string <date-time>
required
Example:
2025-05-24T10:55:22+08:00
size
integer
required
Example:
7536
path
string
required
Example:
cloudreve://my/%E9%97%A8%E7%A5%A8/btn_google_signin_dark_normal_web%402x.png
owned
boolean
required
primary_entity
string | null
optional
code
integer
required
0
- Success.Default:
0
Example:
0
msg
string
optional
error
string | null
optional
correlation_id
string <uuid> | null
optional
Example:
b4351ecc-ee1a-4455-bc94-2c3dbcc58538
Example
{
"code": 0,
"data": {
"type": 1,
"id": "d08Wy1Hx",
"name": "Q3",
"permission": null,
"created_at": "2025-05-24T14:24:27+08:00",
"updated_at": "2025-05-24T14:24:27+08:00",
"size": 0,
"metadata": null,
"path": "cloudreve://my/Inspirations/Q3",
"capability": "39/9",
"owned": true,
"primary_entity": "zOie"
},
"msg": ""
}
Modified at 2025-06-27 03:16:08