# Toggle CDN embed mode
`PUT https://octopus.livepush.io/streams/{stream_id}/embed/mode/cdn`
Switches the embed to CDN delivery. Enabling this checks the account subscription before applying.

Requires a token with write access to the stream (`CanWriteStreams`).
- **Tag:** Stream Embed
- **Operation ID:** `putStreamEmbedModeCdn`
- **Authentication:** Bearer token required
- **Docs:** https://developers.livepush.io/stream-embed/toggle-cdn-embed-mode/

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `stream_id` | string | yes | Unique identifier of the stream. |


### Request body

`application/json` (required)

- `state` (boolean) **required** — Desired state.
- `isEnabled` (boolean) — Legacy alias for state, still sent by the dashboard. The API reads state; send both if you need to match dashboard behaviour exactly.


```json
{
  "state": true,
  "isEnabled": false
}
```


### Example request

```bash
curl -X PUT 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/embed/mode/cdn' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "state": true,
    "isEnabled": false
  }'
```


### Responses


#### 200 — Setting applied.

- `success` (boolean)


```json
{
  "success": true
}
```


#### 400 — Response


#### 401 — Response

