mv.imports
Background contact-list imports and their results. These methods are on mv.imports, 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.
retrieve()
Section titled “retrieve()”Retrieve a contact import.
mv.imports.retrieve(id: ImportsRetrieveData["path"]["id"], options?: RequestOptions): Promise<ImportsRetrieveResponse>GET /imports/{id} · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | A import ID (imp_…). |
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. |
Returns
Section titled “Returns”ContactImport:
| Field | Type | Description |
|---|---|---|
id |
string |
A import ID (prefix imp_). |
object |
"import" |
Always import. |
livemode |
boolean |
true in live mode, false in test mode. |
campaign_id |
string |
A campaign ID (prefix cmp_). |
status |
"pending" | "processing" | "succeeded" | "failed" |
pending → processing → succeeded | failed. Poll GET /v1/imports/{id}. |
source |
"csv" | "xlsx" | "url" |
— |
filename |
string | null |
— |
received |
integer |
Non-empty contacts / rows received. |
imported |
integer |
Contacts added to the campaign for dialling. |
rejected |
integer |
Contacts not added for dialling (invalid, duplicate, do-not-call). |
rejected_reasons |
ContactRejectedReasons |
Rejected contacts per reason. |
without_consent |
integer |
Marketing: contacts added without a consent record. The dialer skips them (§30A) unless consent is recorded first. |
consent_recorded |
integer |
Consent records created from the evidence sent. |
errors |
object[] |
Rejected rows (the first 100). |
warnings |
object[] |
Rows added with a problem (the first 100). |
error |
object | null |
Why the import failed (status failed): a stable code and a message to show. |
created_at |
string |
An ISO-8601 timestamp in UTC. |
started_at |
string | null |
— |
completed_at |
string | null |
— |
Example
Section titled “Example”import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({ client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),});
const contactImport = await mv.imports.retrieve("imp_03Qu53ReMZGnf2tTFLIvVj");console.log(contactImport);