Skip to content

mv.callerIds

Numbers you hold elsewhere, verified by a call, to present as your calls’ caller ID. These methods are on mv.callerIds, where mv is your client (see the Node.js SDK). Each one returns the response object and throws when the API answers with an error.

Verify a caller ID. Starts verifying a number you hold elsewhere (your office line, a mobile) so your calls can present it. We call phone_number from our verification line and ask the person who answers to type the 6-digit verification_code of this answer on the phone’s keypad: show it to them (the call never says it). The outcome arrives as caller_id.verified or caller_id.failed, or read it with GET /v1/caller_ids/{id}; the code works for 10 minutes and for one entry. A verified number can then be the caller_id of POST /v1/calls and of campaigns, also on MoreVoice Telephony.

Limits: 3 calls a day per number, 10 a day and 3 in any 10 minutes per organisation (429 rate_limited, details.scope). Refused: a number not in E.164, an emergency or premium-rate number (400 parameter_invalid); one of your own numbers or one already verified (409 caller_id_exists). The request is not replayed under an Idempotency-Key (its answer holds the code): a retry starts a new verification, and the older one fails as superseded. Live keys only.

mv.callerIds.create(body: CallerIdsCreateData["body"], options?: RequestOptions): Promise<CallerIdsCreateResponse>

POST /caller_ids · API reference

Name Type Required Description
body.phone_number string yes The number to verify, in E.164 (e.g. +97235550100). Not one of your own numbers (those need no verification), an emergency number or a premium-rate number.
body.friendly_name string no Your name for the number, shown in lists.
body.language "he" | "en" no The language our call speaks first (then the other one). Default he.
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

CallerId:

Field Type Description
id string The caller ID’s ID.
object "caller_id" Always caller_id.
livemode boolean true in live mode, false in test mode.
phone_number string The number, in E.164.
friendly_name string | null Your name for the number, or null.
status "pending" | "verified" | "failed" pending: our call is on its way, or waits for the code (10 minutes at most). verified: the number can be the caller_id of your calls and campaigns. failed: see failure_reason; start a new verification to try again.
failure_reason "wrong_code" | "no_answer" | "no_input" | "expired" | "call_failed" | "superseded" | null Why it failed: wrong_code, no_answer (the call was not answered), no_input (answered, nothing typed), expired (10 minutes passed), call_failed (we could not place the call), superseded (a newer verification of the number started). null unless failed.
method "call" | "attestation" call: verified by our call. attestation: an administrator attested ownership in the dashboard (usable on your own SIP connections only, not on MoreVoice Telephony).
verification_code string | null Only in the answer to POST /v1/caller_ids: the 6-digit code to show the person who will answer our call, who types it on the phone’s keypad. null everywhere else (we keep only a hash of it).
expires_at string | null While pending: when the code stops working. null otherwise.
verified_at string | null When the number was verified, or null.
created string When the verification started.
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const callerId = await mv.callerIds.create({
friendly_name: "Head office",
phone_number: "+97235550100",
});
console.log(callerId);

Delete a caller ID. Your calls can no longer present the number; a pending verification stops (its code no longer works). Verify the number again to use it later.

mv.callerIds.delete(id: CallerIdsDeleteData["path"]["id"], options?: RequestOptions): Promise<CallerIdsDeleteResponse>

DELETE /caller_ids/{id} · API reference

Name Type Required Description
id string yes A caller id verification ID (cid_…).
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options.headers["Idempotency-Key"] string no A 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.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

DeletedCallerId:

Field Type Description
id string The deleted caller ID’s ID.
object "caller_id" Always caller_id.
deleted true —
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const deletedCallerId = await mv.callerIds.delete("cid_7Hk2Lm9Qp");
console.log(deletedCallerId);

List caller IDs. Your caller IDs, newest first: verified, pending and failed ones. Deleted ones are not listed. Live keys only.

mv.callerIds.list(query?: NonNullable<CallerIdsListData["query"]>, options?: RequestOptions): PagedList<CallerIdsListResponse["data"][number], NonNullable<CallerIdsListData["query"]>>

GET /caller_ids · API reference

Name Type Required Description
query.limit integer no How many objects to return, 1–100 (default 20).
query.starting_after string no A cursor (next_cursor) or object ID: return the objects after it (older).
query.ending_before string no A cursor or object ID: return the objects before it (newer).
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

A PagedList: await it for the first page, for await it for every item.

import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
for await (const callerId of mv.callerIds.list()) {
console.log(callerId);
}

Retrieve a caller ID. Returns the CallerId object. Answers 404 with the code resource_missing when nothing has this ID in this organisation and mode.

mv.callerIds.retrieve(id: CallerIdsRetrieveData["path"]["id"], options?: RequestOptions): Promise<CallerIdsRetrieveResponse>

GET /caller_ids/{id} · API reference

Name Type Required Description
id string yes A caller id verification ID (cid_…).
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

CallerId:

Field Type Description
id string The caller ID’s ID.
object "caller_id" Always caller_id.
livemode boolean true in live mode, false in test mode.
phone_number string The number, in E.164.
friendly_name string | null Your name for the number, or null.
status "pending" | "verified" | "failed" pending: our call is on its way, or waits for the code (10 minutes at most). verified: the number can be the caller_id of your calls and campaigns. failed: see failure_reason; start a new verification to try again.
failure_reason "wrong_code" | "no_answer" | "no_input" | "expired" | "call_failed" | "superseded" | null Why it failed: wrong_code, no_answer (the call was not answered), no_input (answered, nothing typed), expired (10 minutes passed), call_failed (we could not place the call), superseded (a newer verification of the number started). null unless failed.
method "call" | "attestation" call: verified by our call. attestation: an administrator attested ownership in the dashboard (usable on your own SIP connections only, not on MoreVoice Telephony).
verification_code string | null Only in the answer to POST /v1/caller_ids: the 6-digit code to show the person who will answer our call, who types it on the phone’s keypad. null everywhere else (we keep only a hash of it).
expires_at string | null While pending: when the code stops working. null otherwise.
verified_at string | null When the number was verified, or null.
created string When the verification started.
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const callerId = await mv.callerIds.retrieve("cid_7Hk2Lm9Qp");
console.log(callerId);