# Bootstrap the measurement window

```http
POST /v1/embed/init
```

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

**Key:** publishable (`pk_test_…` / `pk_live_…`), from an origin registered for the key.

Called when the measurement window opens. Checks the publishable key and that the brand page embedding the window (parent_origin) is allowed for the store.

## Authentication

Publishable key (`pk_test_…` / `pk_live_…`), from an origin registered for the key.

## Request body

`application/json`: `InitEmbedRequest`

- `parent_origin` (`string`, required): Origin of the brand page that opened the window, e.g. https://shop.example

## Responses

### 200

The store the window works for (`EmbedStore`)

- `store_name` (`string`, required)
- `mode` (`"test" | "live"`, required)

### 401

Missing or invalid credentials (`Error`)

### 403

Not allowed (`Error`)

## Example

```bash
curl -X POST https://api.tryyoursize.com/v1/embed/init \
  -H "Authorization: Bearer pk_test_…" \
  -H "TYS-Version: 2026-10-25" \
  -H "Content-Type: application/json" \
  -d @body.json
```
