Skip to content

mv.dnc

The organisation’s do-not-call list and registry checks. These methods are on mv.dnc, 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.

Check numbers before calling. For each number: your do-not-call list, recorded consent and the national registry, combined into callable for the purpose. Read-only.

mv.dnc.check(body: DncCheckData["body"], options?: RequestOptions): Promise<DncCheckResponse>

POST /dnc/check · API reference

Name Type Required Description
body.phones string[] yes Up to 100 numbers.
body.purpose "service" | "marketing" | "survey" yes The call’s purpose. marketing requires recorded consent and a national-registry clearance (Israeli numbers); every purpose respects your do-not-call list.
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.

DncCheck:

Field Type Description
object "dnc_check" Always dnc_check.
livemode boolean true in live mode, false in test mode.
purpose "service" | "marketing" | "survey" —
results object[] —
import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({
client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),
});
const dncCheck = await mv.dnc.check({
phones: [
"+972501234567",
"0527654321",
],
purpose: "marketing",
});
console.log(dncCheck);

Add numbers to the do-not-call list. Adds up to 1,000 numbers. Each new number emits one contact.opted_out event, and queued campaign contacts with it are taken out at once. Needs a live key.

mv.dnc.create(body: DncCreateData["body"], options?: RequestOptions): Promise<DncCreateResponse>

POST /dnc · API reference

Name Type Required Description
body.phones string[] yes Up to 1000 numbers.
body.reason string no A note kept with each entry.
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.

DncBatch:

Field Type Description
object "dnc_batch" Always dnc_batch.
livemode boolean true in live mode, false in test mode.
added string[] Numbers added now (E.164). Each emits one contact.opted_out event.
already_listed string[] Numbers that were on the list already (E.164).
invalid string[] Entries that are not valid phone numbers, as sent.
import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({
client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),
});
const dncBatch = await mv.dnc.create({
phones: [
"+972501234567",
"052-765-4321",
],
reason: "Opted out in the CRM",
});
console.log(dncBatch);

Remove a number from the do-not-call list. Calls to the number are allowed again (marketing calls still need consent and the registry). Needs a live key.

mv.dnc.delete(phone: DncDeleteData["path"]["phone"], options?: RequestOptions): Promise<DncDeleteResponse>

DELETE /dnc/{phone} · API reference

Name Type Required Description
phone string yes The number (URL-encode the + as %2B).
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.

DeletedDncEntry:

Field Type Description
object "dnc_entry" Always dnc_entry.
phone string —
deleted true —
import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({
client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),
});
const deletedDncEntry = await mv.dnc.delete("+972501234567");
console.log(deletedDncEntry);

List the do-not-call list.

mv.dnc.list(query?: NonNullable<DncListData["query"]>, options?: RequestOptions): PagedList<DncListResponse["data"][number], NonNullable<DncListData["query"]>>

GET /dnc · 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).
query.phone string no Only this number (any common form).
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 { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({
client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),
});
for await (const dnc of mv.dnc.list()) {
console.log(dnc);
}

Retrieve a do-not-call entry.

mv.dnc.retrieve(phone: DncRetrieveData["path"]["phone"], options?: RequestOptions): Promise<DncRetrieveResponse>

GET /dnc/{phone} · API reference

Name Type Required Description
phone string yes The number (URL-encode the + as %2B).
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.

DncEntry:

Field Type Description
object "dnc_entry" Always dnc_entry.
livemode boolean true in live mode, false in test mode.
phone string The number, E.164.
source string How it was added: manual, import, api, opt_out_tool (asked the AI), opt_out_phrase or opt_out_dtmf.
reason string A free-text note.
campaign_id string | null cmp_… ID.
call_id string | null call_… ID.
created string An ISO-8601 timestamp in UTC.
import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({
client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),
});
const dncEntry = await mv.dnc.retrieve("+972501234567");
console.log(dncEntry);