---
title: "Start a WebSocket media call"
method: POST
path: "/calls/outbound-test-ws-media"
---

# Start a WebSocket media call

`POST /calls/outbound-test-ws-media`

Starts an outbound test call and returns a short-lived WebSocket URL for streaming call audio.

## Headers

- `Authorization` string, required

## Request body

- object
  - `modelId` string, uuid, required — Agent model UUID.
  - `fromPhoneNumber` string — Optional caller ID. Omit to start like a browser web call. Uses the agent's attached number if present, otherwise the web-call placeholder `+17088888888`.
  - `toPhoneNumber` string — Optional lead/destination number. Omit to use the same web-call placeholder as when the agent has no attached number.
  - `leadName` string — Lead display name.
  - `agentVersion` string — Agent version to use. Set to `draft` to test the draft version, pass a version UUID, or omit for the live version.
  - `wsMediaCodec` 'opus' | 'pcma' | 'pcmu' | 'l16' — Codec to use for the WebSocket media stream. `l16` is raw big-endian 16-bit PCM at 16 kHz.
  - `wsMediaFraming` 'rtp' | 'payload' — Wire format for the WebSocket media stream. `rtp` (default) sends full RTP packets; `payload` sends raw codec payloads (RTP header stripped), which is simpler for external AI/STT/TTS clients. Use `payload` with `pcma`/`pcmu` — avoid `payload` with `opus` (see the integration guide for why).
  - `wsMediaServerName` string — Media node the client reached, taken from the `server-name` in the `server_info` message. Provide it to start the call on that exact node and receive a `sid` to bind over the open WebSocket (connect-then-bind). Omit it only for the legacy single-node flow that returns a ready-to-use `wsMediaUrl`.

## Response `200`

WebSocket media call created.

- StartWsMediaCallResponse200
  - `callId` string, required — Call ID for looking up the call later.
  - `sid` string — Session id for connect-then-bind. Returned when `wsMediaServerName` is set; send it as `{ "type": "bind", "sid": "..." }` over the WebSocket you already opened to attach your connection to the call. Empty for the legacy single-node flow.
  - `wsMediaUrl` string, uri, required — Short-lived WebSocket URL with the session id attached. Used directly by the legacy single-node flow; connect-then-bind clients ignore it and bind `sid` over the base URL connection instead.

## Other responses

- `400` — Invalid request.
- `401` — Missing or invalid API credentials.
- `502` — Room join failed.
- `503` — WebSocket media is not enabled in this environment.

## Changes

> 8 revisions in range; 1 could not be searched.

- **2026-08-25** `6976456ad422` — 2 info
  - the request property `fromPhoneNumber` became optional
  - the request property `toPhoneNumber` became optional

[Change history](https://skmtc.dev/synthflow/apis/platform-api/changes/calls/outbound-test-ws-media/post.md)

---

[API](https://skmtc.dev/synthflow/apis/platform-api.md) · [All operations](https://skmtc.dev/synthflow/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/synthflow/platform-api/revisions/6976456ad422/schema)
