# Active Session ## Fetch details of an active session `client.realtimeKit.activeSession.getActiveSession(stringappId, stringmeetingId, ActiveSessionGetActiveSessionParamsparams, RequestOptionsoptions?): ActiveSessionGetActiveSessionResponse` **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. ### Parameters - `appId: string` The app identifier tag. - `meetingId: string` - `params: ActiveSessionGetActiveSessionParams` - `account_id: string` The account identifier tag. ### Returns - `ActiveSessionGetActiveSessionResponse` - `data?: Data` - `id: string` ID of the session - `associated_id: 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` - `created_at: string` timestamp when session created - `live_participants: number` number of participants currently in the session - `max_concurrent_participants: number` number of maximum participants that were in the session - `meeting_display_name: string` Title of the meeting this session belongs to - `minutes_consumed: number` number of minutes consumed since the session started - `organization_id: string` App id that hosted this session - `started_at: string` timestamp when session started - `status: "LIVE" | "ENDED"` current status of session - `"LIVE"` - `"ENDED"` - `type: "meeting" | "livestream" | "participant"` type of session - `"meeting"` - `"livestream"` - `"participant"` - `updated_at: string` timestamp when session was last updated - `breakout_rooms?: Array` - `ended_at?: string` timestamp when session ended - `meta?: unknown` Any meta data about session. - `success?: boolean` ### Example ```node 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.activeSession.getActiveSession('app_id', 'meeting_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.data); ``` #### Response ```json { "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 } ``` ## Kick participants from an active session `client.realtimeKit.activeSession.kickParticipants(stringappId, stringmeetingId, ActiveSessionKickParticipantsParamsparams, RequestOptionsoptions?): ActiveSessionKickParticipantsResponse` **post** `/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/active-session/kick` Kicks one or more participants from an active session using user ID or custom participant ID. ### Parameters - `appId: string` The app identifier tag. - `meetingId: string` - `params: ActiveSessionKickParticipantsParams` - `account_id: string` Path param: The account identifier tag. - `custom_participant_ids: Array` Body param - `participant_ids: Array` Body param ### Returns - `ActiveSessionKickParticipantsResponse` - `data?: Data` - `action?: string` - `participants?: Array` - `id: string` ID of the session participant - `created_at: string` - `updated_at: string` - `email?: string` Email of the session participant. - `name?: string` Name of the session participant. - `picture?: string` A URL pointing to a picture of the participant. - `success?: boolean` ### Example ```node 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.activeSession.kickParticipants('app_id', 'meeting_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', custom_participant_ids: ['string'], participant_ids: ['string'], }); console.log(response.data); ``` #### Response ```json { "data": { "action": "action", "participants": [ { "id": "id", "created_at": "created_at", "updated_at": "updated_at", "email": "email", "name": "name", "picture": "picture" } ] }, "success": true } ``` ## Kick all participants `client.realtimeKit.activeSession.kickAllParticipants(stringappId, stringmeetingId, ActiveSessionKickAllParticipantsParamsparams, RequestOptionsoptions?): ActiveSessionKickAllParticipantsResponse` **post** `/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/active-session/kick-all` Kicks all participants from an active session for the given meeting ID. ### Parameters - `appId: string` The app identifier tag. - `meetingId: string` - `params: ActiveSessionKickAllParticipantsParams` - `account_id: string` The account identifier tag. ### Returns - `ActiveSessionKickAllParticipantsResponse` - `data?: Data` - `action?: string` - `kicked_participants_count?: number` - `success?: boolean` ### Example ```node 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.activeSession.kickAllParticipants( 'app_id', 'meeting_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(response.data); ``` #### Response ```json { "data": { "action": "action", "kicked_participants_count": 0 }, "success": true } ``` ## Create a poll `client.realtimeKit.activeSession.createPoll(stringappId, stringmeetingId, ActiveSessionCreatePollParamsparams, RequestOptionsoptions?): ActiveSessionCreatePollResponse` **post** `/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/active-session/poll` Creates a new poll in an active session for the given meeting ID. ### Parameters - `appId: string` The app identifier tag. - `meetingId: string` - `params: ActiveSessionCreatePollParams` - `account_id: string` Path param: The account identifier tag. - `options: Array` Body param: Different options for the question - `question: string` Body param: Question of the poll - `anonymous?: boolean` Body param: if voters on a poll are anonymous - `hide_votes?: boolean` Body param: if votes on an option are visible before a person votes ### Returns - `ActiveSessionCreatePollResponse` - `data?: Data` - `action?: string` - `poll?: Poll` - `id: string` ID of the poll - `options: Array