Skip to content
Start here

Start recording a meeting

client.RealtimeKit.Recordings.StartRecordings(ctx, appID, params) (*RecordingStartRecordingsResponse, error)
POST/accounts/{account_id}/realtime/kit/{app_id}/recordings

Starts recording a meeting. The meeting can be started by an App admin directly, or a participant with permissions to start a recording, based on the type of authorization used.

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 RecordingStartRecordingsParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
AllowMultipleRecordings param.Field[bool]optional

Body param: By default, a meeting allows only one recording to run at a time. Enabling the allow_multiple_recordings parameter to true allows you to initiate multiple recordings concurrently in the same meeting. This allows you to record separate videos of the same meeting with different configurations, such as portrait mode or landscape mode.

AudioConfig param.Field[RecordingStartRecordingsParamsAudioConfig]optional

Body param: Object containing configuration regarding the audio that is being recorded.

Channel RecordingStartRecordingsParamsAudioConfigChanneloptional

Audio signal pathway within an audio file that carries a specific sound source.

One of the following:
const RecordingStartRecordingsParamsAudioConfigChannelMono RecordingStartRecordingsParamsAudioConfigChannel = "mono"
const RecordingStartRecordingsParamsAudioConfigChannelStereo RecordingStartRecordingsParamsAudioConfigChannel = "stereo"
Codec RecordingStartRecordingsParamsAudioConfigCodecoptional

Codec using which the recording will be encoded. If VP8/VP9 is selected for videoConfig, changing audioConfig is not allowed. In this case, the codec in the audioConfig is automatically set to vorbis.

One of the following:
const RecordingStartRecordingsParamsAudioConfigCodecMP3 RecordingStartRecordingsParamsAudioConfigCodec = "MP3"
const RecordingStartRecordingsParamsAudioConfigCodecAac RecordingStartRecordingsParamsAudioConfigCodec = "AAC"
ExportFile booloptional

Controls whether to export audio file seperately

FileNamePrefix param.Field[string]optional

Body param: Update the recording file name.

InteractiveConfig param.Field[RecordingStartRecordingsParamsInteractiveConfig]optional

Body param: Allows you to add timed metadata to your recordings, which are digital markers inserted into a video file to provide contextual information at specific points in the content range. The ID3 tags containing this information are available to clients on the playback timeline in HLS format. The output files are generated in a compressed .tar format.

Type RecordingStartRecordingsParamsInteractiveConfigTypeoptional

The metadata is presented in the form of ID3 tags.

MaxSeconds param.Field[int64]optional

Body param: Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours.

maximum86400
minimum60
MeetingID param.Field[string]optional

Body param: ID of the meeting to record.

formatuuid
RealtimekitBucketConfig param.Field[RecordingStartRecordingsParamsRealtimekitBucketConfig]optional

Body param

Enabled bool

Controls whether recordings are uploaded to RealtimeKit's bucket. If set to false, download_url, audio_download_url, download_url_expiry won't be generated for a recording.

RtmpOutConfig param.Field[RecordingStartRecordingsParamsRtmpOutConfig]optional

Body param

RtmpURL stringoptional

RTMP URL to stream to

formaturi
StorageConfig param.Field[RecordingStartRecordingsParamsStorageConfig]optional

Body param

Type RecordingStartRecordingsParamsStorageConfigType

Type of storage media.

One of the following:
const RecordingStartRecordingsParamsStorageConfigTypeAws RecordingStartRecordingsParamsStorageConfigType = "aws"
const RecordingStartRecordingsParamsStorageConfigTypeAzure RecordingStartRecordingsParamsStorageConfigType = "azure"
const RecordingStartRecordingsParamsStorageConfigTypeDigitalocean RecordingStartRecordingsParamsStorageConfigType = "digitalocean"
const RecordingStartRecordingsParamsStorageConfigTypeGcs RecordingStartRecordingsParamsStorageConfigType = "gcs"
const RecordingStartRecordingsParamsStorageConfigTypeSftp RecordingStartRecordingsParamsStorageConfigType = "sftp"
AccessKey stringoptional

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.

AuthMethod RecordingStartRecordingsParamsStorageConfigAuthMethodoptional

Authentication method used for "sftp" type storage medium

One of the following:
const RecordingStartRecordingsParamsStorageConfigAuthMethodKey RecordingStartRecordingsParamsStorageConfigAuthMethod = "KEY"
const RecordingStartRecordingsParamsStorageConfigAuthMethodPassword RecordingStartRecordingsParamsStorageConfigAuthMethod = "PASSWORD"
Bucket stringoptional

Name of the storage medium's bucket.

Host stringoptional

SSH destination server host for SFTP type storage medium

Password stringoptional

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 stringoptional

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

Port float64optional

SSH destination server port for SFTP type storage medium

PrivateKey stringoptional

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

Region stringoptional

Region of the storage medium.

Secret stringoptional

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

Username stringoptional

SSH destination server username for SFTP type storage medium

URL param.Field[string]optional

Body param: Pass a custom url to record arbitary screen

