# Replace a draft's content

```http
PUT /v1/garments/{garment_id}
```

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

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

Drafts may be incomplete but never hold impossible values. Published versions never change (409).

## Authentication

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

## Parameters

- `garment_id` (path, `string (uuid)`, required): A garment *version* (garment_versions.id). A fit group (garments table) is `fit_group_id`.

## Request body

`application/json`: `GarmentInput`

- `category` (`"tshirt" | "shirt" | "sweater" | "jacket" | "dress" | "skirt" | "jeans" | "trousers" | "shorts" | "leggings" | "polo" | "hoodie" | "footwear"`, required): The garment type; it sets which POMs are needed (`footwear` has a size chart instead).
- `fit_intent` (`"skinny" | "slim" | "regular" | "relaxed" | "oversized"`, required): The designer's intended silhouette; sets the ease targets the fit judgement compares against.
- `sizes` (`string[]`, required): Size labels, smallest to largest.
- `poms` (`POMTable`, required): Garment measurements per size: size label → POM code → millimetres. Widths are flat half-measurements. See GET /v1/studio/garment_dictionary for codes and plausible ranges.
- `grading` (`GradingRule`, optional): How the POM table was derived: the base size's values plus, per POM, the increment (mm) between each pair of consecutive sizes (len = number of sizes - 1). The table stays the source of truth.
  - `base_size` (`string`, required)
  - `increments_mm` (`object`, required)
- `fabric` (`Fabric`, required): What the tech pack / mill sheet says.
  - `name` (`string`, optional)
  - `construction` (`"jersey" | "rib" | "interlock" | "fleece" | "pique" | "plain_weave" | "twill" | "denim" | "satin" | "other"`, optional)
  - `composition` (`FiberShare[]`, required)
    - `fiber` (`"cotton" | "polyester" | "elastane" | "viscose" | "modal" | "lyocell" | "wool" | "linen" | "polyamide" | "silk" | "acrylic" | "other"`, required)
    - `pct` (`number (double)`, required)
  - `weight_gsm` (`number (double)`, optional): Areal density, g/m².
  - `stretch_warp_pct` (`number (double)`, optional): Stretch along the warp (lengthwise), percent.
  - `stretch_weft_pct` (`number (double)`, optional): Stretch along the weft (crosswise), percent.
  - `notes` (`string`, optional)
- `import_id` (`string (uuid)`, optional): Pattern import linked to this version (omit to unlink).
- `season` (`string`, optional, max length 40): Season tag, e.g. "SS27".
- `tolerances_mm` (`TolerancesMM`, optional): Spec-sheet tolerance per POM code, ± mm (e.g. {"chest_width": 10}). Optional; the flat preview uses ±5 mm when a POM has none.
- `spec_source` (`SpecSource`, optional): Where the POM table came from, kept for audit. Set by Studio's paste/import.
  - `kind` (`"manual" | "paste" | "xlsx" | "csv" | "pdf" | "workbook" | "clo" | "browzwear"`, required)
  - `filename` (`string`, optional, max length 255)
- `footwear` (`FootwearChart`, optional): A footwear version's size chart (category `footwear`). The version's `sizes` must be the chart's labels in the chart's `size_system`, in row order (fittings collapsed). Footwear has no POMs and no 3D fit check.
  - `shoe_type` (`"sneaker" | "dress" | "boot" | "sandal"`, required): Sets the room left in front of the toes that a size is chosen for.
  - `size_system` (`"eu" | "uk" | "us_men" | "us_women" | "mondopoint"`, required): A shoe size system: `eu` (Paris points), `uk`, `us_men`, `us_women`, or `mondopoint` (foot length in mm).
  - `basis` (`"foot_length" | "foot_length_max" | "last_length"`, required): What `length_mm` is: the foot length each size is made for (`foot_length`), the longest foot for the size (`foot_length_max`, "up to 25.5 cm"), or the shoe's inside (last) length (`last_length`).
  - `rows` (`FootwearChartRow[]`, required, max 120 items)
    - `labels` (`object`, required): The size's label in each system the brand uses, e.g. {"eu": "40", "uk": "6.5"}. The label in the chart's `size_system` is the size shoppers and the store see.
    - `length_mm` (`number (double)`, required): The length the chart's `basis` names (foot length, longest foot, or the shoe's inside length).
    - `fitting` (`string`, optional, max length 16): Optional width fitting, e.g. narrow, regular, wide, E, EE. Rows of one size share its length.
    - `width_mm` (`number (double)`, optional): Optional width at the ball (inside the shoe, or the foot width the fitting is made for).
    - `girth_mm` (`number (double)`, optional): Optional ball girth.
