Create an inbound route
import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({ client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),});
const inboundRoute = await mv.inboundRoutes.create({ fallback_assistant_id: "asst_3cYbE6uYvGkH8w4ZK1rTqd", match_did: "+97231234567", name: "Sales line", target: { queue_id: "q_4Gk2LmN9pQ4rS6tV8wX0yZ", type: "queue", },});console.log(inboundRoute);import osimport uuid
import requests
response = requests.post( "https://api.morevoice.ai/v1/inbound_routes", headers={"Authorization": f"Bearer {os.environ['MOREVOICE_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, json={ "fallback_assistant_id": "asst_3cYbE6uYvGkH8w4ZK1rTqd", "match_did": "+97231234567", "name": "Sales line", "target": { "queue_id": "q_4Gk2LmN9pQ4rS6tV8wX0yZ", "type": "queue", }, },)response.raise_for_status()print(response.json())curl -X POST https://api.morevoice.ai/v1/inbound_routes \ -H "Authorization: Bearer $MOREVOICE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "fallback_assistant_id": "asst_3cYbE6uYvGkH8w4ZK1rTqd", "match_did": "+97231234567", "name": "Sales line", "target": { "queue_id": "q_4Gk2LmN9pQ4rS6tV8wX0yZ", "type": "queue" }}'Try it in the API playground with a test-mode key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The API version to use for this request. Defaults to the version the API key is pinned to.
Example
2026-11-01A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice.
Example
5f0c1e8a-7b2d-4c3e-9f1a-2b6d8e4c0a17Request Bodyrequired
Section titled “Request Bodyrequired”A new route. target is required; other fields default (enabled, priority 100, match anything).
object
The caller’s number: exact, a prefix ending in *, or empty for any.
The dialled number: exact, a prefix ending in *, or empty for any.
Where a matching call goes: type, and the ID in <type>_id.
object
With type: assistant.
With type: conference_room.
With type: flow (a published voice flow).
With type: queue.
What answers: assistant — an AI assistant answers; flow — a published voice flow (IVR) runs; queue — the call waits in a queue for a human agent; user — one person’s direct line (their forwarding rules apply); conference_room — a conference room (PIN prompt, then join). The ID goes in the field <type>_id.
With type: user.
Responses
Section titled “Responses”The new route.
A rule that sends inbound calls (by dialled number and caller) to an assistant, flow, queue, person or room.
object
An ISO-8601 timestamp in UTC.
The route’s ID.
true in live mode, false in test mode.
The caller’s number: exact, a prefix ending in *, or empty for any.
The dialled number: exact, a prefix ending in *, or empty for any.
Lower runs first; the first matching route wins.
Where a matching call goes.
object
With type: assistant.
With type: conference_room.
With type: flow.
With type: queue.
What answers: assistant — an AI assistant answers; flow — a published voice flow (IVR) runs; queue — the call waits in a queue for a human agent; user — one person’s direct line (their forwarding rules apply); conference_room — a conference room (PIN prompt, then join). The ID goes in the field <type>_id.
With type: user.
Example
{ "connection_id": "conn_2Wq8RfLx0bZt7nKp1VdYhC", "created": "2026-11-03T09:14:22.000Z", "enabled": true, "fallback_assistant_id": "asst_3cYbE6uYvGkH8w4ZK1rTqd", "id": "rte_5Hn3MpO0qR5sT7uW9xY1zA", "livemode": true, "match_caller": "", "match_did": "+97231234567", "name": "Sales line", "object": "inbound_route", "priority": 100, "target": { "queue_id": "q_4Gk2LmN9pQ4rS6tV8wX0yZ", "type": "queue" }}The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "parameter_missing", "doc_url": "https://docs.morevoice.ai/api/errors#parameter-missing", "message": "Missing required parameter: to.", "param": "to", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No valid API key was sent.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "invalid_api_key", "doc_url": "https://docs.morevoice.ai/api/errors#invalid-api-key", "message": "Invalid API key.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "authentication_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The key may not do this (a missing scope, a plan limit, or a compliance block).
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "missing_scope", "doc_url": "https://docs.morevoice.ai/api/errors#missing-scope", "message": "This API key lacks the calls:write scope.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "permission_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request conflicts with the object’s state, or the Idempotency-Key was reused with other parameters.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "idempotency_mismatch", "doc_url": "https://docs.morevoice.ai/api/errors#idempotency-mismatch", "message": "This Idempotency-Key was already used with different parameters.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "idempotency_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
Too many requests, or no call capacity right now. Retry after the Retry-After delay.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "rate_limited", "doc_url": "https://docs.morevoice.ai/api/errors#rate-limited", "message": "Too many requests. Retry after 1 second.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "rate_limit_error" }}Headers
Section titled “Headers”Seconds to wait before retrying.
The request’s ID (req_…). Quote it when you contact support.
Something went wrong on MoreVoice’s side. Retry with the same Idempotency-Key.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "internal_error", "doc_url": "https://docs.morevoice.ai/api/errors#internal-error", "message": "Something went wrong on MoreVoice's side.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "api_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.