# Active Session ## Fetch details of an active session `realtime_kit.active_session.get_active_session(strmeeting_id, ActiveSessionGetActiveSessionParams**kwargs) -> 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 - `account_id: str` The account identifier tag. - `app_id: str` The app identifier tag. - `meeting_id: str` ### Returns - `class ActiveSessionGetActiveSessionResponse: …` - `data: Optional[Data]` - `id: str` ID of the session - `associated_id: str` 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: str` timestamp when session created - `live_participants: float` number of participants currently in the session - `max_concurrent_participants: float` number of maximum participants that were in the session - `meeting_display_name: str` Title of the meeting this session belongs to - `minutes_consumed: float` number of minutes consumed since the session started - `organization_id: str` App id that hosted this session - `started_at: str` timestamp when session started - `status: Literal["LIVE", "ENDED"]` current status of session - `"LIVE"` - `"ENDED"` - `type: Literal["meeting", "livestream", "participant"]` type of session - `"meeting"` - `"livestream"` - `"participant"` - `updated_at: str` timestamp when session was last updated - `breakout_rooms: Optional[List[object]]` - `ended_at: Optional[str]` timestamp when session ended - `meta: Optional[object]` Any meta data about session. - `success: Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.realtime_kit.active_session.get_active_session( meeting_id="meeting_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", app_id="app_id", ) print(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 `realtime_kit.active_session.kick_participants(strmeeting_id, ActiveSessionKickParticipantsParams**kwargs) -> 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 - `account_id: str` The account identifier tag. - `app_id: str` The app identifier tag. - `meeting_id: str` - `custom_participant_ids: SequenceNotStr[str]` - `participant_ids: SequenceNotStr[str]` ### Returns - `class ActiveSessionKickParticipantsResponse: …` - `data: Optional[Data]` - `action: Optional[str]` - `participants: Optional[List[DataParticipant]]` - `id: str` ID of the session participant - `created_at: str` - `updated_at: str` - `email: Optional[str]` Email of the session participant. - `name: Optional[str]` Name of the session participant. - `picture: Optional[str]` A URL pointing to a picture of the participant. - `success: Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.realtime_kit.active_session.kick_participants( meeting_id="meeting_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", app_id="app_id", custom_participant_ids=["string"], participant_ids=["string"], ) print(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 `realtime_kit.active_session.kick_all_participants(strmeeting_id, ActiveSessionKickAllParticipantsParams**kwargs) -> 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 - `account_id: str` The account identifier tag. - `app_id: str` The app identifier tag. - `meeting_id: str` ### Returns - `class ActiveSessionKickAllParticipantsResponse: …` - `data: Optional[Data]` - `action: Optional[str]` - `kicked_participants_count: Optional[float]` - `success: Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.realtime_kit.active_session.kick_all_participants( meeting_id="meeting_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", app_id="app_id", ) print(response.data) ``` #### Response ```json { "data": { "action": "action", "kicked_participants_count": 0 }, "success": true } ``` ## Create a poll `realtime_kit.active_session.create_poll(strmeeting_id, ActiveSessionCreatePollParams**kwargs) -> 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 - `account_id: str` The account identifier tag. - `app_id: str` The app identifier tag. - `meeting_id: str` - `options: SequenceNotStr[str]` Different options for the question - `question: str` Question of the poll - `anonymous: Optional[bool]` if voters on a poll are anonymous - `hide_votes: Optional[bool]` if votes on an option are visible before a person votes ### Returns - `class ActiveSessionCreatePollResponse: …` - `data: Optional[Data]` - `action: Optional[str]` - `poll: Optional[DataPoll]` - `id: str` ID of the poll - `options: List[DataPollOption]` Answer options - `count: float` - `text: str` Text of the answer option - `votes: List[DataPollOptionVote]` - `id: str` - `name: str` - `question: str` Question asked by the poll - `anonymous: Optional[bool]` - `created_by: Optional[str]` - `hide_votes: Optional[bool]` - `voted: Optional[List[str]]` - `success: Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.realtime_kit.active_session.create_poll( meeting_id="meeting_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", app_id="app_id", options=["string"], question="question", ) print(response.data) ``` #### Response ```json { "data": { "action": "action", "poll": { "id": "id", "options": [ { "count": 0, "text": "text", "votes": [ { "id": "id", "name": "name" } ] } ], "question": "question", "anonymous": true, "created_by": "created_by", "hide_votes": true, "voted": [ "string" ] } }, "success": true } ``` ## Domain Types ### Active Session Get Active Session Response - `class ActiveSessionGetActiveSessionResponse: …` - `data: Optional[Data]` - `id: str` ID of the session - `associated_id: str` 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: str` timestamp when session created - `live_participants: float` number of participants currently in the session - `max_concurrent_participants: float` number of maximum participants that were in the session - `meeting_display_name: str` Title of the meeting this session belongs to - `minutes_consumed: float` number of minutes consumed since the session started - `organization_id: str` App id that hosted this session - `started_at: str` timestamp when session started - `status: Literal["LIVE", "ENDED"]` current status of session - `"LIVE"` - `"ENDED"` - `type: Literal["meeting", "livestream", "participant"]` type of session - `"meeting"` - `"livestream"` - `"participant"` - `updated_at: str` timestamp when session was last updated - `breakout_rooms: Optional[List[object]]` - `ended_at: Optional[str]` timestamp when session ended - `meta: Optional[object]` Any meta data about session. - `success: Optional[bool]` ### Active Session Kick Participants Response - `class ActiveSessionKickParticipantsResponse: …` - `data: Optional[Data]` - `action: Optional[str]` - `participants: Optional[List[DataParticipant]]` - `id: str` ID of the session participant - `created_at: str` - `updated_at: str` - `email: Optional[str]` Email of the session participant. - `name: Optional[str]` Name of the session participant. - `picture: Optional[str]` A URL pointing to a picture of the participant. - `success: Optional[bool]` ### Active Session Kick All Participants Response - `class ActiveSessionKickAllParticipantsResponse: …` - `data: Optional[Data]` - `action: Optional[str]` - `kicked_participants_count: Optional[float]` - `success: Optional[bool]` ### Active Session Create Poll Response - `class ActiveSessionCreatePollResponse: …` - `data: Optional[Data]` - `action: Optional[str]` - `poll: Optional[DataPoll]` - `id: str` ID of the poll - `options: List[DataPollOption]` Answer options - `count: float` - `text: str` Text of the answer option - `votes: List[DataPollOptionVote]` - `id: str` - `name: str` - `question: str` Question asked by the poll - `anonymous: Optional[bool]` - `created_by: Optional[str]` - `hide_votes: Optional[bool]` - `voted: Optional[List[str]]` - `success: Optional[bool]`