# Recordings ## Fetch all recordings for an App `client.RealtimeKit.Recordings.GetRecordings(ctx, appID, params) (*RecordingGetRecordingsResponse, error)` **get** `/accounts/{account_id}/realtime/kit/{app_id}/recordings` Returns all recordings for an App. If the `meeting_id` parameter is passed, returns all recordings for the given meeting ID. ### Parameters - `appID string` The app identifier tag. - `params RecordingGetRecordingsParams` - `AccountID param.Field[string]` Path param: The account identifier tag. - `EndTime param.Field[Time]` Query param: The end time range for which you want to retrieve the meetings. The time must be specified in ISO format. - `Expired param.Field[bool]` Query param: If passed, only shows expired/non-expired recordings on RealtimeKit's bucket - `MeetingID param.Field[string]` Query param: ID of a meeting. Optional. Will limit results to only this meeting if passed. - `PageNo param.Field[float64]` Query param: The page number from which you want your page search results to be displayed. - `PerPage param.Field[float64]` Query param: Number of results per page - `Search param.Field[string]` Query param: The search query string. You can search using the meeting ID or title. - `SortBy param.Field[RecordingGetRecordingsParamsSortBy]` Query param - `const RecordingGetRecordingsParamsSortByInvokedTime RecordingGetRecordingsParamsSortBy = "invokedTime"` - `SortOrder param.Field[RecordingGetRecordingsParamsSortOrder]` Query param - `const RecordingGetRecordingsParamsSortOrderAsc RecordingGetRecordingsParamsSortOrder = "ASC"` - `const RecordingGetRecordingsParamsSortOrderDesc RecordingGetRecordingsParamsSortOrder = "DESC"` - `StartTime param.Field[Time]` Query param: The start time range for which you want to retrieve the meetings. The time must be specified in ISO format. - `Status param.Field[[]RecordingGetRecordingsParamsStatus]` Query param: Filter by one or more recording status - `const RecordingGetRecordingsParamsStatusInvoked RecordingGetRecordingsParamsStatus = "INVOKED"` - `const RecordingGetRecordingsParamsStatusRecording RecordingGetRecordingsParamsStatus = "RECORDING"` - `const RecordingGetRecordingsParamsStatusUploading RecordingGetRecordingsParamsStatus = "UPLOADING"` - `const RecordingGetRecordingsParamsStatusUploaded RecordingGetRecordingsParamsStatus = "UPLOADED"` ### Returns - `type RecordingGetRecordingsResponse struct{…}` - `Data []RecordingGetRecordingsResponseData` - `ID string` ID of the recording - `AudioDownloadURL string` If the audio_config is passed, the URL for downloading the audio recording is returned. - `DownloadURL string` URL where the recording can be downloaded. - `DownloadURLExpiry Time` Timestamp when the download URL expires. - `FileSize float64` File size of the recording, in bytes. - `InvokedTime Time` Timestamp when this recording was invoked. - `OutputFileName string` File name of the recording. - `SessionID string` ID of the meeting session this recording is for. - `StartedTime Time` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `Status RecordingGetRecordingsResponseDataStatus` Current status of the recording. - `const RecordingGetRecordingsResponseDataStatusInvoked RecordingGetRecordingsResponseDataStatus = "INVOKED"` - `const RecordingGetRecordingsResponseDataStatusRecording RecordingGetRecordingsResponseDataStatus = "RECORDING"` - `const RecordingGetRecordingsResponseDataStatusUploading RecordingGetRecordingsResponseDataStatus = "UPLOADING"` - `const RecordingGetRecordingsResponseDataStatusUploaded RecordingGetRecordingsResponseDataStatus = "UPLOADED"` - `const RecordingGetRecordingsResponseDataStatusErrored RecordingGetRecordingsResponseDataStatus = "ERRORED"` - `const RecordingGetRecordingsResponseDataStatusPaused RecordingGetRecordingsResponseDataStatus = "PAUSED"` - `StoppedTime Time` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `Meeting RecordingGetRecordingsResponseDataMeeting` - `ID string` ID of the meeting. - `CreatedAt Time` Timestamp the object was created at. The time is returned in ISO format. - `UpdatedAt Time` Timestamp the object was updated at. The time is returned in ISO format. - `LiveStreamOnStart bool` Specifies if the meeting should start getting livestreamed on start. - `PersistChat bool` Specifies if Chat within a meeting should persist for a week. - `RecordOnStart bool` Specifies if the meeting should start getting recorded as soon as someone joins the meeting. - `SessionKeepAliveTimeInSecs float64` Time in seconds, for which a session remains active, after the last participant has left the meeting. - `Status RecordingGetRecordingsResponseDataMeetingStatus` Whether the meeting is `ACTIVE` or `INACTIVE`. Users will not be able to join an `INACTIVE` meeting. - `const RecordingGetRecordingsResponseDataMeetingStatusActive RecordingGetRecordingsResponseDataMeetingStatus = "ACTIVE"` - `const RecordingGetRecordingsResponseDataMeetingStatusInactive RecordingGetRecordingsResponseDataMeetingStatus = "INACTIVE"` - `SummarizeOnEnd bool` Automatically generate summary of meetings using transcripts. Requires Transcriptions to be enabled, and can be retrieved via Webhooks or summary API. - `Title string` Title of the meeting. - `RecordingDuration int64` Total recording time in seconds. - `StorageConfig RecordingGetRecordingsResponseDataStorageConfig` - `Type RecordingGetRecordingsResponseDataStorageConfigType` Type of storage media. - `const RecordingGetRecordingsResponseDataStorageConfigTypeAws RecordingGetRecordingsResponseDataStorageConfigType = "aws"` - `const RecordingGetRecordingsResponseDataStorageConfigTypeAzure RecordingGetRecordingsResponseDataStorageConfigType = "azure"` - `const RecordingGetRecordingsResponseDataStorageConfigTypeDigitalocean RecordingGetRecordingsResponseDataStorageConfigType = "digitalocean"` - `const RecordingGetRecordingsResponseDataStorageConfigTypeGcs RecordingGetRecordingsResponseDataStorageConfigType = "gcs"` - `const RecordingGetRecordingsResponseDataStorageConfigTypeSftp RecordingGetRecordingsResponseDataStorageConfigType = "sftp"` - `AccessKey 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. - `AuthMethod RecordingGetRecordingsResponseDataStorageConfigAuthMethod` Authentication method used for "sftp" type storage medium - `const RecordingGetRecordingsResponseDataStorageConfigAuthMethodKey RecordingGetRecordingsResponseDataStorageConfigAuthMethod = "KEY"` - `const RecordingGetRecordingsResponseDataStorageConfigAuthMethodPassword RecordingGetRecordingsResponseDataStorageConfigAuthMethod = "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 float64` SSH destination server port for SFTP type storage medium - `PrivateKey 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 - `Paging RecordingGetRecordingsResponsePaging` - `EndOffset float64` - `StartOffset float64` - `TotalCount float64` - `Success bool` ### Example ```go 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.GetRecordings( context.TODO(), "app_id", realtime_kit.RecordingGetRecordingsParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Data) } ``` #### Response ```json { "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", "meeting": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "updated_at": "2019-12-27T18:11:19.117Z", "live_stream_on_start": true, "persist_chat": true, "record_on_start": true, "session_keep_alive_time_in_secs": 60, "status": "ACTIVE", "summarize_on_end": true, "title": "title" }, "recording_duration": 0, "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" } } ], "paging": { "end_offset": 30, "start_offset": 1, "total_count": 30 }, "success": true } ``` ## 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. ### Parameters - `appID string` The app identifier tag. - `params RecordingStartRecordingsParams` - `AccountID param.Field[string]` Path param: The account identifier tag. - `AllowMultipleRecordings param.Field[bool]` 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]` Body param: Object containing configuration regarding the audio that is being recorded. - `Channel RecordingStartRecordingsParamsAudioConfigChannel` Audio signal pathway within an audio file that carries a specific sound source. - `const RecordingStartRecordingsParamsAudioConfigChannelMono RecordingStartRecordingsParamsAudioConfigChannel = "mono"` - `const RecordingStartRecordingsParamsAudioConfigChannelStereo RecordingStartRecordingsParamsAudioConfigChannel = "stereo"` - `Codec RecordingStartRecordingsParamsAudioConfigCodec` 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. - `const RecordingStartRecordingsParamsAudioConfigCodecMP3 RecordingStartRecordingsParamsAudioConfigCodec = "MP3"` - `const RecordingStartRecordingsParamsAudioConfigCodecAac RecordingStartRecordingsParamsAudioConfigCodec = "AAC"` - `ExportFile bool` Controls whether to export audio file seperately - `FileNamePrefix param.Field[string]` Body param: Update the recording file name. - `InteractiveConfig param.Field[RecordingStartRecordingsParamsInteractiveConfig]` 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 RecordingStartRecordingsParamsInteractiveConfigType` The metadata is presented in the form of ID3 tags. - `const RecordingStartRecordingsParamsInteractiveConfigTypeId3 RecordingStartRecordingsParamsInteractiveConfigType = "ID3"` - `MaxSeconds param.Field[int64]` Body param: Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours. - `MeetingID param.Field[string]` Body param: ID of the meeting to record. - `RealtimekitBucketConfig param.Field[RecordingStartRecordingsParamsRealtimekitBucketConfig]` 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]` Body param - `RtmpURL string` RTMP URL to stream to - `StorageConfig param.Field[RecordingStartRecordingsParamsStorageConfig]` Body param - `Type RecordingStartRecordingsParamsStorageConfigType` Type of storage media. - `const RecordingStartRecordingsParamsStorageConfigTypeAws RecordingStartRecordingsParamsStorageConfigType = "aws"` - `const RecordingStartRecordingsParamsStorageConfigTypeAzure RecordingStartRecordingsParamsStorageConfigType = "azure"` - `const RecordingStartRecordingsParamsStorageConfigTypeDigitalocean RecordingStartRecordingsParamsStorageConfigType = "digitalocean"` - `const RecordingStartRecordingsParamsStorageConfigTypeGcs RecordingStartRecordingsParamsStorageConfigType = "gcs"` - `const RecordingStartRecordingsParamsStorageConfigTypeSftp RecordingStartRecordingsParamsStorageConfigType = "sftp"` - `AccessKey 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. - `AuthMethod RecordingStartRecordingsParamsStorageConfigAuthMethod` Authentication method used for "sftp" type storage medium - `const RecordingStartRecordingsParamsStorageConfigAuthMethodKey RecordingStartRecordingsParamsStorageConfigAuthMethod = "KEY"` - `const RecordingStartRecordingsParamsStorageConfigAuthMethodPassword RecordingStartRecordingsParamsStorageConfigAuthMethod = "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 float64` SSH destination server port for SFTP type storage medium - `PrivateKey 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 - `URL param.Field[string]` Body param: Pass a custom url to record arbitary screen - `VideoConfig param.Field[RecordingStartRecordingsParamsVideoConfig]` Body param - `Codec RecordingStartRecordingsParamsVideoConfigCodec` Codec using which the recording will be encoded. - `const RecordingStartRecordingsParamsVideoConfigCodecH264 RecordingStartRecordingsParamsVideoConfigCodec = "H264"` - `const RecordingStartRecordingsParamsVideoConfigCodecVp8 RecordingStartRecordingsParamsVideoConfigCodec = "VP8"` - `ExportFile bool` Controls whether to export video file seperately - `Height int64` Height of the recording video in pixels - `Watermark RecordingStartRecordingsParamsVideoConfigWatermark` Watermark to be added to the recording - `Position RecordingStartRecordingsParamsVideoConfigWatermarkPosition` Position of the watermark - `const RecordingStartRecordingsParamsVideoConfigWatermarkPositionLeftTop RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "left top"` - `const RecordingStartRecordingsParamsVideoConfigWatermarkPositionRightTop RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "right top"` - `const RecordingStartRecordingsParamsVideoConfigWatermarkPositionLeftBottom RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "left bottom"` - `const RecordingStartRecordingsParamsVideoConfigWatermarkPositionRightBottom RecordingStartRecordingsParamsVideoConfigWatermarkPosition = "right bottom"` - `Size RecordingStartRecordingsParamsVideoConfigWatermarkSize` Size of the watermark - `Height int64` Height of the watermark in px - `Width int64` Width of the watermark in px - `URL string` URL of the watermark image - `Width int64` Width of the recording video in pixels ### Returns - `type RecordingStartRecordingsResponse struct{…}` - `Success bool` Success status of the operation - `Data RecordingStartRecordingsResponseData` Data returned by the operation - `ID string` ID of the recording - `AudioDownloadURL string` If the audio_config is passed, the URL for downloading the audio recording is returned. - `DownloadURL string` URL where the recording can be downloaded. - `DownloadURLExpiry Time` Timestamp when the download URL expires. - `FileSize float64` File size of the recording, in bytes. - `InvokedTime Time` Timestamp when this recording was invoked. - `OutputFileName string` File name of the recording. - `SessionID string` ID of the meeting session this recording is for. - `StartedTime Time` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `Status RecordingStartRecordingsResponseDataStatus` Current status of the recording. - `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. - `RecordingDuration int64` Total recording time in seconds. - `StartReason RecordingStartRecordingsResponseDataStartReason` - `Caller RecordingStartRecordingsResponseDataStartReasonCaller` - `Name string` Name of the user who started the recording. - `Type RecordingStartRecordingsResponseDataStartReasonCallerType` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `const RecordingStartRecordingsResponseDataStartReasonCallerTypeOrganization RecordingStartRecordingsResponseDataStartReasonCallerType = "ORGANIZATION"` - `const RecordingStartRecordingsResponseDataStartReasonCallerTypeUser RecordingStartRecordingsResponseDataStartReasonCallerType = "USER"` - `UserID string` The user ID of the person who started the recording. - `Reason RecordingStartRecordingsResponseDataStartReasonReason` 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. - `const RecordingStartRecordingsResponseDataStartReasonReasonAPICall RecordingStartRecordingsResponseDataStartReasonReason = "API_CALL"` - `const RecordingStartRecordingsResponseDataStartReasonReasonRecordOnStart RecordingStartRecordingsResponseDataStartReasonReason = "RECORD_ON_START"` - `StopReason RecordingStartRecordingsResponseDataStopReason` - `Caller RecordingStartRecordingsResponseDataStopReasonCaller` - `Name string` Name of the user who stopped the recording. - `Type RecordingStartRecordingsResponseDataStopReasonCallerType` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `const RecordingStartRecordingsResponseDataStopReasonCallerTypeOrganization RecordingStartRecordingsResponseDataStopReasonCallerType = "ORGANIZATION"` - `const RecordingStartRecordingsResponseDataStopReasonCallerTypeUser RecordingStartRecordingsResponseDataStopReasonCallerType = "USER"` - `UserID string` The user ID of the person who stopped the recording. - `Reason RecordingStartRecordingsResponseDataStopReasonReason` Specifies the reason why the recording stopped. - `const RecordingStartRecordingsResponseDataStopReasonReasonAPICall RecordingStartRecordingsResponseDataStopReasonReason = "API_CALL"` - `const RecordingStartRecordingsResponseDataStopReasonReasonInternalError RecordingStartRecordingsResponseDataStopReasonReason = "INTERNAL_ERROR"` - `const RecordingStartRecordingsResponseDataStopReasonReasonAllPeersLeft RecordingStartRecordingsResponseDataStopReasonReason = "ALL_PEERS_LEFT"` - `StorageConfig RecordingStartRecordingsResponseDataStorageConfig` - `Type RecordingStartRecordingsResponseDataStorageConfigType` Type of storage media. - `const RecordingStartRecordingsResponseDataStorageConfigTypeAws RecordingStartRecordingsResponseDataStorageConfigType = "aws"` - `const RecordingStartRecordingsResponseDataStorageConfigTypeAzure RecordingStartRecordingsResponseDataStorageConfigType = "azure"` - `const RecordingStartRecordingsResponseDataStorageConfigTypeDigitalocean RecordingStartRecordingsResponseDataStorageConfigType = "digitalocean"` - `const RecordingStartRecordingsResponseDataStorageConfigTypeGcs RecordingStartRecordingsResponseDataStorageConfigType = "gcs"` - `const RecordingStartRecordingsResponseDataStorageConfigTypeSftp RecordingStartRecordingsResponseDataStorageConfigType = "sftp"` - `AccessKey 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. - `AuthMethod RecordingStartRecordingsResponseDataStorageConfigAuthMethod` Authentication method used for "sftp" type storage medium - `const RecordingStartRecordingsResponseDataStorageConfigAuthMethodKey RecordingStartRecordingsResponseDataStorageConfigAuthMethod = "KEY"` - `const RecordingStartRecordingsResponseDataStorageConfigAuthMethodPassword RecordingStartRecordingsResponseDataStorageConfigAuthMethod = "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 float64` SSH destination server port for SFTP type storage medium - `PrivateKey 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 ### Example ```go 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) } ``` #### Response ```json { "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" } } } ``` ## Fetch active recording `client.RealtimeKit.Recordings.GetActiveRecordings(ctx, appID, meetingID, query) (*RecordingGetActiveRecordingsResponse, error)` **get** `/accounts/{account_id}/realtime/kit/{app_id}/recordings/active-recording/{meeting_id}` Returns the active recording details for the given meeting ID. ### Parameters - `appID string` The app identifier tag. - `meetingID string` - `query RecordingGetActiveRecordingsParams` - `AccountID param.Field[string]` The account identifier tag. ### Returns - `type RecordingGetActiveRecordingsResponse struct{…}` - `Data RecordingGetActiveRecordingsResponseData` Data returned by the operation - `ID string` ID of the recording - `AudioDownloadURL string` If the audio_config is passed, the URL for downloading the audio recording is returned. - `DownloadURL string` URL where the recording can be downloaded. - `DownloadURLExpiry Time` Timestamp when the download URL expires. - `FileSize float64` File size of the recording, in bytes. - `InvokedTime Time` Timestamp when this recording was invoked. - `OutputFileName string` File name of the recording. - `SessionID string` ID of the meeting session this recording is for. - `StartedTime Time` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `Status RecordingGetActiveRecordingsResponseDataStatus` Current status of the recording. - `const RecordingGetActiveRecordingsResponseDataStatusInvoked RecordingGetActiveRecordingsResponseDataStatus = "INVOKED"` - `const RecordingGetActiveRecordingsResponseDataStatusRecording RecordingGetActiveRecordingsResponseDataStatus = "RECORDING"` - `const RecordingGetActiveRecordingsResponseDataStatusUploading RecordingGetActiveRecordingsResponseDataStatus = "UPLOADING"` - `const RecordingGetActiveRecordingsResponseDataStatusUploaded RecordingGetActiveRecordingsResponseDataStatus = "UPLOADED"` - `const RecordingGetActiveRecordingsResponseDataStatusErrored RecordingGetActiveRecordingsResponseDataStatus = "ERRORED"` - `const RecordingGetActiveRecordingsResponseDataStatusPaused RecordingGetActiveRecordingsResponseDataStatus = "PAUSED"` - `StoppedTime Time` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `RecordingDuration int64` Total recording time in seconds. - `Success bool` Success status of the operation ### Example ```go 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.GetActiveRecordings( context.TODO(), "app_id", "meeting_id", realtime_kit.RecordingGetActiveRecordingsParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Data) } ``` #### Response ```json { "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 }, "success": true } ``` ## Fetch details of a recording `client.RealtimeKit.Recordings.GetOneRecording(ctx, appID, recordingID, query) (*RecordingGetOneRecordingResponse, error)` **get** `/accounts/{account_id}/realtime/kit/{app_id}/recordings/{recording_id}` Returns details of a recording for the given recording ID. ### Parameters - `appID string` The app identifier tag. - `recordingID string` - `query RecordingGetOneRecordingParams` - `AccountID param.Field[string]` The account identifier tag. ### Returns - `type RecordingGetOneRecordingResponse struct{…}` - `Success bool` Success status of the operation - `Data RecordingGetOneRecordingResponseData` Data returned by the operation - `ID string` ID of the recording - `AudioDownloadURL string` If the audio_config is passed, the URL for downloading the audio recording is returned. - `DownloadURL string` URL where the recording can be downloaded. - `DownloadURLExpiry Time` Timestamp when the download URL expires. - `FileSize float64` File size of the recording, in bytes. - `InvokedTime Time` Timestamp when this recording was invoked. - `OutputFileName string` File name of the recording. - `SessionID string` ID of the meeting session this recording is for. - `StartedTime Time` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `Status RecordingGetOneRecordingResponseDataStatus` Current status of the recording. - `const RecordingGetOneRecordingResponseDataStatusInvoked RecordingGetOneRecordingResponseDataStatus = "INVOKED"` - `const RecordingGetOneRecordingResponseDataStatusRecording RecordingGetOneRecordingResponseDataStatus = "RECORDING"` - `const RecordingGetOneRecordingResponseDataStatusUploading RecordingGetOneRecordingResponseDataStatus = "UPLOADING"` - `const RecordingGetOneRecordingResponseDataStatusUploaded RecordingGetOneRecordingResponseDataStatus = "UPLOADED"` - `const RecordingGetOneRecordingResponseDataStatusErrored RecordingGetOneRecordingResponseDataStatus = "ERRORED"` - `const RecordingGetOneRecordingResponseDataStatusPaused RecordingGetOneRecordingResponseDataStatus = "PAUSED"` - `StoppedTime Time` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `RecordingDuration int64` Total recording time in seconds. - `StartReason RecordingGetOneRecordingResponseDataStartReason` - `Caller RecordingGetOneRecordingResponseDataStartReasonCaller` - `Name string` Name of the user who started the recording. - `Type RecordingGetOneRecordingResponseDataStartReasonCallerType` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `const RecordingGetOneRecordingResponseDataStartReasonCallerTypeOrganization RecordingGetOneRecordingResponseDataStartReasonCallerType = "ORGANIZATION"` - `const RecordingGetOneRecordingResponseDataStartReasonCallerTypeUser RecordingGetOneRecordingResponseDataStartReasonCallerType = "USER"` - `UserID string` The user ID of the person who started the recording. - `Reason RecordingGetOneRecordingResponseDataStartReasonReason` 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. - `const RecordingGetOneRecordingResponseDataStartReasonReasonAPICall RecordingGetOneRecordingResponseDataStartReasonReason = "API_CALL"` - `const RecordingGetOneRecordingResponseDataStartReasonReasonRecordOnStart RecordingGetOneRecordingResponseDataStartReasonReason = "RECORD_ON_START"` - `StopReason RecordingGetOneRecordingResponseDataStopReason` - `Caller RecordingGetOneRecordingResponseDataStopReasonCaller` - `Name string` Name of the user who stopped the recording. - `Type RecordingGetOneRecordingResponseDataStopReasonCallerType` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `const RecordingGetOneRecordingResponseDataStopReasonCallerTypeOrganization RecordingGetOneRecordingResponseDataStopReasonCallerType = "ORGANIZATION"` - `const RecordingGetOneRecordingResponseDataStopReasonCallerTypeUser RecordingGetOneRecordingResponseDataStopReasonCallerType = "USER"` - `UserID string` The user ID of the person who stopped the recording. - `Reason RecordingGetOneRecordingResponseDataStopReasonReason` Specifies the reason why the recording stopped. - `const RecordingGetOneRecordingResponseDataStopReasonReasonAPICall RecordingGetOneRecordingResponseDataStopReasonReason = "API_CALL"` - `const RecordingGetOneRecordingResponseDataStopReasonReasonInternalError RecordingGetOneRecordingResponseDataStopReasonReason = "INTERNAL_ERROR"` - `const RecordingGetOneRecordingResponseDataStopReasonReasonAllPeersLeft RecordingGetOneRecordingResponseDataStopReasonReason = "ALL_PEERS_LEFT"` - `StorageConfig RecordingGetOneRecordingResponseDataStorageConfig` - `Type RecordingGetOneRecordingResponseDataStorageConfigType` Type of storage media. - `const RecordingGetOneRecordingResponseDataStorageConfigTypeAws RecordingGetOneRecordingResponseDataStorageConfigType = "aws"` - `const RecordingGetOneRecordingResponseDataStorageConfigTypeAzure RecordingGetOneRecordingResponseDataStorageConfigType = "azure"` - `const RecordingGetOneRecordingResponseDataStorageConfigTypeDigitalocean RecordingGetOneRecordingResponseDataStorageConfigType = "digitalocean"` - `const RecordingGetOneRecordingResponseDataStorageConfigTypeGcs RecordingGetOneRecordingResponseDataStorageConfigType = "gcs"` - `const RecordingGetOneRecordingResponseDataStorageConfigTypeSftp RecordingGetOneRecordingResponseDataStorageConfigType = "sftp"` - `AccessKey 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. - `AuthMethod RecordingGetOneRecordingResponseDataStorageConfigAuthMethod` Authentication method used for "sftp" type storage medium - `const RecordingGetOneRecordingResponseDataStorageConfigAuthMethodKey RecordingGetOneRecordingResponseDataStorageConfigAuthMethod = "KEY"` - `const RecordingGetOneRecordingResponseDataStorageConfigAuthMethodPassword RecordingGetOneRecordingResponseDataStorageConfigAuthMethod = "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 float64` SSH destination server port for SFTP type storage medium - `PrivateKey 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 ### Example ```go 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.GetOneRecording( context.TODO(), "app_id", "recording_id", realtime_kit.RecordingGetOneRecordingParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Success) } ``` #### Response ```json { "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" } } } ``` ## Pause/Resume/Stop recording `client.RealtimeKit.Recordings.PauseResumeStopRecording(ctx, appID, recordingID, params) (*RecordingPauseResumeStopRecordingResponse, error)` **put** `/accounts/{account_id}/realtime/kit/{app_id}/recordings/{recording_id}` Pause/Resume/Stop a given recording ID. ### Parameters - `appID string` - `recordingID string` - `params RecordingPauseResumeStopRecordingParams` - `AccountID param.Field[string]` Path param: The account identifier tag. - `Action param.Field[RecordingPauseResumeStopRecordingParamsAction]` Body param - `const RecordingPauseResumeStopRecordingParamsActionStop RecordingPauseResumeStopRecordingParamsAction = "stop"` - `const RecordingPauseResumeStopRecordingParamsActionPause RecordingPauseResumeStopRecordingParamsAction = "pause"` - `const RecordingPauseResumeStopRecordingParamsActionResume RecordingPauseResumeStopRecordingParamsAction = "resume"` ### Returns - `type RecordingPauseResumeStopRecordingResponse struct{…}` - `Success bool` Success status of the operation - `Data RecordingPauseResumeStopRecordingResponseData` Data returned by the operation - `ID string` ID of the recording - `AudioDownloadURL string` If the audio_config is passed, the URL for downloading the audio recording is returned. - `DownloadURL string` URL where the recording can be downloaded. - `DownloadURLExpiry Time` Timestamp when the download URL expires. - `FileSize float64` File size of the recording, in bytes. - `InvokedTime Time` Timestamp when this recording was invoked. - `OutputFileName string` File name of the recording. - `SessionID string` ID of the meeting session this recording is for. - `StartedTime Time` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `Status RecordingPauseResumeStopRecordingResponseDataStatus` Current status of the recording. - `const RecordingPauseResumeStopRecordingResponseDataStatusInvoked RecordingPauseResumeStopRecordingResponseDataStatus = "INVOKED"` - `const RecordingPauseResumeStopRecordingResponseDataStatusRecording RecordingPauseResumeStopRecordingResponseDataStatus = "RECORDING"` - `const RecordingPauseResumeStopRecordingResponseDataStatusUploading RecordingPauseResumeStopRecordingResponseDataStatus = "UPLOADING"` - `const RecordingPauseResumeStopRecordingResponseDataStatusUploaded RecordingPauseResumeStopRecordingResponseDataStatus = "UPLOADED"` - `const RecordingPauseResumeStopRecordingResponseDataStatusErrored RecordingPauseResumeStopRecordingResponseDataStatus = "ERRORED"` - `const RecordingPauseResumeStopRecordingResponseDataStatusPaused RecordingPauseResumeStopRecordingResponseDataStatus = "PAUSED"` - `StoppedTime Time` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `RecordingDuration int64` Total recording time in seconds. - `StartReason RecordingPauseResumeStopRecordingResponseDataStartReason` - `Caller RecordingPauseResumeStopRecordingResponseDataStartReasonCaller` - `Name string` Name of the user who started the recording. - `Type RecordingPauseResumeStopRecordingResponseDataStartReasonCallerType` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `const RecordingPauseResumeStopRecordingResponseDataStartReasonCallerTypeOrganization RecordingPauseResumeStopRecordingResponseDataStartReasonCallerType = "ORGANIZATION"` - `const RecordingPauseResumeStopRecordingResponseDataStartReasonCallerTypeUser RecordingPauseResumeStopRecordingResponseDataStartReasonCallerType = "USER"` - `UserID string` The user ID of the person who started the recording. - `Reason RecordingPauseResumeStopRecordingResponseDataStartReasonReason` 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. - `const RecordingPauseResumeStopRecordingResponseDataStartReasonReasonAPICall RecordingPauseResumeStopRecordingResponseDataStartReasonReason = "API_CALL"` - `const RecordingPauseResumeStopRecordingResponseDataStartReasonReasonRecordOnStart RecordingPauseResumeStopRecordingResponseDataStartReasonReason = "RECORD_ON_START"` - `StopReason RecordingPauseResumeStopRecordingResponseDataStopReason` - `Caller RecordingPauseResumeStopRecordingResponseDataStopReasonCaller` - `Name string` Name of the user who stopped the recording. - `Type RecordingPauseResumeStopRecordingResponseDataStopReasonCallerType` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `const RecordingPauseResumeStopRecordingResponseDataStopReasonCallerTypeOrganization RecordingPauseResumeStopRecordingResponseDataStopReasonCallerType = "ORGANIZATION"` - `const RecordingPauseResumeStopRecordingResponseDataStopReasonCallerTypeUser RecordingPauseResumeStopRecordingResponseDataStopReasonCallerType = "USER"` - `UserID string` The user ID of the person who stopped the recording. - `Reason RecordingPauseResumeStopRecordingResponseDataStopReasonReason` Specifies the reason why the recording stopped. - `const RecordingPauseResumeStopRecordingResponseDataStopReasonReasonAPICall RecordingPauseResumeStopRecordingResponseDataStopReasonReason = "API_CALL"` - `const RecordingPauseResumeStopRecordingResponseDataStopReasonReasonInternalError RecordingPauseResumeStopRecordingResponseDataStopReasonReason = "INTERNAL_ERROR"` - `const RecordingPauseResumeStopRecordingResponseDataStopReasonReasonAllPeersLeft RecordingPauseResumeStopRecordingResponseDataStopReasonReason = "ALL_PEERS_LEFT"` - `StorageConfig RecordingPauseResumeStopRecordingResponseDataStorageConfig` - `Type RecordingPauseResumeStopRecordingResponseDataStorageConfigType` Type of storage media. - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeAws RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "aws"` - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeAzure RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "azure"` - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeDigitalocean RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "digitalocean"` - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeGcs RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "gcs"` - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeSftp RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "sftp"` - `AccessKey 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. - `AuthMethod RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethod` Authentication method used for "sftp" type storage medium - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethodKey RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethod = "KEY"` - `const RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethodPassword RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethod = "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 float64` SSH destination server port for SFTP type storage medium - `PrivateKey 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 ### Example ```go 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.PauseResumeStopRecording( context.TODO(), "2a95132c15732412d22c1476fa83f27a", "recording_id", realtime_kit.RecordingPauseResumeStopRecordingParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Action: cloudflare.F(realtime_kit.RecordingPauseResumeStopRecordingParamsActionStop), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Success) } ``` #### Response ```json { "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" } } } ``` ## Start recording audio and video tracks `client.RealtimeKit.Recordings.StartTrackRecording(ctx, appID, params) error` **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](https://docs.realtime.cloudflare.com/guides/capabilities/recording/recording-overview). ### Parameters - `appID string` The app identifier tag. - `params RecordingStartTrackRecordingParams` - `AccountID param.Field[string]` Path param: The account identifier tag. - `Layers param.Field[map[string, RecordingStartTrackRecordingParamsLayers]]` Body param - `FileNamePrefix string` A file name prefix to apply for files generated from this layer - `Outputs []RecordingStartTrackRecordingParamsLayersOutput` - `StorageConfig RecordingStartTrackRecordingParamsLayersOutputsStorageConfig` - `Type RecordingStartTrackRecordingParamsLayersOutputsStorageConfigType` Type of storage media. - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigTypeAws RecordingStartTrackRecordingParamsLayersOutputsStorageConfigType = "aws"` - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigTypeAzure RecordingStartTrackRecordingParamsLayersOutputsStorageConfigType = "azure"` - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigTypeDigitalocean RecordingStartTrackRecordingParamsLayersOutputsStorageConfigType = "digitalocean"` - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigTypeGcs RecordingStartTrackRecordingParamsLayersOutputsStorageConfigType = "gcs"` - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigTypeSftp RecordingStartTrackRecordingParamsLayersOutputsStorageConfigType = "sftp"` - `AccessKey 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. - `AuthMethod RecordingStartTrackRecordingParamsLayersOutputsStorageConfigAuthMethod` Authentication method used for "sftp" type storage medium - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigAuthMethodKey RecordingStartTrackRecordingParamsLayersOutputsStorageConfigAuthMethod = "KEY"` - `const RecordingStartTrackRecordingParamsLayersOutputsStorageConfigAuthMethodPassword RecordingStartTrackRecordingParamsLayersOutputsStorageConfigAuthMethod = "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 float64` SSH destination server port for SFTP type storage medium - `PrivateKey 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 RecordingStartTrackRecordingParamsLayersOutputsType` The type of output destination this layer is being exported to. - `const RecordingStartTrackRecordingParamsLayersOutputsTypeRealtimekitBucket RecordingStartTrackRecordingParamsLayersOutputsType = "REALTIMEKIT_BUCKET"` - `const RecordingStartTrackRecordingParamsLayersOutputsTypeStorageConfig RecordingStartTrackRecordingParamsLayersOutputsType = "STORAGE_CONFIG"` - `MeetingID param.Field[string]` Body param: ID of the meeting to record. - `MaxSeconds param.Field[float64]` Body param: Maximum seconds this recording should be active for (beta) ### Example ```go package main import ( "context" "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"), ) err := client.RealtimeKit.Recordings.StartTrackRecording( context.TODO(), "app_id", realtime_kit.RecordingStartTrackRecordingParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Layers: cloudflare.F(map[string]realtime_kit.RecordingStartTrackRecordingParamsLayers{ "default": realtime_kit.RecordingStartTrackRecordingParamsLayers{ FileNamePrefix: cloudflare.F("string"), Outputs: cloudflare.F([]realtime_kit.RecordingStartTrackRecordingParamsLayersOutput{realtime_kit.RecordingStartTrackRecordingParamsLayersOutput{ Type: cloudflare.F(realtime_kit.RecordingStartTrackRecordingParamsLayersOutputsTypeRealtimekitBucket), }}), }, "default-video": realtime_kit.RecordingStartTrackRecordingParamsLayers{ FileNamePrefix: cloudflare.F("string"), Outputs: cloudflare.F([]realtime_kit.RecordingStartTrackRecordingParamsLayersOutput{realtime_kit.RecordingStartTrackRecordingParamsLayersOutput{ Type: cloudflare.F(realtime_kit.RecordingStartTrackRecordingParamsLayersOutputsTypeRealtimekitBucket), }}), }, }), MeetingID: cloudflare.F("string"), MaxSeconds: cloudflare.F(60.000000), }, ) if err != nil { panic(err.Error()) } } ```