Skip to content
Start here

Fetch details of an active session

client.RealtimeKit.ActiveSession.GetActiveSession(ctx, appID, meetingID, query) (*ActiveSessionGetActiveSessionResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/active-session

Returns details of an ongoing active session for the given meeting 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

The app identifier tag.

maxLength32
meetingID string
query ActiveSessionGetActiveSessionParams
AccountID param.Field[string]

The account identifier tag.

maxLength32
ReturnsExpand Collapse
type ActiveSessionGetActiveSessionResponse struct{…}
Data ActiveSessionGetActiveSessionResponseDataoptional
ID string

ID of the session

AssociatedID string

ID of the meeting this session is associated with. In the case of V2 meetings, it is always a UUID. In V1 meetings, it is a room name of the form abcdef-ghijkl

CreatedAt string

timestamp when session created

LiveParticipants float64

number of participants currently in the session

MaxConcurrentParticipants float64

number of maximum participants that were in the session

MeetingDisplayName string

Title of the meeting this session belongs to

MinutesConsumed float64

number of minutes consumed since the session started

OrganizationID string

App id that hosted this session

StartedAt string

timestamp when session started

Status ActiveSessionGetActiveSessionResponseDataStatus

current status of session

One of the following:
const ActiveSessionGetActiveSessionResponseDataStatusLive ActiveSessionGetActiveSessionResponseDataStatus = "LIVE"
const ActiveSessionGetActiveSessionResponseDataStatusEnded ActiveSessionGetActiveSessionResponseDataStatus = "ENDED"
Type ActiveSessionGetActiveSessionResponseDataType

type of session

One of the following:
const ActiveSessionGetActiveSessionResponseDataTypeMeeting ActiveSessionGetActiveSessionResponseDataType = "meeting"
const ActiveSessionGetActiveSessionResponseDataTypeLivestream ActiveSessionGetActiveSessionResponseDataType = "livestream"
const ActiveSessionGetActiveSessionResponseDataTypeParticipant ActiveSessionGetActiveSessionResponseDataType = "participant"
UpdatedAt string

timestamp when session was last updated

BreakoutRooms []unknownoptional
EndedAt stringoptional

timestamp when session ended

Meta unknownoptional

Any meta data about session.

Success booloptional

Fetch details of an active session

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.ActiveSession.GetActiveSession(
    context.TODO(),
    "app_id",
    "meeting_id",
    realtime_kit.ActiveSessionGetActiveSessionParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "id": "id",
    "associated_id": "associated_id",
    "created_at": "created_at",
    "live_participants": 0,
    "max_concurrent_participants": 0,
    "meeting_display_name": "meeting_display_name",
    "minutes_consumed": 0,
    "organization_id": "organization_id",
    "started_at": "started_at",
    "status": "LIVE",
    "type": "meeting",
    "updated_at": "updated_at",
    "breakout_rooms": [
      {}
    ],
    "ended_at": "ended_at",
    "meta": {}
  },
  "success": true
}
{
  "error": {
    "code": 404,
    "message": "No active session found for meeting_id 6bf2b8be-04dd-4191-b602-1128921a306b"
  },
  "success": false
}
Returns Examples
{
  "data": {
    "id": "id",
    "associated_id": "associated_id",
    "created_at": "created_at",
    "live_participants": 0,
    "max_concurrent_participants": 0,
    "meeting_display_name": "meeting_display_name",
    "minutes_consumed": 0,
    "organization_id": "organization_id",
    "started_at": "started_at",
    "status": "LIVE",
    "type": "meeting",
    "updated_at": "updated_at",
    "breakout_rooms": [
      {}
    ],
    "ended_at": "ended_at",
    "meta": {}
  },
  "success": true
}
{
  "error": {
    "code": 404,
    "message": "No active session found for meeting_id 6bf2b8be-04dd-4191-b602-1128921a306b"
  },
  "success": false
}