Skip to content
Start here

Start recording participant audio tracks

client.realtimeKit.recordings.startTrackRecording(stringappId, RecordingStartTrackRecordingParams { account_id, meeting_id, layers, user_ids } params, RequestOptionsoptions?): RecordingStartTrackRecordingResponse { success, data }
POST/accounts/{account_id}/realtime/kit/{app_id}/recordings/track

Starts track recording for a meeting. Track recording currently records separate participant audio tracks as WebM files in the RealtimeKit bucket. Video track recording is in development. For more information, refer to Track recording.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appId: string

The app identifier tag.

maxLength32
params: RecordingStartTrackRecordingParams { account_id, meeting_id, layers, user_ids }
account_id: string

Path param: The account identifier tag.

maxLength32
meeting_id: string

Body param: ID of the meeting to record.

formatuuid
layers?: Record<string, Layers>

Body param: Optional audio layer configuration. If omitted, RealtimeKit records all participant audio using the default file name prefix.

file_name_prefix?: string

A file name prefix to apply for files generated from this layer

media_kind?: "audio"

Media kind to record. Track recording currently supports audio only.

user_ids?: Array<string>

Body param: Optional list of participant user IDs to record. Selective track recording (user_ids) is in early beta contact support to use this feature.

ReturnsExpand Collapse
RecordingStartTrackRecordingResponse { success, data }
success: boolean

Success status of the operation

data?: Data { recording }

Data returned by the operation

recording: Recording { id, audio_download_url, download_url, 9 more }
id: string

ID of the recording

formatuuid
audio_download_url: string | null

If the audio_config is passed, the URL for downloading the audio recording is returned.

formaturi
download_url: string | null

URL where the recording can be downloaded.

formaturi
download_url_expiry: string | null

Timestamp when the download URL expires.

formatdate-time
file_size: number | null

File size of the recording, in bytes.

invoked_time: string

Timestamp when this recording was invoked.

formatdate-time
output_file_name: string

File name of the recording.

session_id: string | null

ID of the meeting session this recording is for.

formatuuid
started_time: string | null

Timestamp when this recording actually started after being invoked. Usually a few seconds after invoked_time.

formatdate-time
status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more

Current status of the recording.

One of the following:
"INVOKED"
"RECORDING"
"UPLOADING"
"UPLOADED"
"ERRORED"
"PAUSED"
stopped_time: string | null

Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped.

formatdate-time
recording_duration?: number

Total recording time in seconds.

Start recording participant audio tracks

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.realtimeKit.recordings.startTrackRecording('app_id', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
  meeting_id: '97440c6a-140b-40a9-9499-b23fd7a3868a',
});

console.log(response.success);
{
  "success": true,
  "data": {
    "recording": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "audio_download_url": "https://example.com",
      "download_url": "https://example.com",
      "download_url_expiry": "2019-12-27T18:11:19.117Z",
      "file_size": 0,
      "invoked_time": "2019-12-27T18:11:19.117Z",
      "output_file_name": "output_file_name",
      "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "started_time": "2019-12-27T18:11:19.117Z",
      "status": "INVOKED",
      "stopped_time": "2019-12-27T18:11:19.117Z",
      "recording_duration": 0
    }
  }
}
Returns Examples
{
  "success": true,
  "data": {
    "recording": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "audio_download_url": "https://example.com",
      "download_url": "https://example.com",
      "download_url_expiry": "2019-12-27T18:11:19.117Z",
      "file_size": 0,
      "invoked_time": "2019-12-27T18:11:19.117Z",
      "output_file_name": "output_file_name",
      "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "started_time": "2019-12-27T18:11:19.117Z",
      "status": "INVOKED",
      "stopped_time": "2019-12-27T18:11:19.117Z",
      "recording_duration": 0
    }
  }
}