formaturi
VideoConfig param.Field[RecordingStartRecordingsParamsVideoConfig]optional

Body param

Codec RecordingStartRecordingsParamsVideoConfigCodecoptional

Codec using which the recording will be encoded.

One of the following:
const RecordingStartRecordingsParamsVideoConfigCodecH264 RecordingStartRecordingsParamsVideoConfigCodec = "H264"
const RecordingStartRecordingsParamsVideoConfigCodecVp8 RecordingStartRecordingsParamsVideoConfigCodec = "VP8"
ExportFile booloptional

Controls whether to export video file seperately

Height int64optional

Height of the recording video in pixels

maximum1920
minimum1
Watermark RecordingStartRecordingsParamsVideoConfigWatermarkoptional

Watermark to be added to the recording

Position RecordingStartRecordingsParamsVideoConfigWatermarkPositionoptional

Position of the watermark

One of the following:
const RecordingStartRecordingsParamsVideoConfigWatermarkPositionLeftTop RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "left top"
const RecordingStartRecordingsParamsVideoConfigWatermarkPositionRightTop RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "right top"
const RecordingStartRecordingsParamsVideoConfigWatermarkPositionLeftBottom RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "left bottom"
const RecordingStartRecordingsParamsVideoConfigWatermarkPositionRightBottom RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "right bottom"
Size RecordingStartRecordingsParamsVideoConfigWatermarkSizeoptional

Size of the watermark

Height int64optional

Height of the watermark in px

minimum1
Width int64optional

Width of the watermark in px

minimum1
URL stringoptional

URL of the watermark image

formaturi
Width int64optional

Width of the recording video in pixels

maximum1920
minimum1
ReturnsExpand Collapse
type RecordingStartRecordingsResponse struct{…}
Success bool

Success status of the operation

Data RecordingStartRecordingsResponseDataoptional

Data returned by the operation

ID string

ID of the recording

formatuuid
AudioDownloadURL string

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

formaturi
DownloadURL string

URL where the recording can be downloaded.

formaturi
DownloadURLExpiry Time

Timestamp when the download URL expires.

formatdate-time
FileSize float64

File size of the recording, in bytes.

InvokedTime Time

Timestamp when this recording was invoked.

formatdate-time
OutputFileName string

File name of the recording.

SessionID string

ID of the meeting session this recording is for.

formatuuid
StartedTime Time

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

formatdate-time
Status RecordingStartRecordingsResponseDataStatus

Current status of the recording.

One of the following:
const RecordingStartRecordingsResponseDataStatusInvoked RecordingStartRecordingsResponseDataStatus = "INVOKED"
const RecordingStartRecordingsResponseDataStatusRecording RecordingStartRecordingsResponseDataStatus = "RECORDING"
const RecordingStartRecordingsResponseDataStatusUploading RecordingStartRecordingsResponseDataStatus = "UPLOADING"
const RecordingStartRecordingsResponseDataStatusUploaded RecordingStartRecordingsResponseDataStatus = "UPLOADED"
const RecordingStartRecordingsResponseDataStatusErrored RecordingStartRecordingsResponseDataStatus = "ERRORED"
const RecordingStartRecordingsResponseDataStatusPaused RecordingStartRecordingsResponseDataStatus = "PAUSED"
StoppedTime Time

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

formatdate-time
RecordingDuration int64optional

Total recording time in seconds.

StartReason RecordingStartRecordingsResponseDataStartReasonoptional
Caller RecordingStartRecordingsResponseDataStartReasonCalleroptional
Name stringoptional

Name of the user who started the recording.

Type RecordingStartRecordingsResponseDataStartReasonCallerTypeoptional

The type can be an App or a user. If the type is user, then only the user_Id and name are returned.

One of the following:
const RecordingStartRecordingsResponseDataStartReasonCallerTypeOrganization RecordingStartRecordingsResponseDataStartReasonCallerType = "ORGANIZATION"
const RecordingStartRecordingsResponseDataStartReasonCallerTypeUser RecordingStartRecordingsResponseDataStartReasonCallerType = "USER"
UserID stringoptional

The user ID of the person who started the recording.

formatuuid
Reason RecordingStartRecordingsResponseDataStartReasonReasonoptional

Specifies if the recording was started using the "Start a Recording"API or using the parameter RECORD_ON_START in the "Create a meeting" API.

If the recording is initiated using the "RECORD_ON_START" parameter, the user details will not be populated.

One of the following:
const RecordingStartRecordingsResponseDataStartReasonReasonAPICall RecordingStartRecordingsResponseDataStartReasonReason = "API_CALL"
const RecordingStartRecordingsResponseDataStartReasonReasonRecordOnStart RecordingStartRecordingsResponseDataStartReasonReason = "RECORD_ON_START"
StopReason RecordingStartRecordingsResponseDataStopReasonoptional
Caller RecordingStartRecordingsResponseDataStopReasonCalleroptional
Name stringoptional

Name of the user who stopped the recording.

Type RecordingStartRecordingsResponseDataStopReasonCallerTypeoptional

The type can be an App or a user. If the type is user, then only the user_Id and name are returned.

