Shared files (custom)
Overview
Provides access to a shared exchange directory for arbitrary media files.
The directory is located in the category of automatically synchronized directories :SYNC.
The composition of used files is arbitrary. Initially empty.
Available only in the master domain.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Uploading a group of files
Upload to the collection is performed with Content-Type: multipart/formdata.
The request may contain one or several files.
Files are placed under the names specified in the Content-Disposition headers of each part.
If a file with the specified name already exists, it is not saved and an error is returned. Depending on the Content-Type and the presence of successfully placed files, either a failed HTTP response or failure information in the body of a 200 OK HTTP response may be returned.
Request
POST /rest/v1/fs/targets/custom HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e
-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="filename"; filename="sample.mp3"
Content-Transfer-Encoding: binary
BINARY BODY OF 'sample.mp3'
-----------boundary_69df8120352a996e--
Getting the list of files
Request
| Name | Type | Description |
|---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: name, size, last_modified. |
|
|
Offset in the list of files to output. |
|
|
Maximum number of files in the list. |
|
|
Sorting order of files in the list. |
|
|
When It is counted after applying the filter: with the |
GET /rest/v1/fs/targets/custom HTTP/1.1
Response
The time in the last_modified field is returned in UTC.
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"name": "Package.bin",
"size": 12268,
"last_modified": "2019-10-02 15:22:03"
},
{
"name": "F.zip",
"size": 8411,
"last_modified": "2019-10-02 15:22:05"
}
]
Downloading a file
Request
| Name | Type | Description |
|---|---|---|
|
|
Output type. Default
|
GET /rest/v1/fs/targets/custom/sample.mp3?attachment=true HTTP/1.1
Re-uploading an existing file
Replaces the file.
A single file is uploaded either with Content-Type: multipart/formdata
or with an arbitrary non-multipart Content-Type.
If the upload uses Content-Type: multipart/formdata,
only the first file is saved (the first part having a filename field in the
Content-Disposition header), and the file name itself is ignored.
The file name is always taken from the URL.
A request with Content-Type: application/octet-stream and zero body length creates an empty file.
A request without a body, without Content-Type, and without the X-Era-Source header is rejected with code 400:
the intent cannot be determined from such a request.
The PUT method has another meaning with a different request form: Move and rename a file.
Request
PUT /rest/v1/fs/targets/custom/sample.mp3 HTTP/1.1
Content-Type: application/octet-stream
BINARY BODY OF 'sample.mp3'
PUT /rest/v1/fs/targets/custom/sample.mp3 HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e
-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="sample.mp3"; filename="sample.mp3"
Content-Transfer-Encoding: binary
BINARY BODY OF 'sample.mp3'
-----------boundary_69df8120352a996e--
Getting file metadata
Returns file metadata, including the size in the Content-Length header.
Request
| Name | Type | Description |
|---|---|---|
|
|
Output type. Default
|
HEAD /rest/v1/fs/targets/custom/sample.mp3?attachment=true HTTP/1.1
Getting file metadata (METADATA)
Returns the file size and modification time in JSON format. Unlike the HEAD method,
the information comes in the response body and does not require parsing headers.
The method is non-standard and is accepted in two equivalent forms: by the method itself
(METADATA /rest/v1/fs/targets/custom/sample.mp3) and by POST on a path with the suffix
(POST /rest/v1/fs/targets/custom/sample.mp3!metadata). More — Non-standard methods in the path.
The request must not contain a body in either form: a request with a body is treated as a file upload.
Specifics
-
The time in the
mtimefield is returned in UTC in RFC 3339 format. -
The content checksum is returned only on a request with the
hasha=trueparameter. Without the parameter the file content is not read, so the request is cheap regardless of file size.
Request
| Name | Type | Description |
|---|---|---|
|
|
Add a content checksum to the response. Default Calculation requires reading the entire file, so for large files the parameter should be specified only when explicitly necessary. |
POST /rest/v1/fs/targets/custom/sample.mp3!metadata HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"size" : 3836,
"mtime" : "2026-07-01T16:47:31Z"
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"size" : 3836,
"mtime" : "2026-07-01T16:47:31Z",
"hasha" : "md5;9f86d081884c7d659a2feaa0c55ad015"
}
Move and rename a file
Moves or renames a file within a section without transferring its content.
Performed by PUT on the destination path with the X-Era-Source header and an empty body.
The header specifies the source path relative to the section root.
Section root operations
In addition to listing and uploading files, the section root supports two methods.
| Request | Action |
|---|---|
|
Section description and information about its root: supported operations, limits, number of top-level elements. |
|
Clearing the section: all contents are deleted, the section itself remains. The operation is recursive and requires key confirmation. |
The section cannot be deleted: DELETE on the root path always returns 405.
More: Metadata and Directory operations.