Skip to content
Start here

Start recording audio and video tracks

realtime_kit.recordings.start_track_recording(strapp_id, RecordingStartTrackRecordingParams**kwargs)
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
account_id: str

The account identifier tag.

maxLength32
app_id: str

The app identifier tag.

maxLength32
layers: Dict[str, Layers]
file_name_prefix: Optional[str]

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

outputs: Optional[Iterable[LayersOutput]]
storage_config: Optional[LayersOutputStorageConfig]
type: Literal["aws", "azure", "digitalocean", 2 more]

Type of storage media.

One of the following:
"aws"
"azure"
"digitalocean"
"gcs"
"sftp"
access_key: Optional[str]

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: Optional[Literal["KEY", "PASSWORD"]]

Authentication method used for “sftp” type storage medium

One of the following:
"KEY"
"PASSWORD"
bucket: Optional[str]

Name of the storage medium’s bucket.

host: Optional[str]

SSH destination server host for SFTP type storage medium

password: Optional[str]

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: Optional[str]

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

port: Optional[float]

SSH destination server port for SFTP type storage medium

private_key: Optional[str]

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

region: Optional[str]

Region of the storage medium.

secret: Optional[str]

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

username: Optional[str]

SSH destination server username for SFTP type storage medium

type: Optional[Literal["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: str

ID of the meeting to record.

max_seconds: Optional[float]

Maximum seconds this recording should be active for (beta)

Start recording audio and video tracks

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
client.realtime_kit.recordings.start_track_recording(
    app_id="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