Skip to content
Start here

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.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string
maxLength32
minLength32
recordingID string
params RecordingPauseResumeStopRecordingParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32

Body param

const RecordingPauseResumeStopRecordingParamsActionStop RecordingPauseResumeStopRecordingParamsAction = "stop"
const RecordingPauseResumeStopRecordingParamsActionPause RecordingPauseResumeStopRecordingParamsAction = "pause"
const RecordingPauseResumeStopRecordingParamsActionResume RecordingPauseResumeStopRecordingParamsAction = "resume"
ReturnsExpand Collapse
type RecordingPauseResumeStopRecordingResponse struct{…}
Success bool

Success status of the operation

Data RecordingPauseResumeStopRecordingResponseDataoptional

Data returned by the operation

ID string

ID of the recording

formatuuid
AudioDownloadURL string

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

formaturi
DownloadURL string

URL where the recording can be downloaded.

formaturi
DownloadURLExpiry Time

Timestamp when the download URL expires.

formatdate-time
FileSize float64

File size of the recording, in bytes.

InvokedTime Time

Timestamp when this recording was invoked.

formatdate-time
OutputFileName string

File name of the recording.

SessionID string

ID of the meeting session this recording is for.

formatuuid
StartedTime Time

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

formatdate-time
Status RecordingPauseResumeStopRecordingResponseDataStatus

Current status of the recording.

One of the following:
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.

formatdate-time
RecordingDuration int64optional

Total recording time in seconds.

StartReason RecordingPauseResumeStopRecordingResponseDataStartReasonoptional
Caller RecordingPauseResumeStopRecordingResponseDataStartReasonCalleroptional
Name stringoptional

Name of the user who started the recording.

Type RecordingPauseResumeStopRecordingResponseDataStartReasonCallerTypeoptional

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

One of the following:
const RecordingPauseResumeStopRecordingResponseDataStartReasonCallerTypeOrganization RecordingPauseResumeStopRecordingResponseDataStartReasonCallerType = "ORGANIZATION"
const RecordingPauseResumeStopRecordingResponseDataStartReasonCallerTypeUser RecordingPauseResumeStopRecordingResponseDataStartReasonCallerType = "USER"
UserID stringoptional

The user ID of the person who started the recording.

formatuuid
Reason RecordingPauseResumeStopRecordingResponseDataStartReasonReasonoptional

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

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

One of the following:
const RecordingPauseResumeStopRecordingResponseDataStartReasonReasonAPICall RecordingPauseResumeStopRecordingResponseDataStartReasonReason = "API_CALL"
const RecordingPauseResumeStopRecordingResponseDataStartReasonReasonRecordOnStart RecordingPauseResumeStopRecordingResponseDataStartReasonReason = "RECORD_ON_START"
StopReason RecordingPauseResumeStopRecordingResponseDataStopReasonoptional
Caller RecordingPauseResumeStopRecordingResponseDataStopReasonCalleroptional
Name stringoptional

Name of the user who stopped the recording.

Type RecordingPauseResumeStopRecordingResponseDataStopReasonCallerTypeoptional

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

One of the following:
const RecordingPauseResumeStopRecordingResponseDataStopReasonCallerTypeOrganization RecordingPauseResumeStopRecordingResponseDataStopReasonCallerType = "ORGANIZATION"
const RecordingPauseResumeStopRecordingResponseDataStopReasonCallerTypeUser RecordingPauseResumeStopRecordingResponseDataStopReasonCallerType = "USER"
UserID stringoptional

The user ID of the person who stopped the recording.

formatuuid
Reason RecordingPauseResumeStopRecordingResponseDataStopReasonReasonoptional

Specifies the reason why the recording stopped.

One of the following:
const RecordingPauseResumeStopRecordingResponseDataStopReasonReasonAPICall RecordingPauseResumeStopRecordingResponseDataStopReasonReason = "API_CALL"
const RecordingPauseResumeStopRecordingResponseDataStopReasonReasonInternalError RecordingPauseResumeStopRecordingResponseDataStopReasonReason = "INTERNAL_ERROR"
const RecordingPauseResumeStopRecordingResponseDataStopReasonReasonAllPeersLeft RecordingPauseResumeStopRecordingResponseDataStopReasonReason = "ALL_PEERS_LEFT"
StorageConfig RecordingPauseResumeStopRecordingResponseDataStorageConfigoptional
Type RecordingPauseResumeStopRecordingResponseDataStorageConfigType

Type of storage media.

One of the following:
const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeAws RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "aws"
const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeAzure RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "azure"
const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeDigitalocean RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "digitalocean"
const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeGcs RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "gcs"
const RecordingPauseResumeStopRecordingResponseDataStorageConfigTypeSftp RecordingPauseResumeStopRecordingResponseDataStorageConfigType = "sftp"
AccessKey stringoptional

Access key of the storage medium. Access key is not required for the gcs storage media type.

Note that this field is not readable by clients, only writeable.

AuthMethod RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethodoptional

Authentication method used for “sftp” type storage medium

One of the following:
const RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethodKey RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethod = "KEY"
const RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethodPassword RecordingPauseResumeStopRecordingResponseDataStorageConfigAuthMethod = "PASSWORD"
Bucket stringoptional

Name of the storage medium’s bucket.

Host stringoptional

SSH destination server host for SFTP type storage medium

Password stringoptional

SSH destination server password for SFTP type storage medium when auth_method is “PASSWORD”. If auth_method is “KEY”, this specifies the password for the ssh private key.

Path stringoptional

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

Port float64optional

SSH destination server port for SFTP type storage medium

PrivateKey stringoptional

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

Region stringoptional

Region of the storage medium.

Secret stringoptional

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

Username stringoptional

SSH destination server username for SFTP type storage medium

Pause/Resume/Stop recording

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)
}
{
  "success": true,
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "audio_download_url": "https://example.com",
    "download_url": "https://example.com",
    "download_url_expiry": "2019-12-27T18:11:19.117Z",
    "file_size": 0,
    "invoked_time": "2019-12-27T18:11:19.117Z",
    "output_file_name": "output_file_name",
    "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "started_time": "2019-12-27T18:11:19.117Z",
    "status": "INVOKED",
    "stopped_time": "2019-12-27T18:11:19.117Z",
    "recording_duration": 0,
    "start_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "stop_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "storage_config": {
      "type": "aws",
      "auth_method": "KEY",
      "bucket": "bucket",
      "host": "host",
      "password": "password",
      "path": "path",
      "port": 0,
      "private_key": "private_key",
      "region": "us-east-1",
      "secret": "secret",
      "username": "username"
    }
  }
}
Returns Examples
{
  "success": true,
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "audio_download_url": "https://example.com",
    "download_url": "https://example.com",
    "download_url_expiry": "2019-12-27T18:11:19.117Z",
    "file_size": 0,
    "invoked_time": "2019-12-27T18:11:19.117Z",
    "output_file_name": "output_file_name",
    "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "started_time": "2019-12-27T18:11:19.117Z",
    "status": "INVOKED",
    "stopped_time": "2019-12-27T18:11:19.117Z",
    "recording_duration": 0,
    "start_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "stop_reason": {
      "caller": {
        "name": "RealtimeKit_test",
        "type": "ORGANIZATION",
        "user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
      },
      "reason": "API_CALL"
    },
    "storage_config": {
      "type": "aws",
      "auth_method": "KEY",
      "bucket": "bucket",
      "host": "host",
      "password": "password",
      "path": "path",
      "port": 0,
      "private_key": "private_key",
      "region": "us-east-1",
      "secret": "secret",
      "username": "username"
    }
  }
}