Move and rename a file
Overview
Moves or renames a file within one section without transferring its content. The operation is performed by the file system, so its cost does not depend on file size.
There is no separate method for this: PUT is used on the destination path with the X-Era-Source header and an empty body. The presence of the header distinguishes a move from an upload.
Moving directories is not supported.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
Moving a file
Specifics
-
The
X-Era-Sourceheader value is the source path relative to the section root, not a full URL. Escaping the section and..segments are rejected with code403. -
Source and destination belong to the same section. A file cannot be moved between sections in one request.
-
Missing destination path directories are created, and emptied source directories are deleted.
-
The destination path is created only after the source is checked: a failed move leaves no empty directories behind.
-
The request must not contain both a body and the
X-Era-Sourceheader: such a request is ambiguous and is rejected with code400.
Request
| Name | Type | Description |
|---|---|---|
|
|
Allow overwriting an occupied destination path. Default |
| Name | Description |
|---|---|
|
Source file path relative to the section root. |
PUT /rest/v1/fs/targets/files/inbox/report-2026.pdf HTTP/1.1
X-Era-Source: inbox/report.pdf
Content-Length: 0
PUT /rest/v1/fs/targets/files/archive/2026/report.pdf?overwrite=true HTTP/1.1
X-Era-Source: inbox/report.pdf
Content-Length: 0
Response
HTTP/1.1 204 No Content
| Code | Condition |
|---|---|
|
File moved. |
|
The request contains both a body and the |
|
The source path escapes the section. |
|
The source file does not exist. |
|
The destination path is occupied and the |