All Products
Search
Document Center

Drive and Photo Service:MoveFile

Last Updated:Aug 04, 2025

Moves files or folders.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/file/move HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

drive_idstringYes

The drive ID.

1
file_idstringYes

The file ID.

9520943DC264
to_parent_file_idstringYes

The ID of the destination parent directory to which you want to move a file or folder. If you want to move a file or folder to the root directory, set this parameter to root.

6520943DC261
check_name_modestringNo

The processing method that is used if the file that you want to move has the same name as an existing file in the destination directory. Valid values:

ignore: allows you to move the file by using the same name as an existing file in the destination directory.

auto_rename: automatically renames the file that has the same name exists in the destination directory. By default, the current point in time is added to the end of the file name. Example: xxx_20060102_150405.

refuse: does not move the file that you want to move but returns the information about the file that has the same name in the destination directory.

Default value: ignore.

ignore

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

domain_idstring

The domain ID.

bj1
drive_idstring

The drive ID.

1
file_idstring

The file ID.

fileid1
async_task_idstring

The ID of the asynchronous task.

If an empty string is returned, the file is moved.

If a non-empty string is returned, an asynchronous task is required. You can call the GetAsyncTask operation to obtain the information about an asynchronous task based on the task ID.

23ebd1a24dba4166b1527add476ef2866051b4d5del106
existboolean

Indicates whether the file already exists in the destination directory.

false

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.