Skip to content
Start here

Fetch active livestream session details

client.realtimeKit.livestreams.getActiveLivestreamsForLivestreamId(stringappId, stringlivestreamId, LivestreamGetActiveLivestreamsForLivestreamIDParams { account_id } params, RequestOptionsoptions?): LivestreamGetActiveLivestreamsForLivestreamIDResponse { data, success }
GET/accounts/{account_id}/realtime/kit/{app_id}/livestreams/{livestream_id}/active-livestream-session

Returns details of all active livestreams for the given livestream ID. Retreive the livestream ID using the Start livestreaming a meeting API.

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appId: string

The app identifier tag.

maxLength32
livestreamId: string
params: LivestreamGetActiveLivestreamsForLivestreamIDParams { account_id }
account_id: string

The account identifier tag.

maxLength32
ReturnsExpand Collapse
LivestreamGetActiveLivestreamsForLivestreamIDResponse { data, success }
data?: Data { livestream, session }
livestream?: Livestream { id, created_at, disabled, 7 more }
id?: string
created_at?: string

Timestamp the object was created at. The time is returned in ISO format.

formatdate-time
disabled?: string

Specifies if the livestream was disabled.

ingest_server?: string

The server URL to which the RTMP encoder sends the video and audio data.

meeting_id?: string

ID of the meeting.

name?: string

Name of the livestream.

playback_url?: string

The web address that viewers can use to watch the livestream.

status?: "LIVE" | "IDLE" | "ERRORED" | "INVOKED"
One of the following:
"LIVE"
"IDLE"
"ERRORED"
"INVOKED"
stream_key?: string

Unique key for accessing each livestream.

updated_at?: string

Timestamp the object was updated at. The time is returned in ISO format.

formatdate-time
session?: Session { id, created_at, err_message, 7 more }
id?: string
created_at?: string

Timestamp the object was created at. The time is returned in ISO format.

formatdate-time
err_message?: string
ingest_seconds?: string

The time duration for which the input was given or the meeting was streamed.

invoked_time?: string

Timestamp the object was invoked. The time is returned in ISO format.

formatdate-time
livestream_id?: string
started_time?: string

Timestamp the object was started. The time is returned in ISO format.

formatdate-time
stopped_time?: string

Timestamp the object was stopped. The time is returned in ISO format.

formatdate-time
updated_at?: string

Timestamp the object was updated at. The time is returned in ISO format.

formatdate-time
viewer_seconds?: string

The total view time for which the viewers watched the stream.

success?: boolean

Fetch active livestream session details

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.livestreams.getActiveLivestreamsForLivestreamId(
  'app_id',
  'livestream_id',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);

console.log(response.data);
{
  "data": {
    "livestream": {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "disabled": "disabled",
      "ingest_server": "ingest_server",
      "meeting_id": "meeting_id",
      "name": "name",
      "playback_url": "playback_url",
      "status": "LIVE",
      "stream_key": "stream_key",
      "updated_at": "2019-12-27T18:11:19.117Z"
    },
    "session": {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "err_message": "err_message",
      "ingest_seconds": "ingest_seconds",
      "invoked_time": "2019-12-27T18:11:19.117Z",
      "livestream_id": "livestream_id",
      "started_time": "2019-12-27T18:11:19.117Z",
      "stopped_time": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "viewer_seconds": "viewer_seconds"
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "livestream": {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "disabled": "disabled",
      "ingest_server": "ingest_server",
      "meeting_id": "meeting_id",
      "name": "name",
      "playback_url": "playback_url",
      "status": "LIVE",
      "stream_key": "stream_key",
      "updated_at": "2019-12-27T18:11:19.117Z"
    },
    "session": {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "err_message": "err_message",
      "ingest_seconds": "ingest_seconds",
      "invoked_time": "2019-12-27T18:11:19.117Z",
      "livestream_id": "livestream_id",
      "started_time": "2019-12-27T18:11:19.117Z",
      "stopped_time": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "viewer_seconds": "viewer_seconds"
    }
  },
  "success": true
}