All Products
Search
Document Center

Drive and Photo Service:MoveFile

Last Updated:Mar 02, 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

body

object

No

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 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_mode

string

No

The method for handling a name conflict if a file with the same name exists in the destination directory. Valid values: `ignore`: Moves the file without renaming it. `auto_rename`: Automatically renames the file. By default, the current time is appended to the file name, such as `xxx_20060102_150405`. `refuse`: Does not move the file and returns information about the existing file. 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 ID of the asynchronous task.

If an empty string is returned, the move completed successfully.

If a non-empty string is returned, the move is processed asynchronously. Call GetAsyncTask and pass the asynchronous task ID to get information about the task.

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.