# Recordings ## Fetch all recordings for an App `client.realtimeKit.recordings.getRecordings(stringappId, RecordingGetRecordingsParamsparams, RequestOptionsoptions?): RecordingGetRecordingsResponse` **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` - `account_id: string` Path param: The account identifier tag. - `end_time?: string` Query param: The end time range for which you want to retrieve the meetings. The time must be specified in ISO format. - `expired?: boolean` Query param: If passed, only shows expired/non-expired recordings on RealtimeKit's bucket - `meeting_id?: string` Query param: ID of a meeting. Optional. Will limit results to only this meeting if passed. - `page_no?: number` Query param: The page number from which you want your page search results to be displayed. - `per_page?: number` Query param: Number of results per page - `search?: string` Query param: The search query string. You can search using the meeting ID or title. - `sort_by?: "invokedTime"` Query param - `"invokedTime"` - `sort_order?: "ASC" | "DESC"` Query param - `"ASC"` - `"DESC"` - `start_time?: string` Query param: The start time range for which you want to retrieve the meetings. The time must be specified in ISO format. - `status?: Array<"INVOKED" | "RECORDING" | "UPLOADING" | "UPLOADED">` Query param: Filter by one or more recording status - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` ### Returns - `RecordingGetRecordingsResponse` - `data: Array` - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `meeting?: Meeting` - `id: string` ID of the meeting. - `created_at: string` Timestamp the object was created at. The time is returned in ISO format. - `updated_at: string` Timestamp the object was updated at. The time is returned in ISO format. - `live_stream_on_start?: boolean` Specifies if the meeting should start getting livestreamed on start. - `persist_chat?: boolean` Specifies if Chat within a meeting should persist for a week. - `record_on_start?: boolean` Specifies if the meeting should start getting recorded as soon as someone joins the meeting. - `session_keep_alive_time_in_secs?: number` Time in seconds, for which a session remains active, after the last participant has left the meeting. - `status?: "ACTIVE" | "INACTIVE"` Whether the meeting is `ACTIVE` or `INACTIVE`. Users will not be able to join an `INACTIVE` meeting. - `"ACTIVE"` - `"INACTIVE"` - `summarize_on_end?: boolean` 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. - `recording_duration?: number` Total recording time in seconds. - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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: Paging` - `end_offset: number` - `start_offset: number` - `total_count: number` - `success: boolean` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.realtimeKit.recordings.getRecordings('app_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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(stringappId, RecordingStartRecordingsParamsparams, RequestOptionsoptions?): RecordingStartRecordingsResponse` **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` - `account_id: string` Path param: The account identifier tag. - `allow_multiple_recordings?: boolean` 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. - `audio_config?: AudioConfig` Body param: Object containing configuration regarding the audio that is being recorded. - `channel?: "mono" | "stereo"` Audio signal pathway within an audio file that carries a specific sound source. - `"mono"` - `"stereo"` - `codec?: "MP3" | "AAC"` 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. - `"MP3"` - `"AAC"` - `export_file?: boolean` Controls whether to export audio file seperately - `file_name_prefix?: string` Body param: Update the recording file name. - `interactive_config?: InteractiveConfig` 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?: "ID3"` The metadata is presented in the form of ID3 tags. - `"ID3"` - `max_seconds?: number` Body param: Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours. - `meeting_id?: string` Body param: ID of the meeting to record. - `realtimekit_bucket_config?: RealtimekitBucketConfig` Body param - `enabled: boolean` 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. - `rtmp_out_config?: RtmpOutConfig` Body param - `rtmp_url?: string` RTMP URL to stream to - `storage_config?: StorageConfig | null` Body param - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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?: string` Body param: Pass a custom url to record arbitary screen - `video_config?: VideoConfig` Body param - `codec?: "H264" | "VP8"` Codec using which the recording will be encoded. - `"H264"` - `"VP8"` - `export_file?: boolean` Controls whether to export video file seperately - `height?: number` Height of the recording video in pixels - `watermark?: Watermark` Watermark to be added to the recording - `position?: "left top" | "right top" | "left bottom" | "right bottom"` Position of the watermark - `"left top"` - `"right top"` - `"left bottom"` - `"right bottom"` - `size?: Size` Size of the watermark - `height?: number` Height of the watermark in px - `width?: number` Width of the watermark in px - `url?: string` URL of the watermark image - `width?: number` Width of the recording video in pixels ### Returns - `RecordingStartRecordingsResponse` - `success: boolean` Success status of the operation - `data?: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `start_reason?: StartReason` - `caller?: Caller` - `name?: string` Name of the user who started the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who started the recording. - `reason?: "API_CALL" | "RECORD_ON_START"` 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. - `"API_CALL"` - `"RECORD_ON_START"` - `stop_reason?: StopReason` - `caller?: Caller` - `name?: string` Name of the user who stopped the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who stopped the recording. - `reason?: "API_CALL" | "INTERNAL_ERROR" | "ALL_PEERS_LEFT"` Specifies the reason why the recording stopped. - `"API_CALL"` - `"INTERNAL_ERROR"` - `"ALL_PEERS_LEFT"` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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 ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.realtimeKit.recordings.startRecordings('app_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', audio_config: { channel: 'stereo', codec: 'AAC', export_file: true, }, file_name_prefix: 'string', interactive_config: { type: 'ID3' }, max_seconds: 60, meeting_id: '97440c6a-140b-40a9-9499-b23fd7a3868a', realtimekit_bucket_config: { enabled: true }, video_config: { codec: 'H264', export_file: true, height: 720, watermark: { position: 'left top', size: { height: 1, width: 1 }, url: 'http://example.com', }, width: 1280, }, }); console.log(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(stringappId, stringmeetingId, RecordingGetActiveRecordingsParamsparams, RequestOptionsoptions?): RecordingGetActiveRecordingsResponse` **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` - `params: RecordingGetActiveRecordingsParams` - `account_id: string` The account identifier tag. ### Returns - `RecordingGetActiveRecordingsResponse` - `data: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `success: boolean` Success status of the operation ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.realtimeKit.recordings.getActiveRecordings('app_id', 'meeting_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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(stringappId, stringrecordingId, RecordingGetOneRecordingParamsparams, RequestOptionsoptions?): RecordingGetOneRecordingResponse` **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` - `params: RecordingGetOneRecordingParams` - `account_id: string` The account identifier tag. ### Returns - `RecordingGetOneRecordingResponse` - `success: boolean` Success status of the operation - `data?: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `start_reason?: StartReason` - `caller?: Caller` - `name?: string` Name of the user who started the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who started the recording. - `reason?: "API_CALL" | "RECORD_ON_START"` 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. - `"API_CALL"` - `"RECORD_ON_START"` - `stop_reason?: StopReason` - `caller?: Caller` - `name?: string` Name of the user who stopped the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who stopped the recording. - `reason?: "API_CALL" | "INTERNAL_ERROR" | "ALL_PEERS_LEFT"` Specifies the reason why the recording stopped. - `"API_CALL"` - `"INTERNAL_ERROR"` - `"ALL_PEERS_LEFT"` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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 ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.realtimeKit.recordings.getOneRecording('app_id', 'recording_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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(stringappId, stringrecordingId, RecordingPauseResumeStopRecordingParamsparams, RequestOptionsoptions?): RecordingPauseResumeStopRecordingResponse` **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` - `account_id: string` Path param: The account identifier tag. - `action: "stop" | "pause" | "resume"` Body param - `"stop"` - `"pause"` - `"resume"` ### Returns - `RecordingPauseResumeStopRecordingResponse` - `success: boolean` Success status of the operation - `data?: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `start_reason?: StartReason` - `caller?: Caller` - `name?: string` Name of the user who started the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who started the recording. - `reason?: "API_CALL" | "RECORD_ON_START"` 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. - `"API_CALL"` - `"RECORD_ON_START"` - `stop_reason?: StopReason` - `caller?: Caller` - `name?: string` Name of the user who stopped the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who stopped the recording. - `reason?: "API_CALL" | "INTERNAL_ERROR" | "ALL_PEERS_LEFT"` Specifies the reason why the recording stopped. - `"API_CALL"` - `"INTERNAL_ERROR"` - `"ALL_PEERS_LEFT"` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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 ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.realtimeKit.recordings.pauseResumeStopRecording( '2a95132c15732412d22c1476fa83f27a', 'recording_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', action: 'stop' }, ); console.log(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(stringappId, RecordingStartTrackRecordingParamsparams, RequestOptionsoptions?): void` **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` - `account_id: string` Path param: The account identifier tag. - `layers: Record` Body param - `file_name_prefix?: string` A file name prefix to apply for files generated from this layer - `outputs?: Array` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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?: "REALTIMEKIT_BUCKET" | "STORAGE_CONFIG"` The type of output destination this layer is being exported to. - `"REALTIMEKIT_BUCKET"` - `"STORAGE_CONFIG"` - `meeting_id: string` Body param: ID of the meeting to record. - `max_seconds?: number` Body param: Maximum seconds this recording should be active for (beta) ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); await client.realtimeKit.recordings.startTrackRecording('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, }); ``` ## Domain Types ### Recording Get Recordings Response - `RecordingGetRecordingsResponse` - `data: Array` - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `meeting?: Meeting` - `id: string` ID of the meeting. - `created_at: string` Timestamp the object was created at. The time is returned in ISO format. - `updated_at: string` Timestamp the object was updated at. The time is returned in ISO format. - `live_stream_on_start?: boolean` Specifies if the meeting should start getting livestreamed on start. - `persist_chat?: boolean` Specifies if Chat within a meeting should persist for a week. - `record_on_start?: boolean` Specifies if the meeting should start getting recorded as soon as someone joins the meeting. - `session_keep_alive_time_in_secs?: number` Time in seconds, for which a session remains active, after the last participant has left the meeting. - `status?: "ACTIVE" | "INACTIVE"` Whether the meeting is `ACTIVE` or `INACTIVE`. Users will not be able to join an `INACTIVE` meeting. - `"ACTIVE"` - `"INACTIVE"` - `summarize_on_end?: boolean` 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. - `recording_duration?: number` Total recording time in seconds. - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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: Paging` - `end_offset: number` - `start_offset: number` - `total_count: number` - `success: boolean` ### Recording Start Recordings Response - `RecordingStartRecordingsResponse` - `success: boolean` Success status of the operation - `data?: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `start_reason?: StartReason` - `caller?: Caller` - `name?: string` Name of the user who started the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who started the recording. - `reason?: "API_CALL" | "RECORD_ON_START"` 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. - `"API_CALL"` - `"RECORD_ON_START"` - `stop_reason?: StopReason` - `caller?: Caller` - `name?: string` Name of the user who stopped the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who stopped the recording. - `reason?: "API_CALL" | "INTERNAL_ERROR" | "ALL_PEERS_LEFT"` Specifies the reason why the recording stopped. - `"API_CALL"` - `"INTERNAL_ERROR"` - `"ALL_PEERS_LEFT"` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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 ### Recording Get Active Recordings Response - `RecordingGetActiveRecordingsResponse` - `data: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `success: boolean` Success status of the operation ### Recording Get One Recording Response - `RecordingGetOneRecordingResponse` - `success: boolean` Success status of the operation - `data?: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `start_reason?: StartReason` - `caller?: Caller` - `name?: string` Name of the user who started the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who started the recording. - `reason?: "API_CALL" | "RECORD_ON_START"` 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. - `"API_CALL"` - `"RECORD_ON_START"` - `stop_reason?: StopReason` - `caller?: Caller` - `name?: string` Name of the user who stopped the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who stopped the recording. - `reason?: "API_CALL" | "INTERNAL_ERROR" | "ALL_PEERS_LEFT"` Specifies the reason why the recording stopped. - `"API_CALL"` - `"INTERNAL_ERROR"` - `"ALL_PEERS_LEFT"` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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 ### Recording Pause Resume Stop Recording Response - `RecordingPauseResumeStopRecordingResponse` - `success: boolean` Success status of the operation - `data?: Data` Data returned by the operation - `id: string` ID of the recording - `audio_download_url: string | null` If the audio_config is passed, the URL for downloading the audio recording is returned. - `download_url: string | null` URL where the recording can be downloaded. - `download_url_expiry: string | null` Timestamp when the download URL expires. - `file_size: number | null` File size of the recording, in bytes. - `invoked_time: string` Timestamp when this recording was invoked. - `output_file_name: string` File name of the recording. - `session_id: string | null` ID of the meeting session this recording is for. - `started_time: string | null` Timestamp when this recording actually started after being invoked. Usually a few seconds after `invoked_time`. - `status: "INVOKED" | "RECORDING" | "UPLOADING" | 3 more` Current status of the recording. - `"INVOKED"` - `"RECORDING"` - `"UPLOADING"` - `"UPLOADED"` - `"ERRORED"` - `"PAUSED"` - `stopped_time: string | null` Timestamp when this recording was stopped. Optional; is present only when the recording has actually been stopped. - `recording_duration?: number` Total recording time in seconds. - `start_reason?: StartReason` - `caller?: Caller` - `name?: string` Name of the user who started the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who started the recording. - `reason?: "API_CALL" | "RECORD_ON_START"` 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. - `"API_CALL"` - `"RECORD_ON_START"` - `stop_reason?: StopReason` - `caller?: Caller` - `name?: string` Name of the user who stopped the recording. - `type?: "ORGANIZATION" | "USER"` The type can be an App or a user. If the type is `user`, then only the `user_Id` and `name` are returned. - `"ORGANIZATION"` - `"USER"` - `user_Id?: string` The user ID of the person who stopped the recording. - `reason?: "API_CALL" | "INTERNAL_ERROR" | "ALL_PEERS_LEFT"` Specifies the reason why the recording stopped. - `"API_CALL"` - `"INTERNAL_ERROR"` - `"ALL_PEERS_LEFT"` - `storage_config?: StorageConfig | null` - `type: "aws" | "azure" | "digitalocean" | 2 more` Type of storage media. - `"aws"` - `"azure"` - `"digitalocean"` - `"gcs"` - `"sftp"` - `access_key?: 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?: "KEY" | "PASSWORD"` Authentication method used for "sftp" type storage medium - `"KEY"` - `"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?: number` SSH destination server port for SFTP type storage medium - `private_key?: 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