Cloudreve API Docs
  1. Workflow
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
      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
    • Complete COS upload
    • Complete S3 upload
    • Complete OBS upload
  • Workflow
    • Remote Download
      • Create remote download
      • Select files to download
      • Cancel task
    • List tasks
      GET
    • Get task progress
      GET
    • Create archive
      POST
    • Extract archive
      POST
    • Relocate storage policy
      POST
    • Import external files
      POST
  • 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. Workflow

Import external files

POST
/workflow/import
Auth: JWT Required
Create a task to import external physical files to given path of a given user. This method is restricted to users with admin permission only.

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
src
string 
required
Path of the folder to be imported in external storage provider.
dst
string 
required
Path of the folder to store imported files in user's my filesystem.
Example:
/imported
extract_media_meta
boolean 
optional
Whether to extract media metadata right after a file is imported.
user_id
string 
required
ID of the user that files are imported to.
recursive
boolean 
optional
Whether to recursively import child folders.
policy_id
integer 
required
ID of the storage policy which have to be imported files.
Example
{
    "src": "/path/to/existing",
    "dst": "/",
    "extract_media_meta": false,
    "user_id": "lpua",
    "recursive": true,
    "policy_id": 1
}

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 '/workflow/import' \
--header 'Content-Type: application/json' \
--data-raw '{
    "src": "/path/to/existing",
    "dst": "/",
    "extract_media_meta": false,
    "user_id": "lpua",
    "recursive": true,
    "policy_id": 1
}'

Responses

🟢200Success
application/json
Body
data
object (TaskResponse) 
required
created_at
string <date-time>
required
Example:
2025-04-22T17:13:06+08:00
updated_at
string <date-time>
required
Example:
2025-04-22T17:13:06+08:00
id
string 
required
ID of the tasks.
Example:
LO5GtW
status
enum<string> 
required
Status of the task
Allowed values:
queuedprocessingsuspendingerrorcanceledcompleted
Example:
completed
type
enum<string> 
required
Allowed values:
media_metaentity_recycle_routineexplicit_entity_recycleupload_sentinel_checkcreate_archiveextract_archiverelocateremote_downloadimport
Example:
extract_archive
summary
object  | null 
optional
duration
integer  | null 
optional
Tasl executed duration in milliseconds.
Example:
1908
resume_time
integer  | null 
optional
Time stamp of the next expected resume time for suspended task.
Example:
1745313204
error
string  | null 
optional
Error message (if any).
error_history
array[string] | null 
optional
List of error messages in previous retries (if any).
retry_count
integer  | null 
optional
Retry count.
node
object (Node) 
required
Node of which this tasks is distributed onto.
code
integer 
required
Response code.
0 - Success.
Default:
0
Example:
0
msg
string 
optional
Human readable error message (if any).
Example
{
    "code": 0,
    "data": {
        "created_at": "2025-05-20T13:07:23.952911+08:00",
        "updated_at": "2025-05-20T13:07:23.952911+08:00",
        "id": "D8wbcA",
        "status": "queued",
        "type": "import",
        "summary": {
            "props": {
                "dst": "cloudreve://lpua@my/%2F",
                "dst_policy_id": "J7uV",
                "failed": 0,
                "src_str": "/not/exist"
            }
        }
    },
    "msg": ""
}
Modified at 2025-06-27 03:13:29
Previous
Relocate storage policy
Next
Set permission
Built with