Connect a WhatsApp number
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const whatsAppNumber = await mv.whatsappNumbers.create({ access_token: "your-whatsapp-business-access-token", assistant_id: "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8", callback_permission: "enabled", e164: "+97235550100", label: "Support line", metadata: { workspace_id: "ws_12", }, waba_id: "102290129340398", whatsapp_phone_number_id: "106540352242922",});console.log(whatsAppNumber);from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
whats_app_number = client.whatsapp_numbers.create({ "access_token": "your-whatsapp-business-access-token", "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8", "callback_permission": "enabled", "e164": "+97235550100", "label": "Support line", "metadata": { "workspace_id": "ws_12", }, "waba_id": "102290129340398", "whatsapp_phone_number_id": "106540352242922",})print(whats_app_number)curl -X POST https://api.morevoice.ai/v1/whatsapp_numbers \ -H "Authorization: Bearer $MOREVOICE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "access_token": "your-whatsapp-business-access-token", "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8", "callback_permission": "enabled", "e164": "+97235550100", "label": "Support line", "metadata": { "workspace_id": "ws_12" }, "waba_id": "102290129340398", "whatsapp_phone_number_id": "106540352242922"}'Connects a WhatsApp Business number for calling: WhatsApp’s IDs of the number and its business account, the number in E.164, where its calls go (assistant_id, flow_id or inbound_route_id), and the access token the platform uses for the number’s calls; optionally the notice the AI speaks first on its calls (disclosure_text), WhatsApp’s callback permission setting and your metadata. The token is write-only: it is stored encrypted and only its last 4 characters and a fingerprint come back. A number belongs to one organization: 409 resource_conflict when it is connected already (here or elsewhere). Needs a live key and WhatsApp calling enabled for the organization. Send an Idempotency-Key so a retry never connects twice.
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”Connects a WhatsApp Business number for calling. Set at most one of assistant_id, flow_id and inbound_route_id (none: calls are refused until the number is routed).
object
The WhatsApp Business access token the platform uses for this number’s calls. Write-only: stored encrypted and never returned (the number shows its last 4 characters and a fingerprint).
Calls to the number reach this assistant.
WhatsApp’s callback permission setting of the number (callback_permission_status): enabled when a user who calls the number grants your business a call permission (WhatsApp: 7 days), so a missed call can be called back without a permission request. Set it as the number is set at WhatsApp: the platform doesn’t change WhatsApp’s settings. Business-initiated calls refused for a missing permission say it in details.permission.callback_permission. Default disabled.
The number in E.164.
Calls to the number run this published flow.
Calls to the number follow this inbound route’s target.
A name for the number, shown in lists.
Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent.
object
Default inherit (the target’s setting).
The WhatsApp Business Account that holds the number (digits).
WhatsApp’s ID of the business phone number (digits), from the WhatsApp Business Account.
Example
{ "access_token": "your-whatsapp-business-access-token", "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8", "callback_permission": "enabled", "e164": "+97235550100", "label": "Support line", "metadata": { "workspace_id": "ws_12" }, "waba_id": "102290129340398", "whatsapp_phone_number_id": "106540352242922"}Responses
Section titled “Responses”Created
A WhatsApp Business number whose calls your organization takes.
object
WhatsApp’s callback permission setting of the number (callback_permission_status): enabled when a user who calls the number grants your business a call permission (WhatsApp: 7 days), so a missed call can be called back without a permission request. Set it as the number is set at WhatsApp: the platform doesn’t change WhatsApp’s settings. Business-initiated calls refused for a missing permission say it in details.permission.callback_permission.
An ISO-8601 timestamp in UTC.
The notice the AI speaks first on this number’s calls (that the caller talks to an AI, and that the call is recorded when it is), in place of the default notice. At most 500 characters, spoken as written: include the recording sentence when the calls are recorded. Empty or null: the default notice. Null: the default notice.
The number in E.164.
The WhatsApp number’s ID.
Your name for the number (may be empty).
true in live mode, false in test mode.
Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent.
object
inherit: the target’s own recording setting. on / off: this number decides.
active: calls to the number are taken. disabled: they are refused; the number keeps its settings.
The access token, as far as it shows: never the token itself.
object
The first 16 hex digits of the token’s SHA-256: compare it with your own copy’s.
The access token’s last 4 characters.
unverified: not used yet since it was set. ok: WhatsApp accepted it. invalid: WhatsApp refused it (set a new one with PATCH).
An ISO-8601 timestamp in UTC.
The WhatsApp Business Account that holds the number (digits).
WhatsApp’s ID of the business phone number (digits): calls to it come here. One organization per number.
Example
{ "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8", "callback_permission": "enabled", "calling": { "settings": { "call_icon_visibility": "DEFAULT" }, "status": "enabled", "synced_at": "2026-11-08T09:20:01.000Z" }, "created": "2026-11-08T09:14:22.000Z", "disabled_at": null, "disclosure_text": "שלום, כאן נציג AI של המרפאה, והשיחה מוקלטת.", "e164": "+97235550100", "flow_id": null, "id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ", "inbound_route_id": null, "label": "Support line", "livemode": true, "metadata": { "workspace_id": "ws_12" }, "object": "whatsapp_number", "recording": "inherit", "status": "active", "token": { "checked_at": "2026-11-08T09:20:01.000Z", "fingerprint": "3f2a9c41d07b8e65", "last4": "oken", "rotated_at": "2026-11-08T09:14:22.000Z", "status": "ok" }, "updated": "2026-11-08T09:14:22.000Z", "waba_id": "102290129340398", "whatsapp_phone_number_id": "106540352242922"}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.
No object with this ID (in the path or the body) exists in this organisation and mode.
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": "resource_missing", "doc_url": "https://docs.morevoice.ai/api/errors#resource-missing", "message": "No such object: 'call_4Gk2'.", "param": "id", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "not_found" }}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.
The request body is larger than the endpoint accepts, or has more parts or files than it takes.
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": "body_too_large", "doc_url": "https://docs.morevoice.ai/api/errors#body-too-large", "message": "The request body is larger than the endpoint accepts.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request body’s Content-Type is not one the endpoint takes.
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": "unsupported_media_type", "doc_url": "https://docs.morevoice.ai/api/errors#unsupported-media-type", "message": "This endpoint takes application/json.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_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.