Skip to content
Cloudflare Docs

Start Recording

This topic explains how to use RealtimeKit to implement composite recording.

Before getting started with this guide, we recommend that you read Get Started with RealtimeKit to familiarize yourself with RealtimeKit.

To familiarize yourself with the RealtimeKit REST APIs, we recommend exploring the RealtimeKit REST API.

There are three ways to start recording a RealtimeKit meeting:

RealtimeKit stores recordings for a period of 7 days, after which they will expire and no longer be accessible. It is important to either download a copy of your recording or set up storage before the link expires.

Using the record_on_start parameter

When creating a meeting, you can specify the record_on_start parameter to start the recording as soon as someone joins the meeting.

:::info Specify storage_config

If you're using this method to start the recording, you must specify the storage-config using the Developer Portal.

:::

Request

Specify the record_on_start parameter. If this flag is true, then a recording will be started as soon as a meeting starts on RealtimeKit, i.e, when the first participant joins the meeting.

Terminal window
curl --location 'https://api.cloudflare.com/client/v4/accounts/<account_id>/realtime/kit/<app_id>/meetings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <api_token>' \
--data '{
"title": "Lorem Ipsum",
"preferred_region": "ap-south-1",
"record_on_start": true
}'

Response

{
"success": true,
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"preferred_region": "ap-south-1",
"record_on_start": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}

Using the Start Recording API

You can also start a recording using the Start Recording API.

Specify the meeting ID of the meeting that you want to record.

Use the List meetings API for an app or Create a meeting API to get the meeting ID. The API returns a parameter called id, which is your meeting ID.

Request

Calling Start Recording API
curl --location 'https://api.cloudflare.com/client/v4/accounts/<account_id>/realtime/kit/<app_id>/recordings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <api_token>' \
--data '{
"meeting_id": "97440c6a-140b-40a9-9499-b23fd7a3868a"
}'

Response

{
"success": true,
"data": {
"id": "97440c6a-140b-40a9-9499-b23fd7a3868a",
"download_url": "http://example.com",
"download_url_expiry": "2019-08-24T14:15:22Z",
"download_audio_url": "http://example1.com",
"file_size": 0,
"session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",
"output_file_name": "string",
"status": "INVOKED",
"invoked_time": "2019-08-24T14:15:22Z",
"started_time": "2019-08-24T14:15:22Z",
"stopped_time": "2019-08-24T14:15:22Z",
"storage_config": {
"type": "aws",
"secret_key": "string",
"bucket": "string",
"region": "us-east-1",
"path": "string"
}
}
}