Skip to main content

Method

POST /v1/products/:id/media

Path Parameters

id
uuid
required
Product ID.

Body Parameters

At least one of url or assetId must be supplied (mediaCreateSchema).

Headers

Authorization
string
Bearer token (requires products:write).
content-type
string
application/json

Request Example

curl -X POST "https://api.voyantcloud.com/v1/products/prod_123/media" \
  -H "Authorization: Bearer $VOYANT_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "assetId": "asset_01HZY8SM9P8K4B8N7Q",
    "kind": "hero",
    "alt": "Resort exterior",
    "sort": 0
  }'

Response Example

{
  "data": {
    "id": "media_01J0E6V4ZBAVQ9PQJRT2P27QX0",
    "url": "https://cdn.voyantcloud.com/media/prod_123/hero.jpg",
    "kind": "hero",
    "alt": "Resort exterior",
    "sort": 0,
    "assetId": "asset_01HZY8SM9P8K4B8N7Q"
  }
}