Media

Start an image upload

Returns a signed upload: POST the file to `uploadUrl` with `uploadFields`, then set `mediaKey` on the product or variant. PNG, JPEG or WebP, at most 10 MiB.

Authorization

bearer catalogue:write
AuthorizationBearer <token>

A v1 API key; the scope named is the one the route needs.

In: header

Scope: catalogue:write

Header Parameters

Idempotency-Key?string

Names the act so a retry under it lands on the stored answer (idempotency-key).

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

POST
/v1/media-uploads
curl -X POST "https://example.com/v1/media-uploads" \  -H "Content-Type: application/json" \  -d '{    "target": "product",    "targetId": "cbca1126-180e-4334-9df8-cf82289d378b",    "slot": "cover",    "contentType": "string",    "byteSize": 1  }'
{  "uploadUrl": "http://example.com",  "uploadFields": {    "property1": "string",    "property2": "string"  },  "mediaKey": "string",  "expiresAt": "2019-08-24T14:15:22Z"}