Move or rename a file
POST/api/v1/storage/move-file
Moves or renames a stored file while preserving its identity.
The following access conditions are preserved as declared intent and are not implemented by generated code: Accepted storage owner context, Storage owner actor routing.
Use this in a guide: Build a searchable document library
Request
Responses
- 200
File moved
Move an existing file to the archive folder and rename it.
Section ID: DOC-CP-files-data-api-moveFile#example-storage-moveFile-request
Request example
{
"fileId": "0123456789abcdef0123456789abcdef",
"destinationFolder": "archive",
"newName": "welcome-archived.txt"
}
Guide request for Archive a completed document. Replace example resource identifiers with your own authorized values.
Section ID: DOC-CP-files-data-api-moveFile#example-cookbook-core-platform-files-data-managing-05-request
Request example
{
"fileId": "a1b2c3d4e5f60718293a4b5c6d7e8f90",
"destinationFolder": "/archive",
"newName": "notes-2025-q1.txt"
}
Illustrative response shape; omitted default fields and actual outcomes depend on the operation.
Section ID: DOC-CP-files-data-api-moveFile#example-storage-moveFile-response
Response example
{
"file": {
"fileId": "example_123",
"name": "example",
"path": "documents/example.txt",
"folderPath": "documents/example.txt",
"sizeBytes": "1",
"contentType": "Example text",
"uploadedAt": "example",
"modifiedAt": "example",
"metadata": {},
"tags": [
"example"
],
"description": "example",
"storageRef": {
"bucket": "example",
"key": "example_123",
"provider": "STORAGE_PROVIDER_GCS"
},
"checksum": "example",
"version": 1
},
"moved": true
}
Document ID: DOC-CP-files-data-api-moveFile. Section identities and revisions.
| Section | Stable reference |
|---|---|
| Move or rename a file | DOC-CP-files-data-api-moveFile#overview |
| Request | DOC-CP-files-data-api-moveFile#request |
| Responses | DOC-CP-files-data-api-moveFile#responses |