Start or resume a list migration
The complete encoded JSON request, including new-start metadata, must not exceed 3000000 bytes.
The complete encoded JSON request, including new-start metadata, must not exceed 3000000 bytes. Admits a durable import using the preview hash and an Idempotency-Key header, or resumes the same persisted input at its committed cursor. The header is required for mode:new and optional for mode:resume. Only mode:new supports idempotent replay. Resume uses expectedGeneration and must not be automatically retried; read getImportJob after an ambiguous response. Imports never restore an existing unsubscribe, suppression or bounce. Imported suppressions use the contact's namespace. Namespace-scoped credentials import contacts and restrictions only into their own namespace; organization-level suppressions protect every namespace. New active contacts are billable and normal contact events apply.
apiKeyx-api-key<token>idempotency-key?string1 <= length <= 255application/json- body
mode*"new""new"input*planHash*stringSuccess
application/json- response
id*ContactImportJobId^cimport_[0-9a-hjkmnp-tv-z]{16,24}$namespaceId*|nulltopicId*TopicId^tpc_[0-9a-hjkmnp-tv-z]{16,24}$preset*string"beehiiv""substack""kit""mailchimp"status*string"queued""running""finalizing""completed""failed"generation*integer0 <= value <= 9007199254740991counts*processedRows*integer0 <= value <= 9007199254740991totalRows*integer0 <= value <= 9007199254740991createdAt*stringstartedAt*string|nullupdatedAt*stringcompletedAt*string|nullfailure*|nullresumable*booleanimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.contacts.startImport({
"mode": "new",
"input": {
"preset": "beehiiv",
"topicId": "example",
"files": [
{
"name": "example",
"csv": "example"
}
]
},
"planHash": "example"
});{
"id": "string",
"namespaceId": "string",
"topicId": "string",
"preset": "beehiiv",
"status": "queued",
"generation": 0,
"counts": {
"totalRows": 0,
"uniqueAddresses": 0,
"subscribed": 0,
"unsubscribed": 0,
"suppressed": 0,
"skipped": 0,
"conflicts": 0,
"created": 0,
"existing": 0
},
"processedRows": 0,
"totalRows": 0,
"createdAt": "string",
"startedAt": "string",
"updatedAt": "string",
"completedAt": "string",
"failure": {
"code": "string",
"message": "string",
"retryable": true
},
"resumable": true
}