Start audio playback

View as Markdown
**Rate limit: Per command** · **Burst:** 8 · **Refill:** 4 req/s Choose the tab for your audio source. <Tabs> <Tab title="Audio files"> Play one WAV or MP3 file, or a playlist: ```json { "type": "files", "urls": [ "https://media.example.com/greeting.mp3", "https://media.example.com/menu.wav" ] } ``` The platform plays the URLs in order. Use `offset_ms` only with one file. For private files, use presigned HTTPS URLs that remain valid through playback. [Seek within playback](/api/playback/seek) is available only for files. </Tab> <Tab title="Live TTS"> Start a pushed raw-audio stream: ```json { "type": "stream", "media_format": { "encoding": "pcm_s16le", "sample_rate": 24000 } } ``` The `202 Accepted` response includes a short-lived `upload_url`. Stream the TTS bytes in one HTTP request body, then close the body when the TTS stream ends: ```http PUT {upload_url} Content-Type: application/octet-stream <raw audio bytes> ``` The audio must match `media_format`: signed little-endian PCM16 at 8, 16, 24, or 48 kHz; or G.711 mu-law at 8 kHz. </Tab> <Tab title="Silence"> Keep Session Playback active without an audio source: ```json { "type": "silence" } ``` Silence continues until another playback replaces it, the session ends, or you [stop playback](/api/playback/stop). </Tab> </Tabs> An accepted request returns `202 Accepted` with `operation_uuid` and `status: in_progress`. New playback replaces active playback automatically. See [Playback lifecycle events](/api/playback#lifecycle-events) for completion and failure webhooks.

Authentication

AuthorizationBearer
Application auth. Send `Authorization: Bearer <app_uuid>:<api_key>` using any active key in the app's collection. See [Authentication](https://voice-platform.docs.buildwithfern.com/api/authentication) for details.

Path parameters

uuidstringRequired

Session identifier.

Headers

Idempotency-KeystringOptionalformat: "^[a-zA-Z0-9._-]+$"<=128 characters
Optional key for safely retrying mutating requests. See [Idempotency](https://voice-platform.docs.buildwithfern.com/idempotency) for details.
Operation-IdstringOptionalformat: "uuid"

optional client-supplied lowercase RFC-4122 v4 UUID returned as operation_uuid; platform generates one when omitted; correlation metadata distinct from Idempotency-Key.

Request

This endpoint expects an object.
SessionPlaybackFilesRequestobjectRequired
Play one or more WAV or MP3 files in order.
OR
SessionPlaybackPushRequestobjectRequired
Play raw mono audio uploaded live through the returned HTTPS target.
OR
SessionPlaybackStreamRequestobjectRequired

Play one hosted HTTP/HTTPS AAC stream from its current live position.

OR
SessionPlaybackSilenceRequestobjectRequired
Play indefinite silence until playback is replaced or stopped.

Response

Playback accepted.
operation_uuidstringformat: "uuid"
statusenum
ingestobjectOptional

Present only for type: push. Send one streaming HTTP request exactly as described by this object, plus the normal application Bearer authorization header.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error