Skip to navigation

Start recording

View as Markdown

Rate limit: Per command · Burst: 4 · Refill: 1 req/s

Start a 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.

Each Session independently allows up to four concurrent recordings, including duplicate both + mono recordings. Recordings waiting to start or finish count; recordings for another Session or a Room do not. A Room separately allows one active Room Recording at a time. A fifth request returns HTTP 409 with code concurrent_recording_limit_reached and reserves nothing. Stop one recording and wait for its terminal event before retrying with a new idempotency key. If the response remains 409 briefly, retry after release completes. 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 provides it. After recording.ended, 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 for complete payload schemas and examples.

Authentication

AuthorizationBearer

Send Authorization: Bearer <app_uuid>:<api_key> using an active API key. See Authentication for details.

Path parameters

uuidstringRequired

Session identifier.

Headers

Idempotency-KeystringOptionalformat: "^[a-zA-Z0-9._-]*$"<=128 characters

Optional key for safely retrying mutating requests. An explicitly empty header is treated like omission and does not enable replay protection. See 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. Must be mono.

Allowed values:
directionenumRequired

Audio direction relative to the Session. Must be 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 headers

traceparentstringOptionalformat: "^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$"=55 characters

Server-owned W3C Trace Context for correlating this response with support and observability data. It is present on successful and error responses. A valid incoming traceparent is linked to, but never becomes, the server-owned trace identifier.

Response

Recording accepted
operation_uuidstring
recording_uuidstring

Recording identifier starting with rec_.

statusenum
Allowed values:

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
406
Not Acceptable 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