v1

latestOpenAPI 3.0.32026-07-264469137.7 KB
Media

Upload a file

Upload a file and receive an upload_id. Pass this ID in the media array when creating or updating a product.

Files must be sent as multipart/form-data. Maximum size is 20 MB.

post/v1/utilities/uploads

Response

Upload created

upload_idstring
providerstring
file_namestring
mime_typestring
file_size_bytesinteger
urlstring nullable
linked_resource_typestring nullable

Resource type this upload is attached to, e.g. product.

linked_resource_idstring nullable

ID of the resource this upload is attached to.

created_atstring date-time
updated_atstring date-time

Example response

{
  "upload_id": "upl_4f3e2d1c",
  "provider": "s3",
  "file_name": "product-hero.png",
  "mime_type": "image/png",
  "file_size_bytes": 204800,
  "url": "https://cdn.bachs.io/uploads/upl_4f3e2d1c/product-hero.png"
}