Skip to content
Start here

Start recording audio and video tracks

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

Starts a track recording in a meeting. Track recordings consist of “layers”. Layers are used to map audio/video tracks in a meeting to output destinations. More information about track recordings is available in the Track Recordings Guide Page.

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, layers, meeting_id, max_seconds }
account_id: string

Path param: The account identifier tag.

maxLength32
layers: Record<string, Layers>

Body param

file_name_prefix?: string

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

outputs?: Array<Output>
storage_config?: StorageConfig | null
type: "aws" | "azure" | "digitalocean" | 2 more

Type of storage media.

One of the following:
"aws"
"azure"
"digitalocean"
"gcs"
"sftp"
access_key?: string

Access key of the storage medium. Access key is not required for the gcs storage media type.

Note that this field is not readable by clients, only writeable.

auth_method?: "KEY" | "PASSWORD"

Authentication method used for “sftp” type storage medium

One of the following:
"KEY"
"PASSWORD"
bucket?: string

Name of the storage medium’s bucket.

host?: string

SSH destination server host for SFTP type storage medium

password?: string

SSH destination server password for SFTP type storage medium when auth_method is “PASSWORD”. If auth_method is “KEY”, this specifies the password for the ssh private key.

path?: string

Path relative to the bucket root at which the recording will be placed.

port?: number

SSH destination server port for SFTP type storage medium

private_key?: string

Private key used to login to destination SSH server for SFTP type storage medium, when auth_method used is “KEY”

region?: string

Region of the storage medium.

secret?: string

Secret key of the storage medium. Similar to access_key, it is only writeable by clients, not readable.

username?: string

SSH destination server username for SFTP type storage medium

type?: "REALTIMEKIT_BUCKET" | "STORAGE_CONFIG"

The type of output destination this layer is being exported to.

One of the following:
"REALTIMEKIT_BUCKET"
"STORAGE_CONFIG"
meeting_id: string

Body param: ID of the meeting to record.

max_seconds?: number

Body param: Maximum seconds this recording should be active for (beta)

Start recording audio and video tracks

import Cloudflare from 'cloudflare';

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

await client.realtimeKit.recordings.startTrackRecording('app_id', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
  layers: {
    default: { file_name_prefix: 'string', outputs: [{ type: 'REALTIMEKIT_BUCKET' }] },
    'default-video': { file_name_prefix: 'string', outputs: [{ type: 'REALTIMEKIT_BUCKET' }] },
  },
  meeting_id: 'string',
  max_seconds: 60,
});
Returns Examples