- `elastic_waist` (`boolean`, optional): Waistband of trousers, shorts, skirts and leggings: true = elastic pull-on waistband, false = fixed band (button or zip), null or absent = not stated. Giving waist_extended_width in the POM table implies elastic. Ignored (with the warning elastic_waist_ignored) for other categories.
- `elastic_waist_inferred` (`boolean`, optional, default `false`): True when elastic_waist was inferred from text (product name, fabric, description) rather than stated by the brand.
- `rise_type` (`"low" | "mid" | "high"`, optional): Bottoms (jeans, trousers, shorts, skirt, leggings): where the waistband is worn, low, mid or high rise; null or absent = not stated. Ignored (with the warning worn_at_ignored) for other categories.
- `rise_type_inferred` (`boolean`, optional, default `false`): True when rise_type was inferred from text (product name, description) rather than stated by the brand.
- `worn_at_mm` (`number (double)`, optional): Bottoms: height of the waistband top relative to the natural waist, mm, negative = below. Null or absent = derived from the rise measurements.

## Responses

### 200

OK (`GarmentVersion`)

- `id` (`string (uuid)`, required)
- `product_id` (`string (uuid)`, required)
- `version` (`integer`, required)
- `status` (`"draft" | "published" | "retired"`, required)
- `category` (`"tshirt" | "shirt" | "sweater" | "jacket" | "dress" | "skirt" | "jeans" | "trousers" | "shorts" | "leggings" | "polo" | "hoodie" | "footwear"`, required): The garment type; it sets which POMs are needed (`footwear` has a size chart instead).
- `fit_intent` (`"skinny" | "slim" | "regular" | "relaxed" | "oversized"`, required): The designer's intended silhouette; sets the ease targets the fit judgement compares against.
- `sizes` (`string[]`, required)
- `poms` (`POMTable`, required): Garment measurements per size: size label → POM code → millimetres. Widths are flat half-measurements. See GET /v1/studio/garment_dictionary for codes and plausible ranges.
- `grading` (`GradingRule`, optional): How the POM table was derived: the base size's values plus, per POM, the increment (mm) between each pair of consecutive sizes (len = number of sizes - 1). The table stays the source of truth.
  - `base_size` (`string`, required)
  - `increments_mm` (`object`, required)
- `fabric` (`Fabric`, required): What the tech pack / mill sheet says.
  - `name` (`string`, optional)
  - `construction` (`"jersey" | "rib" | "interlock" | "fleece" | "pique" | "plain_weave" | "twill" | "denim" | "satin" | "other"`, optional)
  - `composition` (`FiberShare[]`, required)
    - `fiber` (`"cotton" | "polyester" | "elastane" | "viscose" | "modal" | "lyocell" | "wool" | "linen" | "polyamide" | "silk" | "acrylic" | "other"`, required)
    - `pct` (`number (double)`, required)
  - `weight_gsm` (`number (double)`, optional): Areal density, g/m².
  - `stretch_warp_pct` (`number (double)`, optional): Stretch along the warp (lengthwise), percent.
  - `stretch_weft_pct` (`number (double)`, optional): Stretch along the weft (crosswise), percent.
  - `notes` (`string`, optional)
