client.web_calls
Browser calls started with a publishable key. These methods are on client.web_calls, 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.
create()
Section titled “create()”Start a web call. From the browser with a publishable key (mv_live_pk_…), or from your server with a secret key: returns the call ID and a single-use client token for /ws/call. With a publishable key the assistant must be public, the page must be one of the key’s allowed origins (and of the assistant’s widget origins, when it lists any), and each visitor may start 10 web calls a minute. The org’s concurrent-call quota applies.
def create(self, body: _m.WebCallCreateParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.WebCallclient.web_calls.create() · await async_client.web_calls.create() · POST /web_calls · API reference
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
assistant_id |
string |
yes | The assistant to talk to. With a publishable key it must be public (widget settings). |
metadata |
MetadataInput |
no | Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent. |
practice |
WebCallPracticeParamsInput |
no | Makes the web call a practice call: the assistant (assistant_id) lends the AI customer its voice and models; the scenario replaces its instructions, first message, tools, knowledge and flow. A practice call is not a call: it has no call record, no call webhooks and is never billed as a call. The transcript and the score on your QA rubric are on the practice session (GET /v1/practice_sessions/{id}). Secret keys only. |
Returns
Section titled “Returns”WebCall:
| Field | Type | Description |
|---|---|---|
object |
"web_call" |
Always web_call. |
call_id |
string |
The call this web call will be (GET /v1/calls/{id} once it starts). |
assistant_id |
string |
A assistant ID (prefix asst_). |
client_token |
string |
Single use; connect within expires_at. |
ws_url |
string |
Connect to <ws_url>?client_token=<client_token>. |
expires_at |
string |
An ISO-8601 timestamp in UTC. |
livemode |
boolean |
true in live mode, false in test mode. |
practice_session_id |
string |
A practice web call’s session (GET /v1/practice_sessions/{id}): its transcript and score. Present only on practice web calls. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
web_call = client.web_calls.create({ "assistant_id": "asst_8tRPaZp5hLMbrGqdJ9AmNa", "metadata": { "page": "/pricing", },})print(web_call)retrieve_practice_session()
Section titled “retrieve_practice_session()”Retrieve a practice session. A practice web call’s result (POST /v1/web_calls with practice returns its id): the transcript (rep and customer lines) and, once status is scored, the score on your QA rubric with each item’s reasoning, the strengths and the coaching. It exists once the browser has joined the call; poll after the call ends (scoring takes a few seconds). Test keys read test-mode practice sessions only.
def retrieve_practice_session(self, id: str, *, more_voice_version: str | Unset = UNSET) -> _m.PracticeSessionclient.web_calls.retrieve_practice_session() · await async_client.web_calls.retrieve_practice_session() · GET /practice_sessions/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
str |
yes | A practice session ID (prs_…). |
Returns
Section titled “Returns”PracticeSession:
| Field | Type | Description |
|---|---|---|
id |
string |
A practice session ID (prefix prs_). |
object |
"practice_session" |
Always practice_session. |
run_id |
string |
Your practice.run_id. |
call_id |
string |
The practice web call’s id (it has no call record). |
status |
"live" | "scoring" | "scored" | "too_short" | "failed" | "abandoned" |
live during the call, scoring right after it, then scored; too_short (the rep said too little to score), failed (it could not be scored) or abandoned (the call never finished). |
scenario_title |
string |
— |
language |
"he" | "en" | "ar" | "ru" |
— |
transcript |
PracticeLine[] |
— |
scorecard |
PracticeScorecard | null |
Null until scored. |
duration_s |
number | null |
— |
end_reason |
string | null |
— |
metadata |
Record<string, string> |
The web call’s metadata, with purpose: practice and practice_run_id. |
started_at |
string |
An ISO-8601 timestamp in UTC. |
ended_at |
string | null |
— |
scored_at |
string | null |
— |
livemode |
boolean |
true in live mode, false in test mode. |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
practice_session = client.web_calls.retrieve_practice_session("prs_7Hk2Lm9Qp")print(practice_session)