# File upload

This is new endpoint - older asynchronous endpoint has been only renamed
to "Batch files upload" in documentation, url and structure is unchanged

Please, do not use this endpoint for batch file upload!

Performs one file upload synchronously in same way as asynchronous files 
upload.


In the result's image section, there are successfully uploaded image
with current unique name and upload datetime.


See more about Files upload


In case of image upload, response tag is "image", any other file types has response key "file" as here:


IMAGE: JPG, PNG, GIF



{
    "data": {
        "image": {
            "name": "image.jpg",
            "created": "2025-03-31T20:28:55+0200"
        }
    },
    "errors": null
}


ANY OTHER FILE TYPE



{
    "data": {
        "file": {
            "name": "file.pdf",
            "created": "2025-03-31T20:28:55+0200"
        }
    },
    "errors": null
}



Current filesize limit is 2MB.

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

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (object, 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 201 fields (application/json):

  - `data` (object, required)

  - `data.image` (object)

  - `data.image.name` (string, required)
    filename of saved file, used for assign file in 'source*' parameters.

  - `data.image.created` (string,null)
    datetime when file was uploaded

  - `data.file` (object)

  - `data.file.name` (string, required)
    filename of saved file, used for assign file in 'source*' parameters.

  - `data.file.created` (string,null)
    datetime when file was uploaded

  - `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

## Response 404 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

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

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

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

## Response 422 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

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

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

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


