The import pipeline is being introduced behind
MCP_IMPORTS_ENABLED on the API and worker. Dashboard adoption additionally requires NEXT_PUBLIC_MCP_IMPORTS_ENABLED. These instructions apply when the feature is enabled for your deployment. A FeatureNotEnabled error means the deployment has not enabled it yet.imports.write, resources.read, explicit project grants, and a current role that can manage audiences. Topic subscriptions also require the current automation-management capability. Existing keys do not receive new permissions automatically. Billing is outside MCP scope.
Choose the input
Imports accept contacts, property declarations, static or dynamic audience definitions, static memberships, and topic subscriptions. File formats are CSV, Excel.xlsx, JSON arrays, and NDJSON. A single import supports at most 1,000,000 rows, 500 MiB uploaded, 100 columns per row, and 64 KiB per row. Excel requires an exact worksheet name and has bounded decompression; formulas, macros, external links, and encrypted archives are rejected.
Upload only to the Sendrealm-controlled URL returned by the service. Arbitrary remote URLs are not fetched. Coding clients can stream bytes using the SDK or CLI. Chat clients can append typed batches of at most 500 rows and 1 MiB, or provide the returned upload_handoff.url to the signed-in owner. A hosted MCP server cannot read a local file path.
Stage, validate, review, apply
- Discover the account, team, and project. Use
project_getto verify the intended project. - Call
imports_createwith the kind, format, mapping, explicit references, and a uniqueidempotency_key. - For files, request
imports_upload_url, upload the bytes with its returned headers, and never attach the personal key to object storage. For batches, callimports_append; reuse apart_idonly with identical rows. - Call
imports_validate. Pollimports_getusingpoll_after_ms. - Inspect
imports_errorsandimports_preview. Preview creates no contact, membership, subscription, queue-delivery, or provider effects. - Commit only after reviewing the proposed changes. Pass the returned
prepared_action_idand a stable executionidempotency_keytoimports_commit. - Poll until completion. Retain the import ID and counts for reconciliation.
Merge and consent rules
Supplied nonempty fields merge with existing data. Omitted values and empty cells preserve existing values. To clear a field, explicitly setclear_empty: true for that mapping. Emails are trimmed and lowercased. The first occurrence of an identity wins within an import; later duplicates receive row findings. Existing ambiguous duplicates are errors and are never silently merged.
New memberships remain unsubscribed unless both the import asserts consent and the row explicitly supplies is_subscribed: true. Existing unsubscribes remain protected even with asserted consent. Imports never clear delivery suppressions.
Valid rows apply by default, while invalid rows are reported. strict: true blocks preparation/commit when any row is invalid. Fix malformed source rows in a new import.
automation_effects defaults to suppress, including queued work, derived events, and replay. trigger can start or resume live automations and send real messages; it additionally requires automations.trigger and current automation-management capability. Authorization is rechecked before work and between batches.
Recover safely
Preparations expire after ten minutes and bind the actor, key, grants, project, and validated import version. Re-preview after a stale preparation. Receipts and queue intent are committed atomically; a repeated commit with the same preparation and idempotency key returns its saved receipt. Cancellation stops remaining work and keeps already committed rows.imports_retry_failed revalidates unsuccessful work without replaying applied rows; review and commit its new preparation. Revocation, expiry, membership loss, and role downgrades stop further application. A transient failure can leave a partial import; inspect counts before taking another action.
imports_errors is paginated: pass metadata.next unchanged as after. Source files and protected row findings expire after seven days; payload-free audit summaries follow the existing retention policy.
SDK and CLI
SENDREALM_API_KEY; do not pass secrets in command-line arguments or chat. The CLI uploads and validates without automatically committing.