# Batch files upload

This endpoint has been only renamed from "File upload" after we created
new synchronous endpoint one file upload. Url and structure is unchanged

Performs file upload asynchronously.

Please note that order of files matter (result of job respects the order
of images in request).


In case of specifying filename, keep in mind that extension is checked
whether it respects file type.


The result can be found in job detail in resultUrl. The result is
formed as normal API response:




{
    "data": {
        "images":[
            {
                "index": 0,
                "md5": "072c1a2005e17dcd3a3cca3d2c769264",
                "name": "kocka.png",
                "created": "2023-01-16T13:19:32+0100",
                "sourceUrl": "https://example.com/image.png"
            }
        ]
    },
    "errors": [
        {
            "errorCode": "file-upload-size-limit",
            "message": "Uploaded file size limit exceeded. Limit is 2 MB.",
            "instance": "data[1]"
        }
    ]
}




In the result's images section, there are successfully uploaded images
with their info and with index field which is order of the image in
the request (0-based indexing).


In the result's errors section, there are errors which occurred during
some images upload and with number in brackets in data[0] in
instance, which is order of the image in the request (0-based
indexing).


See more about Files upload


See how [Asynchronous
requests](https://developers.shoptet.com/asynchronous-requests/) work on
our developer's portal.


Currently maximum of 50 files can be uploaded in one request. Current
filesize limit per file is 2MB.

Endpoint: POST /api/system/files
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (array, required)

  - `data.sourceUrl` (string, required)
    source URL of the image you want to upload.

  - `data.name` (string)
    desired filename for the file to be saved as. May be suffixed with number in case of duplication. Generated when not set.

## Response 202 fields (application/json):

  - `data` (object, required)

  - `data.jobId` (string, required)
    token of job

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced


