Skip to main content

Upload file

GET 

/api/v2/upload

Returns a v4 signed post policy for uploading a file to our CDN.

Files uploaded via this endpoint are ephemeral and will be deleted after a minimum of 24 hours.

Once the file is uploaded you can use that url on supported endpoints, where it will be moved to a permanent location on our cdn and persisted until the associated entity is deleted.

For example, if you set the photo_url on a product to the temporary uploaded file, the file will be moved from _tmp/2kzd5fr9lu37d1j2 to products/bk8h0y2r68ke/photo_url/0?v=vd2a2.

Request

Query Parameters

    content_type stringrequired

    Possible values: [image/png, image/jpeg, image/gif, image/svg+xml, image/webp]

    Content type of the file you are planning to upload, this will be enforced as the content type of the file, even if the file is not actually of that type.

    Example: image/png

Responses

Schema

    url urirequired

    The root url of the bucket where the file will be uploaded.

    path stringrequired

    The path in the bucket where the file will be uploaded.

    Can be used to construct the public url of the file, by joining the url and the path.

    fields

    object

    required

    Form fields that must be included in the post request to upload the file.

    property name* string
Loading...