All Products
Search
Document Center

Drive and Photo Service:MoveFile

Last Updated:Jul 20, 2026

Moves a file or folder.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /v2/file/move HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

domain_id

string

Yes

body

object

No

The request body parameters.

drive_id

string

Yes

The drive ID.

1

file_id

string

Yes

The file ID.

9520943DC264

to_parent_file_id

string

Yes

The ID of the destination parent folder. Set this parameter to root if you want to move the file or folder to the root directory.

6520943DC261

check_name_mode

string

No

The processing mode for files with the same name. Valid values:

ignore: allows files with the same name.

auto_rename: automatically renames the file in the cloud when a file with the same name is found. By default, the current timestamp is appended, such as xxx_20060102_150405.

refuse: rejects the creation of a new file when a file with the same name already exists in the cloud, and returns the details of the existing file to the client.

Default value: ignore.

ignore

Response elements

Element

Type

Description

Example

object

Schema of Response

domain_id

string

The domain ID.

bj1

drive_id

string

The drive ID.

1

file_id

string

The file ID.

fileid1

async_task_id

string

The asynchronous task ID.

If an empty string is returned, the file or folder is moved directly.

If a non-empty string is returned, the move requires asynchronous processing. Call GetAsyncTask and pass the asynchronous task ID to retrieve the task information.

23ebd1a24dba4166b1527add476ef2866051b4d5del106

exist

boolean

Indicates whether the file already exists.

false

revision_id

string

file_name

string

updated_at

string

Examples

Success response

JSON format

{
  "domain_id": "bj1",
  "drive_id": "1",
  "file_id": "fileid1",
  "async_task_id": "23ebd1a24dba4166b1527add476ef2866051b4d5del106",
  "exist": false,
  "revision_id": "",
  "file_name": "",
  "updated_at": ""
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.