Bulk file initialization from body IDs. This operation is necessary to complete generating multiple download links or uploading multiple files via a link.
Accepts data list for file creation. The data must include the file body ID, its name, and the ID of the directory where it will be saved.
Returns a list of structures containing the resulting file and a description of any error that occurred during the file’s initialization. The order of structures in the response corresponds to the order of files in the request.

Request

POST /pub/v1/disk/files

Request body

The resource sent in the request body is  Bulk file initialization — Request. It contains the following writable properties:

{
    "files": [
        {
            "comment": "string",
            "directory": "uuid",
            "hash": "uuid",
            "name": "string"
        }
    ]
}

Properties

Name Type Description Additional
files[] array

List of data to create files

Optional
files[].comment string

Comment to the file

Optional
files[].directory uuid

The directory the file will be stored in

files[].hash uuid

Storage ID of the file body

files[].name string

File name

Authorization

This request requires the use of one of following authorisation methods: API key

Response

The following HTTP status codes may be returned:

Status code Description Resource
200 OK

Model of the response for bulk file initialization.

Model of the response for bulk file initialization (Bulk file initialization)
422

Model of the response for bulk file initialization.

Model of the response for bulk file initialization (Bulk file initialization)