Skip to content
Start here

Start recording audio and video tracks

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
Path ParametersExpand Collapse
account_id: string

The account identifier tag.

maxLength32
app_id: string

The app identifier tag.

maxLength32
Body ParametersJSONExpand Collapse
layers: map[object { file_name_prefix, outputs } ]
file_name_prefix: optional string

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

outputs: optional array of object { storage_config, type }
storage_config: optional object { type, access_key, auth_method, 9 more }
type: "aws" or "azure" or "digitalocean" or 2 more

Type of storage media.

One of the following:
"aws"
"azure"
"digitalocean"
"gcs"
"sftp"
access_key: optional 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: optional "KEY" or "PASSWORD"

Authentication method used for "sftp" type storage medium

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

Name of the storage medium's bucket.

host: optional string

SSH destination server host for SFTP type storage medium

password: optional 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: optional string

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

port: optional number

SSH destination server port for SFTP type storage medium

private_key: optional string

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

region: optional string

Region of the storage medium.

secret: optional string

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

username: optional string

SSH destination server username for SFTP type storage medium

type: optional "REALTIMEKIT_BUCKET" or "STORAGE_CONFIG"

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

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

ID of the meeting to record.

max_seconds: optional number

Maximum seconds this recording should be active for (beta)

Start recording audio and video tracks

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/realtime/kit/$APP_ID/recordings/track \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{
          "layers": {
            "default": {
              "file_name_prefix": "string",
              "outputs": [
                {
                  "type": "REALTIMEKIT_BUCKET"
                }
              ]
            },
            "default-video": {
              "file_name_prefix": "string",
              "outputs": [
                {
                  "type": "REALTIMEKIT_BUCKET"
                }
              ]
            }
          },
          "meeting_id": "string"
        }'
Returns Examples