Skip to main content

Method

PATCH /v1/products/:id/media/order

Path Parameters

id
uuid
required
Product ID.

Body Parameters

Item shape

Headers

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

Request Example

curl -X PATCH "https://api.voyantcloud.com/v1/products/prod_123/media/order" \
  -H "Authorization: Bearer $VOYANT_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "items": [
      { "mediaId": "media_01J0E6V4ZBAVQ9PQJRT2P27QX0", "sort": 0 },
      { "mediaId": "media_01J0E6V4ZBAVQ9PQJRTR6K9HQC", "sort": 1 }
    ]
  }'

Response Example

{
  "data": {
    "updated": 2,
    "attempted": 2,
    "details": [
      {
        "mediaId": "media_01J0E6V4ZBAVQ9PQJRTR6K9HQC",
        "previousSort": 1,
        "newSort": 0
      }
    ]
  }
}
mediaOrderUpdateSchema requires at least one item; mixed mediaId and assetId entries are allowed to support pre-save ordering flows.