- `import_id` (`string (uuid)`, optional)
- `issues` (`GarmentIssue[]`, required): What still blocks publishing (errors) or deserves a look (warnings).
  - `severity` (`"error" | "warning"`, required)
  - `code` (`string`, required): e.g. out_of_range, not_graded, missing_pom, composition_total
  - `field` (`string`, required): category | fit_intent | sizes | poms | grading | import | fabric.<field>
  - `size` (`string`, optional)
  - `pom` (`string`, optional)
  - `params` (`IssueParams`, optional): The values in `message`, for clients that word the finding in their own language (keys depend on `code`, e.g. value_mm, min_mm, max_mm, prev_size, fiber, max). Numbers are plain decimals ("." separator); lengths in mm.
  - `message` (`string`, required): English text; clients in other languages can word it from code, size, pom and params.
- `created_at` (`string (date-time)`, required)
- `updated_at` (`string (date-time)`, required)
- `published_at` (`string (date-time)`, optional)
- `season` (`string`, optional)
- `tolerances_mm` (`TolerancesMM`, optional): Spec-sheet tolerance per POM code, ± mm (e.g. {"chest_width": 10}). Optional; the flat preview uses ±5 mm when a POM has none.
- `spec_source` (`SpecSource`, optional): Where the POM table came from, kept for audit. Set by Studio's paste/import.
  - `kind` (`"manual" | "paste" | "xlsx" | "csv" | "pdf" | "workbook" | "clo" | "browzwear"`, required)
  - `filename` (`string`, optional, max length 255)
- `footwear` (`FootwearChart`, optional): A footwear version's size chart (category `footwear`). The version's `sizes` must be the chart's labels in the chart's `size_system`, in row order (fittings collapsed). Footwear has no POMs and no 3D fit check.
  - `shoe_type` (`"sneaker" | "dress" | "boot" | "sandal"`, required): Sets the room left in front of the toes that a size is chosen for.
  - `size_system` (`"eu" | "uk" | "us_men" | "us_women" | "mondopoint"`, required): A shoe size system: `eu` (Paris points), `uk`, `us_men`, `us_women`, or `mondopoint` (foot length in mm).
  - `basis` (`"foot_length" | "foot_length_max" | "last_length"`, required): What `length_mm` is: the foot length each size is made for (`foot_length`), the longest foot for the size (`foot_length_max`, "up to 25.5 cm"), or the shoe's inside (last) length (`last_length`).
  - `rows` (`FootwearChartRow[]`, required, max 120 items)
    - `labels` (`object`, required): The size's label in each system the brand uses, e.g. {"eu": "40", "uk": "6.5"}. The label in the chart's `size_system` is the size shoppers and the store see.
    - `length_mm` (`number (double)`, required): The length the chart's `basis` names (foot length, longest foot, or the shoe's inside length).
    - `fitting` (`string`, optional, max length 16): Optional width fitting, e.g. narrow, regular, wide, E, EE. Rows of one size share its length.
    - `width_mm` (`number (double)`, optional): Optional width at the ball (inside the shoe, or the foot width the fitting is made for).
    - `girth_mm` (`number (double)`, optional): Optional ball girth.
- `elastic_waist` (`boolean`, optional): Waistband: true = elastic pull-on, false = fixed band (button or zip), null = not stated.
- `elastic_waist_inferred` (`boolean`, optional): True when elastic_waist was inferred from text, not stated by the brand.
- `fit_group_id` (`string (uuid)`, optional): The fit group (garments row) this version belongs to (absent until grouped).
- `rise_type` (`"low" | "mid" | "high"`, optional): Where the waistband is worn (bottoms); null = not stated.
- `rise_type_inferred` (`boolean`, optional): True when rise_type was inferred from text, not stated by the brand.
- `worn_at_mm` (`number (double)`, optional): Height of the waistband top relative to the natural waist, mm, negative = below; null = derived from the rise measurements.

### 400

Invalid request (`Error`)

### 401

Missing or invalid credentials (`Error`)

### 403

Not allowed (`Error`)

### 404

Not found (`Error`)

### 409

Conflicts with the current state (duplicate SKU, editing a published version) (`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/garments/<garment_id> \
  -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.garments.updateDraft()`](https://docs.tryyoursize.com/reference/node/garments-update-draft.md)
- Python: [`tys.garments.update_draft()`](https://docs.tryyoursize.com/reference/python/garments-update-draft.md)
