Skip to content
Start here

Fetch details of peer

client.realtimeKit.sessions.getParticipantDataFromPeerId(stringappId, stringpeerId, SessionGetParticipantDataFromPeerIDParams { account_id, filters } params, RequestOptionsoptions?): SessionGetParticipantDataFromPeerIDResponse { data, success }
GET/accounts/{account_id}/realtime/kit/{app_id}/sessions/peer-report/{peer_id}

Returns details of the given peer 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
peerId: string
formatuuid
params: SessionGetParticipantDataFromPeerIDParams { account_id, filters }
account_id: string

Path param: The account identifier tag.

maxLength32
filters?: "device_info" | "ip_information" | "precall_network_information" | 2 more

Query param: Comma separated list of filters to apply. Note that there must be no spaces between the filters.

One of the following:
"device_info"
"ip_information"
"precall_network_information"
"events"
"quality_stats"
ReturnsExpand Collapse
SessionGetParticipantDataFromPeerIDResponse { data, success }
data?: Data { id, created_at, custom_participant_id, 10 more }
id?: string

Participant ID. This maps to the corresponding peerId.

created_at?: string

timestamp when this participant was created.

custom_participant_id?: string

ID passed by client to create this participant.

display_name?: string

Display name of participant when joining the session.

duration?: number

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

joined_at?: string

timestamp at which participant joined the session.

left_at?: string

timestamp at which participant left the session.

peer_events?: Array<Record<string, unknown>>
peer_report?: PeerReport { metadata, quality }

Peer call statistics report.

metadata?: Record<string, unknown>
quality?: Record<string, unknown>
preset_name?: string

Name of the preset associated with the participant.

session_id?: string
formatuuid
updated_at?: string

timestamp when this participant’s data was last updated.

user_id?: string

User id for this participant.

success?: boolean

Fetch details of peer

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.sessions.getParticipantDataFromPeerId(
  'app_id',
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);

console.log(response.data);
{
  "data": {
    "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": [
      {
        "foo": "bar"
      }
    ],
    "peer_report": {
      "metadata": {
        "foo": "bar"
      },
      "quality": {
        "foo": "bar"
      }
    },
    "preset_name": "preset_name",
    "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "updated_at": "updated_at",
    "user_id": "user_id"
  },
  "success": true
}
Returns Examples
{
  "data": {
    "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": [
      {
        "foo": "bar"
      }
    ],
    "peer_report": {
      "metadata": {
        "foo": "bar"
      },
      "quality": {
        "foo": "bar"
      }
    },
    "preset_name": "preset_name",
    "session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "updated_at": "updated_at",
    "user_id": "user_id"
  },
  "success": true
}