Skip to content
Start here

Fetch details of a participant

client.RealtimeKit.Sessions.GetSessionParticipantDetails(ctx, appID, sessionID, participantID, params) (*SessionGetSessionParticipantDetailsResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/sessions/{session_id}/participants/{participant_id}

Returns details of the given participant ID along with call statistics for the given session 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
sessionID string
formatuuid
participantID string
formatuuid
params SessionGetSessionParticipantDetailsParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
IncludePeerEvents param.Field[bool]Optional

Query param: if true, response includes all the peer events of participant.

ReturnsExpand Collapse
type SessionGetSessionParticipantDetailsResponse struct{…}
Data SessionGetSessionParticipantDetailsResponseDataOptional
Participant SessionGetSessionParticipantDetailsResponseDataParticipantOptional
ID stringOptional

Participant ID. This maps to the corresponding peerId.

CreatedAt stringOptional

timestamp when this participant was created.

CustomParticipantID stringOptional

ID passed by client to create this participant.

DisplayName stringOptional

Display name of participant when joining the session.

Duration float64Optional

number of minutes for which the participant was in the session.

JoinedAt stringOptional

timestamp at which participant joined the session.

LeftAt stringOptional

timestamp at which participant left the session.

PeerEvents []SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventOptional

Connection lifecycle events for the participant’s peer. Only included when include_peer_events is true.

ID stringOptional

ID of the peer event.

CreatedAt stringOptional

Timestamp when this peer event was created.

EventName SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventNameOptional

Name of the peer event.

One of the following:
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventNamePeerCreated SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventName = "PEER_CREATED"
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventNamePeerJoining SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventName = "PEER_JOINING"
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventNamePeerLeaving SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsEventName = "PEER_LEAVING"
MinutesConsumed float64Optional

Minutes consumed attributed to this event.

ParticipantID stringOptional

ID of the participant this event belongs to.

PeerID stringOptional

Peer ID this event belongs to.

PresetViewType SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewTypeOptional

View type of the preset associated with the peer.

One of the following:
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewTypeGroupCall SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewType = "GROUP_CALL"
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewTypeWebinar SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewType = "WEBINAR"
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewTypeAudioRoom SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewType = "AUDIO_ROOM"
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewTypeLivestream SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewType = "LIVESTREAM"
const SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewTypeChat SessionGetSessionParticipantDetailsResponseDataParticipantPeerEventsPresetViewType = "CHAT"
SessionID stringOptional

ID of the session this event belongs to.

SocketSessionID stringOptional

ID of the socket session associated with this event.

UpdatedAt stringOptional

Timestamp when this peer event was last updated.

PresetName stringOptional

Name of the preset associated with the participant.

UpdatedAt stringOptional

timestamp when this participant’s data was last updated.

UserID stringOptional

User id for this participant.

Success boolOptional

Fetch details of a participant

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/realtime_kit"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.Sessions.GetSessionParticipantDetails(
    context.TODO(),
    "app_id",
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    realtime_kit.SessionGetSessionParticipantDetailsParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "participant": {
      "id": "id",
      "created_at": "created_at",
      "custom_participant_id": "custom_participant_id",
      "display_name": "display_name",
      "duration": 0,
      "joined_at": "joined_at",
      "left_at": "left_at",
      "peer_events": [
        {
          "id": "id",
          "created_at": "created_at",
          "event_name": "PEER_CREATED",
          "minutes_consumed": 0,
          "participant_id": "participant_id",
          "peer_id": "peer_id",
          "preset_view_type": "GROUP_CALL",
          "session_id": "session_id",
          "socket_session_id": "socket_session_id",
          "updated_at": "updated_at"
        }
      ],
      "preset_name": "preset_name",
      "updated_at": "updated_at",
      "user_id": "user_id"
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "participant": {
      "id": "id",
      "created_at": "created_at",
      "custom_participant_id": "custom_participant_id",
      "display_name": "display_name",
      "duration": 0,
      "joined_at": "joined_at",
      "left_at": "left_at",
      "peer_events": [
        {
          "id": "id",
          "created_at": "created_at",
          "event_name": "PEER_CREATED",
          "minutes_consumed": 0,
          "participant_id": "participant_id",
          "peer_id": "peer_id",
          "preset_view_type": "GROUP_CALL",
          "session_id": "session_id",
          "socket_session_id": "socket_session_id",
          "updated_at": "updated_at"
        }
      ],
      "preset_name": "preset_name",
      "updated_at": "updated_at",
      "user_id": "user_id"
    }
  },
  "success": true
}