Apply a Self-Hosted state transition

View as Markdown
Applies **one** Self-Hosted state transition, discriminated by `action`: `save` a mode's config (no on/off or active-mode change), `activate` a mode (enable Self-Hosted and route calls through it — enable or switch), or `disable`. Each mode (`llm`/`audio`) has its own independent config. The signing secret for a mode is minted the first time you `save` a `wsUrl` for it. Retrieve it from `GET /api/v1/self-hosted/secret?mode=…` and set up your server's `X-Dial-Signature` verification *before* you `activate` (activating routes your calls at the server immediately). Returns the full configuration after the change.

Authentication

AuthorizationBearer

Your Dial API key, sent as Authorization: Bearer sk_live_...

Request

This endpoint expects an object.
saveobjectRequired

Persist a mode’s config. Does not change which mode is active or whether Self-Hosted is on. The signing secret (and, for llm, the urlKey) is minted the first time a mode is saved.

OR
activateobjectRequired

A save (same config body) that also enables Self-Hosted and routes calls through config.type — enable, or switch from the other mode. Affects new calls only.

OR
disableobjectRequired

Turn Self-Hosted off. Both modes’ configs are kept.

Response

The full configuration after the change.
enabledboolean

Whether Self-Hosted mode is currently driving the account’s calls.

activeModeenum

Which mode drives calls when enabled: "llm" (Dial runs voice; your server drives the conversation in text) or "audio" (Dial pipes the raw call audio to your server, full duplex).

llmobject or null

The LLM-mode config, or null until that mode is configured.

audioobject or null

The audio-mode config, or null until that mode is configured.

Errors

400
Bad Request Error
401
Unauthorized Error