# Replace a product's size map

```http
PUT /v1/products/{product}/size_map
```

Source: https://docs.tryyoursize.com/api/reference/operations/savecatalogsizemap/

**Key scopes:** `products:write`. A secret key (`sk_`) has every scope; a restricted key (`rk_`) needs the scopes listed.

Recommendations are returned in your labels through this map ("M" → "Medium"). Publishing needs every shop size mapped.

## Authentication

Secret key (`sk_…`) or restricted key (`rk_…`) from your server: `Authorization: Bearer sk_…`.

## Parameters

- `product` (path, `string`, required): The product: its TryYourSize ID (UUID) or the brand's SKU / style ID (`external_id`). An ID is looked up first.

## Request body

`application/json`: `ProductSizeMap`

Studio size label → the shop's variant option value ("M" → "Medium"). Must cover every variant to publish.

- `entries` (`object[]`, required)
  - `studio_size` (`string`, required)
  - `shop_value` (`string`, required)
- `unmapped_shop_values` (`string[]`, optional): Variant size values of the product with no Studio size yet (read only).

## Responses

### 200

OK (`ProductSizeMap`)

- `entries` (`object[]`, required)
  - `studio_size` (`string`, required)
  - `shop_value` (`string`, required)
- `unmapped_shop_values` (`string[]`, optional): Variant size values of the product with no Studio size yet (read only).

### 400

Invalid request (`Error`)

### 401

Missing or invalid credentials (`Error`)

### 403

Not allowed (`Error`)

### 404

Not found (`Error`)

### 422

Values to fix (each issue points at the field, size and POM) (`GarmentRejected`)

## Example

```bash
curl -X PUT https://api.tryyoursize.com/v1/products/<product>/size_map \
  -H "Authorization: Bearer $TRYYOURSIZE_SECRET_KEY" \
  -H "TYS-Version: 2026-10-25" \
  -H "Content-Type: application/json" \
  -d @body.json
```

## In the SDKs

- Node.js: [`tys.products.sizeMap.save()`](https://docs.tryyoursize.com/reference/node/products-size-map-save.md)
- Python: [`tys.products.size_map.save()`](https://docs.tryyoursize.com/reference/python/products-size-map-save.md)
