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
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.
Responses
- 200
- 400
- 401
- 403
- 404
- 422
- 500
- application/json
- Schema
- Example (from schema)
Schema
The root url of the bucket where the file will be uploaded.
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.
{
"url": "string",
"path": "string",
"fields": {
"field1": "value1",
"field2": "value2",
"field3": "value3"
}
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}
- application/json
- Schema
- Example (from schema)
Schema
Array [
Array [
]
]
HTTP status code
Error message
errors
object[]
required
Possible values: non-empty
Path to the property with the error
errors
object[]
required
Possible values: non-empty
Error type
Error message
{
"statusCode": 404,
"message": "Cannot find item",
"errors": [
{
"path": "business.id",
"errors": [
{
"type": "object_required_property",
"message": "Required property"
}
]
}
]
}
- application/json
- Schema
- Example (from schema)
Schema
HTTP status code
Error message
Error name
{
"statusCode": 404,
"message": "Cannot find item",
"error": "Not Found"
}