Calls Platform API v1
Calls Platform API
Calls Platform API
Version 1

Cloud recording

Copy link

Cloud recording is a feature that allows you to record participants' audio and video in both direct calls and group call rooms. For group calls only, you can download the recorded file from Sendbird Dashboard or copy the file from Sendbird's S3 storage to your S3 storage in the same region. You can also directly save the cloud recordings to your S3 storage whenever they're created.

To use this feature, you need to activate the feature on the dashboard first. For a detailed guide, refer to Cloud recording on the Group Call page of each SDK platform.

Note: Downloading recorded files is only available for group calls. If the recorded file is saved directly to your own S3 storage, it can't be downloaded or copied from the Sendbird server.


Cloud recording status

Copy link
StatusDescription

recording

Indicates that the recording of a direct call or group call is taking place.

uploading

Indicates that the recording file is being uploaded to the cloud.

completed

Indicates that the recording was successfully completed and ready for download from Sendbird Dashboard.

failed

Indicates that the recording has encountered an error and has not completed successfully.

Resource representation

Copy link

The following tables show the list of properties in a cloud recording resource.

Property nameTypeDescription

recording_id

string

The unique ID of the cloud recording file.

*In a group call, the recording_id can be found by retrieving a room or retrieving a list of rooms. In its response, cloud_recordings[] object will be returned with the recording_id information. In a direct call, the recording_id can be found by retrieving a direct call or retrieving a list of direct calls.

target_event_type

string

The type of event to record. Valid values are call_audio, call_video, room_audio, and room_video.

room_id

string

A unique ID for the group call room. This property is only used when the value of target_event_type is either room_audio or room_video.

call_id

string

A unique ID for the direct call. This property is only used when the value of target_event_type is either call_audio or call_video.

status

string

The status of cloud recording. Valid values are recording,uploading,completed, and failed. The cloud recording status table explains each status in detail.

started_at

long

The timestamp of when the recording was started, in Unix milliseconds.

stopped_at

long

The timestamp of when the recording was stopped, in Unix milliseconds.

duration

int

The total length of recording, measured in milliseconds.

byte_size

int

The total size of recording file, measured in byte.

media_type

string

The type of media that is recorded. Valid values are audio and all.


Actions

Copy link
  • API endpoints are relative to the base URL allocated to your application. In this page, the /cloud-recordings endpoint refers to https://api-{application_id}.calls.sendbird.com/v1/cloud-recordings.

Note: To get your application ID, sign in to your dashboard, go to the Settings > Application > General, and then check the Application ID.

  • It's recommended that the parameter values such as {recording_id} in API URLs be URL encoded.

List of actions

Copy link
ActionHTTP request

Copy a cloud recording

POST /cloud-recordings/{recording_id}/copy
Copies a cloud recording file to your S3 storage.


Copy cloud recording

Copy link

The API to copy a recording file to your AWS S3 storage is available. When you call this API, the file you would like to transfer will be copied to an AWS S3 storage you provide which must be in the same AWS region as your Sendbird application.

Only the files that are in Completed status can be copied to your storage. You can check the file status on Group calls on Sendbird Dashboard.

Note: When a recording file is uploaded to the storage you specified, the total size of the file will be automatically split into 5MB per request for optimal data transfer. Charges incur per number of requests against the specified storage as listed on the Requests & data retrievals section.


Using AWS Storage

Copy link

Before calling the following API to copy a recording file to your AWS storage, you need to create IAM policies in your AWS account to access the storage by setting s3:PutObject and s3:ListBucket as shown below. If you specify a storage without attaching the two permissions, an error will return.

To securely copy the file to the S3 storage, it is recommended that the AWS account only allows these two permissions. For a detailed guide, visit the Creating IAM policies (console) page.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::{bucket_name}/*",
                "arn:aws:s3:::{bucket_name}",
            ]
        }
    ]
}

HTTP request

Copy link
POST https://api-{application_id}.calls.sendbird.com/v1/cloud-recordings/{recording_id}/copy

Parameters

Copy link

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

access_key

string

Specifies the access key of the AWS account to which you would like to copy the cloud recording file.

secret_key

string

Specifies the secret key of the AWS account to which you would like to copy the cloud recording file.

Secret key will be masked and won't be exposed or logged to secure user credentials.

bucket

string

Specifies the name of the bucket to which you would like to copy the cloud recording file.

region

string

Specifies the AWS region that the bucket is located. The value must match the region of the Sendbird application the recording file is in. Acceptable values are: ap-northeast-1, ap-northeast-2, ap-southeast-1, eu-central-1, us-west-2, and us-east-1.

To check the application's region, go to Organization settings > Application on your dashboard.

OptionalTypeDescription

recording_file_directory

string

Specifies the directory of the bucket.

{
    "access_key": "my_access_key",
    "secret_key": "my_secret_key",
    "bucket": "my-bucket",
    "region": "us-west-2",
    "recording_file_directory": "test/"
}

Response

Copy link

If successful, this action returns information of a recording file that has been copied to your AWS storage in the response body.

{
    "recording_id": "f56ee376-b6ee-4ea4-a523-f3ba87653a3e",
    "bucket": "my-bucket",
    "key": "test/230209_041500_f56ee376-b6ee-4ea4-a523-f3ba87653a3e.mp4"
}

List of response properties

Copy link
Property nameTypeDescription

recording_id

string

The unique ID of the cloud recording file.

bucket

string

The name of the bucket to which the cloud recording file has been copied.

key

string

The file directory, timestamp in %y%m%d_%H%M%S format, and the name of the cloud recording file that has been copied.


Upload cloud recording

Copy link

You can uploade a recorded file of a direct call or group call directly to your AWS S3 storage. Whenever a new recording file is created, it's automatically sent to the specified S3 bucket on your AWS account. Since Sendbird's storage doesn't store any recorded files, you can manage the files more securely and safely in your own storage.

Configure IAM role for cross account access

Copy link

Cross account access allows you to grant permission for other users and services of another AWS account to use resources in your AWS account. This feature allows the Sendbird server to upload files directly to your S3 storage, which ensures seamless integration between accounts without compromising security.

To gain cross account access, you must create an IAM role with appropriate permissions. The IAM role needs to have the following actions in the target S3 storage in order to upload the recorded files.

s3:ListBucket
s3:ListMultipartUploadParts
s3:ListBucketMultipartUploads
s3:AbortMultipartUpload
s3:GetObject
s3:Put*

Granting external ID makes it easy to control the conditions in which cross account access is permitted. This provides better security protection as described in the external ID guide.