One of the following:
const RecordingStartRecordingsResponseDataStopReasonCallerTypeOrganization RecordingStartRecordingsResponseDataStopReasonCallerType = "ORGANIZATION"
const RecordingStartRecordingsResponseDataStopReasonCallerTypeUser RecordingStartRecordingsResponseDataStopReasonCallerType = "USER"
UserID stringoptional

The user ID of the person who stopped the recording.

formatuuid
Reason RecordingStartRecordingsResponseDataStopReasonReasonoptional

Specifies the reason why the recording stopped.

One of the following:
const RecordingStartRecordingsResponseDataStopReasonReasonAPICall RecordingStartRecordingsResponseDataStopReasonReason = "API_CALL"
const RecordingStartRecordingsResponseDataStopReasonReasonInternalError RecordingStartRecordingsResponseDataStopReasonReason = "INTERNAL_ERROR"
const RecordingStartRecordingsResponseDataStopReasonReasonAllPeersLeft RecordingStartRecordingsResponseDataStopReasonReason = "ALL_PEERS_LEFT"
StorageConfig RecordingStartRecordingsResponseDataStorageConfigoptional
Type RecordingStartRecordingsResponseDataStorageConfigType

Type of storage media.

One of the following:
const RecordingStartRecordingsResponseDataStorageConfigTypeAws RecordingStartRecordingsResponseDataStorageConfigType = "aws"
const RecordingStartRecordingsResponseDataStorageConfigTypeAzure RecordingStartRecordingsResponseDataStorageConfigType = "azure"
const RecordingStartRecordingsResponseDataStorageConfigTypeDigitalocean RecordingStartRecordingsResponseDataStorageConfigType = "digitalocean"
const RecordingStartRecordingsResponseDataStorageConfigTypeGcs RecordingStartRecordingsResponseDataStorageConfigType = "gcs"
const RecordingStartRecordingsResponseDataStorageConfigTypeSftp RecordingStartRecordingsResponseDataStorageConfigType = "sftp"
AccessKey stringoptional

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.

AuthMethod RecordingStartRecordingsResponseDataStorageConfigAuthMethodoptional

Authentication method used for "sftp" type storage medium

One of the following:
const RecordingStartRecordingsResponseDataStorageConfigAuthMethodKey RecordingStartRecordingsResponseDataStorageConfigAuthMethod = "KEY"
const RecordingStartRecordingsResponseDataStorageConfigAuthMethodPassword RecordingStartRecordingsResponseDataStorageConfigAuthMethod = "PASSWORD"
Bucket stringoptional

Name of the storage medium's bucket.

Host stringoptional

SSH destination server host for SFTP type storage medium

Password stringoptional

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 stringoptional

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

Port float64optional

SSH destination server port for SFTP type storage medium

PrivateKey stringoptional

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

Region stringoptional

Region of the storage medium.

Secret stringoptional

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

Username stringoptional

SSH destination server username for SFTP type storage medium

Start recording a meeting

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/realtime_kit"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.Recordings.StartRecordings(
    context.TODO(),
    "app_id",
    realtime_kit.RecordingStartRecordingsParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      AudioConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsAudioConfig{
        Channel: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsAudioConfigChannelStereo),
        Codec: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsAudioConfigCodecAac),
        ExportFile: cloudflare.F(true),
      }),
      FileNamePrefix: cloudflare.F("string"),
      InteractiveConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsInteractiveConfig{
        Type: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsInteractiveConfigTypeId3),
      }),
      MaxSeconds: cloudflare.F(int64(60)),
      MeetingID: cloudflare.F("97440c6a-140b-40a9-9499-b23fd7a3868a"),
      RealtimekitBucketConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsRealtimekitBucketConfig{
        Enabled: cloudflare.F(true),
      }),
      VideoConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfig{
        Codec: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigCodecH264),
        ExportFile: cloudflare.F(true),
        Height: cloudflare.F(int64(720)),
        Watermark: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigWatermark{
          Position: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigWatermarkPositionLeftTop),
          Size: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigWatermarkSize{
            Height: cloudflare.F(int64(1)),
            Width: cloudflare.F(int64(1)),
          }),
          URL: cloudflare.F("http://example.com"),
        }),
        Width: cloudflare.F(int64(1280)),
      }),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Success)
}
{
  "success": true,
  "data": {
    "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,
    "start_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "stop_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "storage_config": {
      "type": "aws",
      "auth_method": "KEY",
      "bucket": "bucket",
      "host": "host",
      "password": "password",
      "path": "path",
      "port": 0,
      "private_key": "private_key",
      "region": "us-east-1",
      "secret": "secret",
      "username": "username"
    }
  }
}
Returns Examples
{
  "success": true,
  "data": {
    "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,
    "start_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "stop_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "storage_config": {
      "type": "aws",
      "auth_method": "KEY",
      "bucket": "bucket",
      "host": "host",
      "password": "password",
      "path": "path",
      "port": 0,
      "private_key": "private_key",
      "region": "us-east-1",
      "secret": "secret",
      "username": "username"
    }
  }
}