Start recording

View as Markdown
**Rate limit: Per command** · **Burst:** 4 · **Refill:** 1 req/s Start a [Recording](/api/recording) of the call. The `202 Accepted` response confirms that the command was admitted. It does not confirm that recording has started or that recorded audio is available. Retain the returned `recording_uuid` to address this recording, and use the returned `operation_uuid` to correlate the recording lifecycle webhooks below. Send `POST /v1/sessions/{uuid}/recordings` as soon as you receive the Session's `session_uuid`. Choose the capture boundary with `start_only_after_answer`: - By default, inbound and outbound phone Sessions start recording as soon as the current media path permits, including available early media. - Set `start_only_after_answer` to `true` to durably wait for the canonical answer instead. If a waiting Session ends first, `recording.failed` is emitted. Choose independently for each recording whether to include redacted periods and periods without recordable audio. Omit `include_gaps` or set it to `false` to remove those gaps from the artifact. Set it to `true` to include the gaps as silence. A Session may have multiple active recordings, including duplicate `both` + `mono` recordings. Voice activity events and their detector configuration are optional and independent for every recording. Output is 8 kHz mono mixed WAV (both legs combined). Format is not configurable. **Triggered webhooks:** - `recording.became_available` carries signed `media_url` and `live_url` capabilities; `recording.failed` is emitted instead if the recording does not become available. - When `enable_voice_activity_events` is true, `recording.speech.started` and `recording.speech.ended` report customer speech transitions for the lifetime of this recording. Sensitivity and speech/silence confirmation durations are configurable. Use `media_url` to start at byte zero and follow the growing Recording until EOF. After finalization, the same URL serves a finite, range-capable WAV. Use `live_url` to join near the current position. Anyone with either URL can access its capability until it expires. By default, it expires 24 hours after the lifecycle event is emitted. > **Tip: Minimize confirmation playback delay.** If you plan to play a recording back > to the caller for confirmation, start streaming the `media_url` from the > beginning into an S3 multipart upload as soon as > [`recording.became_available`](/webhooks/recording-events#recordingbecame_available) > provides it. After > [`recording.ended`](/webhooks/recording-events#recordingended), let the source > stream reach EOF, then complete the multipart upload. Because most of the audio > is already in S3, you can start playback without first transferring the entire > recording after it ends. > > Use `media_url` for this workflow. The `live_url` starts at the live edge and > does not include audio recorded before you connect. See [Recording lifecycle events](/api/recording#lifecycle-events) for complete payload schemas and examples.

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.
channelsenumRequired

Output channel layout. Phase 1 supports mono.

Allowed values:
directionenumRequired

Audio direction relative to the Session. Phase 1 supports both.

Allowed values:
enable_voice_activity_eventsbooleanOptional

When true, emit recording.speech.started and recording.speech.ended while this session recording is active. Detection is passive and does not alter recorded audio. Omit this field or set it to false to disable these events. Not supported for type: ws sessions or room recordings.

include_gapsbooleanOptional

Controls whether redacted periods and periods without recordable audio are included in the recording’s duration. Omit this field or set it to false to remove those gaps from the artifact. Set it to true to include the gaps as silence.

start_only_after_answerbooleanOptional
When `true` on an inbound or outbound phone Session that has not answered, durably admit the request and wait for the canonical answer before starting. Omit this field or set it to `false` to start as soon as the current media path permits, including available early media. Already-answered and `type: ws` Sessions keep their immediate behavior.
voice_activity_configobjectOptional

Required tuning when voice activity events are enabled. Supplying this object requires enable_voice_activity_events: true; otherwise the request is rejected.

Response

Recording accepted
operation_uuidstringformat: "uuid"
recording_uuidstringformat: "^rec_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
statusenum

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
503
Service Unavailable Error