client.Calls (CallsClient).
Methods
CancelScheduledCallAsync
DELETE /2/calls/scheduled/{id}
Cancel a Scheduled Call
Cancels a scheduled call the authenticated user organizes, and takes it off invitees’ calendars. For a recurring call, scope and occurrence_start_time pick the occurrences: all of them (the default), one, or one and every one after it. Cancelling what is already cancelled succeeds.
Parameters
Returns:Task<CancelScheduledCallResponse>
CreateCallAsync
POST /2/calls
Create a Call
Starts an X call hosted by the authenticated user (typically a bot). Pass an XChat conversation_id to start the call in that conversation, or omit it for a standalone call anyone can join with the returned join_url (subject to join_policy). The call starts empty: put an agent in it with POST /2/calls/:id/join. When the host joins a conversation call, the other members are rung.
Parameters
Returns:Task<CreateCallResponse>
GetCallAsync
GET /2/calls/{id}
Get a Call
Returns a call’s title, join policy, host and participant count, and whether the authenticated user may join it without asking the host.
Parameters
Returns:Task<GetCallResponse>
GetScheduledCallAsync
GET /2/calls/scheduled/{id}
Get a Scheduled Call
Returns a scheduled call the authenticated user organizes or is invited to, at its occurrence running now or its next one within a year: its time, call, recurrence and who is invited and how they answered. Changes can take a few seconds to show here. Use scheduled_call.fields to select which fields are returned.
Parameters
Returns:Task<GetScheduledCallResponse>
JoinCallAsync
POST /2/calls/{id}/join
Join a Call
Starts a media session that takes part in the call as the authenticated user. The response carries a media_url and a short-lived media_token: open a WebSocket to media_url with the token as a Bearer credential to exchange PCM16 audio and events with the call; the user enters the call when the WebSocket connects. On a closed or trusted call the session asks the host first (admission: requires_approval).
Parameters
Returns:Task<JoinCallResponse>
LeaveCallAsync
POST /2/calls/{id}/leave
Leave a Call
Ends the authenticated user’s media session in the call (its WebSocket receives session.ended with reason left) and removes the user from the call.
Parameters
Returns:Task<LeaveCallResponse>
ListScheduledAsync
GET /2/calls/scheduled
List Scheduled Calls
Returns the X calls on the authenticated user’s calendar, earliest first: events on their X Calls calendar, and events on the Microsoft Outlook calendars they linked to X whose conference is an X call. Calls still running at start_time are included. The window defaults to the next 24 hours and may span at most 7 days. Use scheduled_call.fields to select which fields are returned.
When both are provided, start_time must be earlier than end_time.
Parameters
Returns:Task<ListScheduledCallsResponse>
RespondToScheduledCallAsync
POST /2/calls/scheduled/{id}/rsvp
Respond to a Scheduled Call
Accepts, declines or tentatively accepts an invitation to a scheduled call for the authenticated user. For a recurring call, scope and occurrence_start_time pick the occurrences the answer is for: all of them (the default), one, or one and every one after it.
Parameters
Returns:Task<RespondToScheduledCallResponse>
ScheduleCallAsync
POST /2/calls/scheduled
Schedule a Call
Puts an X call on the authenticated user’s X Calls calendar, with them as its organizer, and invites people to it. The call exists right away: share its join_url, or put an agent in it at start time with POST /2/calls/:id/join. A recurrence (an RFC 5545 RRULE) repeats it. Invitees get an email unless notify_invitees is false.
Parameters
Returns:Task<ScheduleCallResponse>
UpdateScheduledCallAsync
PUT /2/calls/scheduled/{id}
Update a Scheduled Call
Moves, renames or re-invites a scheduled call the authenticated user organizes. Only the fields sent change. For a recurring call, scope and occurrence_start_time pick the occurrences: all of them (the default), one, or one and every one after it.
Parameters
At least one of
start_time, duration_minutes, title, description, invitee_ids, recurrence, time_zone is required.Task<UpdateScheduledCallResponse>