# Create a fit group

```http
POST /v1/fit_groups
```

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

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

One garment shared by several products (colourways, prints, reorders). Send an `Idempotency-Key` to retry safely.

## Authentication

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

## Parameters

- `Idempotency-Key` (header, `string`, optional): A unique value per logical request (a UUID v4 is ideal), 1-255 printable ASCII characters. With a secret or restricted key, the first response is stored for 24 hours per store and mode: a retry with the same key and the same body gets the stored response back (header `Idempotent-Replayed: true`); the same key with a different body is `422 idempotency_key_reused`; a retry while the first request still runs is `409 idempotency_key_in_use`. Responses with a 5xx status are not stored, so a retry runs again.

## Request body

`application/json`: `FitGroupInput`

- `name` (`string`, required, max length 200)
- `product_ids` (`string (uuid)[]`, optional): Products to put in the new group (create only).
- `source_product_id` (`string (uuid)`, optional): "Use the garment of…": the new group takes over this product's garment versions (create only).

## Responses

### 201

Created (`FitGroup`)

- `id` (`string (uuid)`, required)
- `name` (`string`, required)
- `product_ids` (`string (uuid)[]`, required)
- `published_version_id` (`string (uuid)`, optional)
- `draft_version_id` (`string (uuid)`, optional)
- `created_at` (`string (date-time)`, required)
- `updated_at` (`string (date-time)`, required)

### 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`)

## Example

```bash
curl -X POST https://api.tryyoursize.com/v1/fit_groups \
  -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.fitGroups.create()`](https://docs.tryyoursize.com/reference/node/fit-groups-create.md)
- Python: [`tys.fit_groups.create()`](https://docs.tryyoursize.com/reference/python/fit-groups-create.md)
