Skip to Content

Preview a list migration

The complete encoded JSON request must not exceed 3000000 bytes.

POST
/v1/contacts/imports/plan

The complete encoded JSON request must not exceed 3000000 bytes. Reads multiple export files without changing contacts. Readers are assumed opted in where permission evidence is absent or blank. Explicit restrictive evidence wins per address. Returns estimated counts and at most 100 diagnostics; processing rechecks current restrictions. Filenames never establish permission. Missing email columns refuse the file; unrecognized nonblank status values are conflicts and never subscribe a reader.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
preset*string
Value in"beehiiv""substack""kit""mailchimp"
topicId*TopicId
Match^tpc_[0-9a-hjkmnp-tv-z]{16,24}$
namespaceId?|null
files*array<>
Items1 <= items <= 20

Response Body

Success

application/json
  1. response
planHash*string
presetVersion*string
namespaceId*|null
topicId*TopicId
Match^tpc_[0-9a-hjkmnp-tv-z]{16,24}$
canStart*boolean
counts*
diagnostics*array<>
diagnosticsTruncated*boolean
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.contacts.planImport({
  "preset": "beehiiv",
  "topicId": "example",
  "files": [
    {
      "name": "example",
      "csv": "example"
    }
  ]
});
Example Response
{
  "planHash": "string",
  "presetVersion": "string",
  "namespaceId": "string",
  "topicId": "string",
  "canStart": true,
  "counts": {
    "totalRows": 0,
    "uniqueAddresses": 0,
    "subscribed": 0,
    "unsubscribed": 0,
    "suppressed": 0,
    "skipped": 0,
    "conflicts": 0,
    "created": 0,
    "existing": 0
  },
  "diagnostics": [
    {
      "file": "string",
      "row": -9007199254740991,
      "code": "string",
      "message": "string",
      "email": "string"
    }
  ],
  "diagnosticsTruncated": true
}

Related documentation