# `catalog.product.setMedia` Wholesale-replace a product's media list (order = array order; alt is per-usage). - **scope**: `catalog:write` - **storefront-visible** (bumps the catalog generation): yes - **destructive**: no ## Payload | field | type | required | notes | |---|---|---|---| | `productId` | string (/^prd_[a-zA-Z0-9]{1,32}$/) | yes | | | `media` | array (≤20) | yes | | ### JSON Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "productId": { "type": "string", "pattern": "^prd_[a-zA-Z0-9]{1,32}$" }, "media": { "maxItems": 20, "type": "array", "items": { "type": "object", "properties": { "mediaId": { "type": "string", "pattern": "^med_[a-zA-Z0-9]{1,32}$" }, "alt": { "type": "string", "maxLength": 200 } }, "required": [ "mediaId", "alt" ], "additionalProperties": false } } }, "required": [ "productId", "media" ], "additionalProperties": false } ```