Python SDK
morevoice is the Python client for the MoreVoice API. It runs on Python 3.9 and later and has a sync client, MoreVoice, and an async one, AsyncMoreVoice, with the same methods. Its core is generated from the OpenAPI document, so every operation of the API has a typed method, named like the Node.js SDK’s in snake_case: mv.calls.sendDtmf() there is client.calls.send_dtmf() here. Hand-written helpers cover the rest: verifying webhooks, serving custom tools from FastAPI or Flask, event streams and pagination.
Install
Section titled “Install”pip install morevoiceThe package is morevoice on PyPI. It depends only on httpx, attrs and python-dateutil.
Connect
Section titled “Connect”Create an API key in DevelopersAPI keys and keep it in an environment variable, MOREVOICE_API_KEY. Use a test-mode key (mv_test_…) while you build: test mode never reaches a real phone. Keys are for your server only.
import asyncio
from morevoice import AsyncMoreVoice, MoreVoice
client = MoreVoice() # reads MOREVOICE_API_KEY (and MOREVOICE_BASE_URL, if set)
# Check the key: which organisation, which mode, which scopes.me = client.whoami.retrieve()print(f"Connected to {me.org_id} in {'live' if me.livemode else 'test'} mode")
# The same methods, awaited, on AsyncMoreVoice.async def main() -> None: async_client = AsyncMoreVoice() me = await async_client.whoami.retrieve() print(me.api_version)
asyncio.run(main())Every method raises an exception when the API answers with an error: the exception carries the error’s type, code, message and the request_id. See errors, rate limits and concurrency.
Resources
Section titled “Resources”Each method takes its path parameters first, then the request body or the query. Each page lists the parameters, the body fields, the response and an example.
| Resource | Methods |
|---|---|
client.agent_sessions |
create(), delete(), list(), retrieve(), ticket() |
client.agents |
retrieve_status() |
client.assistants |
create(), delete(), duplicate(), list(), retrieve(), update() |
client.audio_assets |
create(), delete(), list(), retrieve(), retrieve_content(), update() |
client.callbacks |
add_note(), attach(), call(), cancel(), claim(), complete(), counts(), create(), list(), release(), retrieve(), start(), stats(), stream(), update() |
client.caller_ids |
create(), delete(), list(), retrieve() |
client.calls |
add_participant(), consult(), create(), create_stream(), create_summary(), delete(), delete_stream(), download_recording(), end_supervision(), hangup(), hold(), list(), list_copilot_events(), pci(), remove_participant(), retrieve(), retrieve_control(), retrieve_flow_path(), retrieve_pci(), retrieve_recording(), retrieve_summary(), retrieve_transcript(), send_dtmf(), send_supervision_whisper(), stream(), supervise(), transcript_stream(), transfer(), update_participant(), update_supervision() |
client.campaigns |
cancel(), contacts.create(), contacts.import_(), contacts.list(), contacts.list_attempts(), contacts.retrieve(), contacts.update(), create(), delete(), export(), list(), pause(), preflight(), resume(), retrieve(), start(), stats(), update() |
client.cli |
submit_tool_result() |
client.cli_listen |
stream() |
client.client_tokens |
create() |
client.conference_rooms |
create(), create_link(), delete(), invite(), list(), list_sessions(), moderate(), retrieve(), retrieve_ics(), retrieve_live(), update() |
client.connections |
create(), delete(), list(), register(), retrieve(), update() |
client.consents |
create(), delete(), list() |
client.copilot_profiles |
create(), delete(), duplicate(), list(), list_templates(), retrieve(), update() |
client.dnc |
check(), create(), delete(), list(), retrieve() |
client.events |
list(), retrieve(), stream() |
client.faxes |
create(), list(), retrieve(), retrieve_document() |
client.files |
create(), retrieve() |
client.flow_templates |
list(), retrieve() |
client.flows |
create(), delete(), duplicate(), list(), list_versions(), publish(), restore.version(), retrieve(), retrieve_analytics(), retrieve_draft(), retrieve_usage(), retrieve_version(), simulate(), update(), update_draft(), validate() |
client.imports |
retrieve() |
client.inbound_routes |
create(), delete(), list(), retrieve(), update() |
client.insights |
retrieve() |
client.invitations |
create(), delete(), list(), resend(), retrieve() |
client.kb |
documents_search() |
client.kb_documents |
create(), delete(), list(), reingest(), retrieve(), retrieve_content() |
client.missed_calls |
assign(), claim(), done(), list(), reopen() |
client.openapi |
postman() |
client.organizations |
create(), list(), resume(), retrieve(), retrieve_child_defaults(), suspend(), update(), update_child_defaults(), usage.retrieve() |
client.parked_calls |
list(), pickup(), retrieve() |
client.partner_billing |
invoices.list(), invoices.retrieve(), usage.retrieve() |
client.phone_numbers |
create(), delete(), list(), list_available(), retrieve() |
client.ports |
cancel(), create(), list(), retrieve() |
client.qa |
override_scorecard_item(), retrieve_rubric(), retrieve_scorecard(), run.scorecard(), update_rubric() |
client.queues |
create(), delete(), list(), retrieve(), retrieve_live(), update() |
client.reports |
catalog(), create(), delete(), download_run_csv(), download_run_pdf(), list(), list_runs(), preview(), retrieve(), send(), update() |
client.request_logs |
list(), retrieve(), stream() |
client.secrets |
delete(), list(), set() |
client.speech |
synthesize(), transcribe() |
client.teams |
create(), delete(), list(), retrieve(), update() |
client.test_helpers_events |
create() |
client.test_helpers_inbound_calls |
create() |
client.tools |
test() |
client.usage |
retrieve() |
client.users |
create(), delete(), list(), reactivate(), retrieve(), update() |
client.voices |
list(), preview() |
client.web_calls |
create(), retrieve_practice_session() |
client.webhook_deliveries |
list(), retrieve(), retry() |
client.webhook_endpoints |
create(), delete(), list(), replay(), retrieve(), retrieve_public_key(), rotate_secret(), test(), update() |
client.whatsapp_calls |
create() |
client.whatsapp_numbers |
create(), delete(), list(), retrieve(), update() |
client.whoami |
retrieve() |
Helpers
Section titled “Helpers”| Module | What it does |
|---|---|
morevoice.lib.calls |
Wait for a call to end: client.calls.wait_until_ended(call_id) (doc 07 §7.2 sample 2), sync and async. |
morevoice.lib.codecs |
Audio codecs for media streams: G.711 μ-law, 16-bit linear PCM, a band-limited resampler and 20 ms base64 framing. |
morevoice.lib.media_stream |
Media streams: bring your own bot (doc 07 §2.4c). MoreVoice keeps the phone call and opens a WebSocket to your server. |
morevoice.lib.pagination |
Page through any /v1 list lazily: auto_paginate(list_fn, **params) for every item, sync or async. |
morevoice.lib.sse |
Server-Sent Events over httpx: a WHATWG-compliant parser and sync / async event streams that resume with Last-Event-ID. |
morevoice.lib.streams |
Follow a call or the whole org live: calls.stream, calls.transcript_stream and events.stream (Server-Sent Events). |
morevoice.lib.tools |
Serve your custom tools to MoreVoice assistants: signed tool calls in, your functions’ answers out (FastAPI, Flask, any ASGI or WSGI app). |
morevoice.lib.webhooks |
Verify MoreVoice webhook deliveries and tool calls (Standard Webhooks, plus the legacy X-Webhook-Signature scheme). |
Webhooks and custom tools without the SDK
Section titled “Webhooks and custom tools without the SDK”Verifying a webhook or a tool call takes a few lines of the standard library: see verifying signatures and custom tools, which show the same checks in Python.