client.agents
Human agents’ status and presence. These methods are on client.agents, where client is a MoreVoice client (see the Python SDK). On AsyncMoreVoice the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.
retrieve_status()
Section titled “retrieve_status()”Retrieve an agent’s status. A user’s presence as a human agent: available, busy on a call, in wrap-up, away or offline, and the queues they answer. id is the user’s ID.
def retrieve_status(self, id: str, *, more_voice_version: str | Unset = UNSET) -> _m.AgentStatusclient.agents.retrieve_status() · await async_client.agents.retrieve_status() · GET /agents/{id}/status · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A user ID (usr_…). |
Returns
Section titled “Returns”AgentStatus:
| Field | Type | Description |
|---|---|---|
object |
"agent_status" |
Always agent_status. |
user_id |
string |
A user ID (prefix usr_). |
livemode |
boolean |
true in live mode, false in test mode. |
status |
"available" | "busy" | "wrap_up" | "away" | "offline" |
available and away are chosen by the agent; busy and wrap_up follow their calls; offline: not signed in. |
since |
string | null |
When the status began (null while offline). |
ringing |
boolean |
A queue call is ringing the agent right now. |
call |
object | null |
The call the agent is on. |
wrap_up_until |
string | null |
— |
queue_ids |
string[] |
Enabled queues the agent answers. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
agent_status = client.agents.retrieve_status("usr_7Hk2Lm9Qp")print(agent_status)