Through the API, creating an import needs an API key with write access to the
contact permission resource, and reading imports needs read access. See Set up Broadcast.How an import works
1
Create the import
POST /contacts/imports records your options and returns an upload URL with signed form fields. The upload URL stops accepting files 10 minutes after creation.2
Upload the file
Post the CSV file to the upload URL as a multipart form, at most 20 MB.
3
Follow the import
GET /contacts/imports/{importId} returns the status and the row counters. Read it until the status is completed, failed, expired, or canceled.From the dashboard
In the dashboard, open Broadcast > Contacts and click Import CSV. The page creates the same import as the API, always with an explicit column mapping. The rest of this guide applies to it: the file rules, what each row does, segments, topics, and unsubscribes. The page has two tabs: New import holds the form, and History lists the imports. The form has five steps, File, Preview in your browser, Columns, Targets and consent, and Start, shown in a row at the top, with the current step’s content below. Continue opens the next step once the current one is complete; Back opens the step before. A completed step in the row opens again on click. Back on the Preview in your browser step shows the drop area again, to choose another file.1
Drop the file
Drop one CSV file, or click Choose a file. Nothing from the file leaves your browser until you start the import. The page moves on to the file’s preview.
2
Check the preview
The Preview in your browser step shows the file’s columns and first three data rows, then counts the data rows and the rows that will be unsubscribed. Click Continue.
3
Pick a target for each column
Each column gets a suggested target under Import as: Email, Unsubscribed, one of your contact properties, Create property, or Ignore. Change any suggestion; pick Ignore to leave a column out. Create property opens a small panel with Property name and Type (String or Number); the pencil button next to the target opens it again. Click Continue.
4
Choose the targets and confirm consent
Pick segments under Add to segments, topics under Subscribe to, and, under Existing contacts, Update existing contacts (
upsert, the default) or Leave existing contacts unchanged (skip). Then check the consent box and click Continue.5
Start the import
The last step summarizes the file, the columns, the targets, and the consent, each with an Edit link to its step. Click Start import. The page creates the properties marked Create property, creates the import, then uploads the file, and asks before you leave while the upload runs. Once storage confirms the upload, the page clears the file, the mapping, and the consent, and switches to the History tab, where the import is the top entry. The targets stay for your next import.
Suggested targets
A column matches a target when their names are equal once lowercased, with every character other than an ASCII letter or digit removed.First Name, first-name, and FIRSTNAME all match the property first_name.
email,e-mail,mail, andemail addresssuggest Email;unsubscribed,unsubscribe, andopted_outsuggest Unsubscribed. Both win over a property with the same name.- A column matching one of your properties suggests that property. A second import of the same export reuses the properties the first one created.
- A column matching nothing suggests Create property, type String, with a name built from its header. The header is lowercased, each run of characters other than ASCII letters, digits, and
_becomes one_, and leading or trailing_are removed.Date d'inscriptionbecomesdate_d_inscription. - Each target, a property to create included, is suggested for the leftmost matching column only. A later column with no other free match starts on Ignore.
- A header matching nothing that cannot be a property name, such as
id,2024, orИмя, starts on Ignore. Pick Create property and type a name to import it. - A header that looks like an email address starts on Ignore: the file probably has no header row.
- When your existing properties cannot be loaded, the columns table stays disabled until Load again succeeds.
What blocks the start
The page does not let you start, and says why next to the cause, when the import would certainly fail or be refused. A file or column problem keeps that step’s Continue disabled, and you on that step, until you fix it. This happens, for example, when:- the file is empty or larger than 20 MB, is not UTF-8, has a quoting error, or has more than 256 columns,
- no column is mapped to Email, or two columns are mapped to the same target (Mapped twice: pick one),
- a mapped header appears twice in the file,
- a property to create has a name that is not allowed.
- an unsubscribed value that is not accepted,
- a value that is not a number in a Number column,
- an email address that cannot be used,
- a different number of columns than the header.
Status column holding subscribed or unsubscribed to Unsubscribed: neither value is accepted, so every row holding one fails. A header with a semicolon or a tab and no comma also warns: export the file again as CSV UTF-8, comma-separated.
Your browser computes the preview counts. When they differ from the import’s counters in the History tab, the counters show what the import wrote.
Consent
The Continue to the start step stays disabled until you check this box:I confirm that every contact in this file agreed to receive email from my organization, and that none of them come from a purchased, rented or third-party list.It links to the prohibited uses in the Terms of Service, and resets for every new file. The import records the member who started it in
initiator, and when they confirmed consent in consentConfirmedAt. See Create an import.
When the start does not finish
- When the page created properties and then failed to create the import, it keeps those properties and lists them. Their rows now target the created properties, so a new start does not create them again.
- A refused upload, or a tab closed during the upload, leaves the import Waiting for file until it expires on its own. Start again to create a new import.
- When storage gives no usable answer, the page cannot confirm the upload and asks you to check the import in the History tab before starting again. If that import received the file, a second start imports it a second time.
- When the answer to the import creation is lost, the page cannot confirm the start and asks you to check the History tab. The properties to create may already exist.
Import history
The History tab lists your organization’s imports, from the dashboard and from the API, newest first. Load older shows older ones. Each entry shows its status, creation time, origin (Dashboard or API), row counters, and, for a failed import, its reason. Select an entry for its detail: counters, unresolved references, options, file size and received time, and start and finish times. While an import is unfinished, its entry and the open detail refresh every 5 seconds, as long as the History tab is shown and the page is visible. The statuses are those of the API: see Statuses. After the page uploads a file, its import shows File received, starting soon until processing starts, or Waiting for file once you reload the page.Create an import
SendIdempotency-Key on every creation. See Retries and idempotency.
{} creates an import with the defaults below.
The response is
201 with the import and three fields that only the creation returns:
initiator, consentConfirmedAt, processingStartedAt, finishedAt, and updatedAt.
initiator says who created the import. An import created through the API has initiator.type api_key, the id of the calling key, and consentConfirmedAt null. Retrieve and list also return imports started from the dashboard, with initiator.type user and the id of the member who started it. Their consentConfirmedAt is the time that member confirmed consent. A creation body cannot set either field.
The creation fails with 422 and creates nothing when an option is invalid, for example:
- a segment or topic id that your organization does not hold,
- a topic listed twice with two different states,
- a mapping with no header, or with two headers, mapped to the email,
- a mapping that maps two headers to the same target,
- a mapping with a header that is
__proto__once surrounding whitespace is removed. That name is reserved, so rename the column in your file, - a mapped property name that matches none of your contact properties. A name that differs from an existing property only by letter case is refused with
contact_property_name_case_mismatch, which names the property to use, as on a contact creation.
Upload the file
Post the file touploadUrl as multipart/form-data:
- Copy every entry of
uploadFormFieldsas a form field, unchanged, and add no other field. - Add the file last, in a field named
file. Fields placed after it are ignored. - Do not send your API key. The signed fields authorize this one upload.
- Upload before
expiresAt, 10 minutes after creation. The file must hold 1 byte to 20 MB, or at mostdeclaredFileSizewhen you set it.
2xx response means the file is stored. A file above the size limit, or an upload after expiresAt, is refused with a 4xx response, and the import stays awaiting_upload until it expires. To upload again, create a new import.
Each import reads one file: the first one stored through its upload URL. A second file posted to the same URL is never read. To import a corrected file, create a new import.
Follow the import
processing, contacts are written in batches: the contacts of every finished batch are visible through the API, and rows counts them.
GET /contacts/imports lists the imports of your organization, newest first, with the limit and cursor pagination of the other list endpoints. Neither endpoint returns the upload URL again.
Statuses
You cannot cancel an import, from the dashboard or through the API, and a final status never changes.
Failure reasons
To write the remaining rows after a
processing_timeout, create a new import with the same file. Rows that were already written then count as updated under upsert, or as skipped under skip.
Prepare the file
The file must be:- UTF-8, with or without a byte order mark,
- comma-separated, with a header row, and fields quoted with double quotes when they hold a comma, a quote, or a line break,
- at most 256 columns,
- at most 20 MB.
invalid_format, writing nothing, when the file has no header row, holds an invalid UTF-8 byte, has an unterminated quoted field, has more than 256 columns, or uses another delimiter such as a semicolon or a tab. A header-only file completes with every counter at zero.
Map the columns
Each column goes to one target: the email, the unsubscribed flag, or a contact property. Headers are compared after removing surrounding whitespace, and letter case counts. WithoutcolumnMapping, headers are matched by name:
- a header
emailgoes to the email, and a headerunsubscribedto the unsubscribed flag, - a header equal to the exact name of one of your contact properties goes to that property,
- every other column is ignored, including columns with an empty header.
invalid_format when no header is email, when two non-empty headers are identical, or when a header matches both a field name (email or unsubscribed) and a property name. A header Email does not match: use a mapping for headers that differ from the target names.
Do not create or delete contact properties while an import without columnMapping is processing. Headers are matched to your properties again each time processing resumes, so a change can leave a column filled for only part of the file.
With columnMapping, only the mapped headers are read, and nothing is matched by name. Exactly one header maps to { "type": "email" }. The others map to { "type": "unsubscribed" } or to { "type": "property", "name": "<exact property name>" }, each target at most once. The import fails with invalid_format when a mapped header is missing from the file or appears twice. A mapped unsubscribed column that is missing from the file fails the import too, so those contacts are never imported as subscribed.
Cell values
The number rule is stricter than the contact API on purpose: every accepted value is stored exactly.
What each row does
Rows are handled in file order. Each row gets one outcome:
A created contact gets the row’s non-empty values, and a property left empty gets its default value when its definition has one. An updated contact gets the row’s non-empty values too, but an empty cell keeps the stored value: an import never removes a property value.
Several rows for one address follow the same rules, in file order. The first row creates the contact. Under
upsert the next rows update it, so the last non-empty value wins; under skip they are skipped. The counters count rows, not contacts.
Two imports running at the same time can write the same contact. The values of the batch written last stand.
Failed rows write nothing
A row fails when:- its email cell is empty or is not a valid email address,
- a value does not fit its property type, such as
abcfor a number property, or holds a character that cannot be stored, such as a null byte, - its values would exceed the property limits of a contact,
- it has more or fewer fields than the header,
- its unsubscribed value is not one of the accepted values.
unsubscribed = true but fails on another cell, the contact stays subscribed until you fix the row and import it again.
Segments and topics
Created and updated contacts join every segment listed insegments. Skipped and failed rows add nobody, and a contact that is already a member stays one.
Each topic state in topics applies to the contact of every created, updated, or skipped row, whatever the row’s unsubscribed value. The file has no per-row topic column.
Unsubscribes, bounces, and complaints
A row whose unsubscribed value is true records an unsubscribe for its address, also when the row isskipped. It works like an unsubscribe through the link in a broadcast: the address is left out of every later broadcast and the unsubscribe stays when the contact is deleted. An address that already has an unsubscribe keeps it.
An import never resubscribes anyone. A false or empty unsubscribed value does not remove an existing unsubscribe, and a later row for the same address does not undo an unsubscribe written by an earlier row.
An import does not add addresses to the suppression list. When you move your list from another provider, map the addresses that provider marked as bounced, cleaned, or complained to the unsubscribed column with the value true. Otherwise they stay in your audience.
unsubscribed changes that topic only. Add an unsubscribed column set to true on every row of that file, then import it. Import it before or after your main list: since an import never resubscribes anyone, the order does not matter.
Deleted segments, topics, and properties
Your options are checked at creation, and every segment, topic, and property is looked up again while the rows are written. When one was deleted in between:- a deleted segment or topic is skipped for the rest of the import,
- a deleted property’s column is ignored for the rest of the import,
- the import still completes, and lists each of them in
unresolvedReferenceswith its type and its id or name.
columnMapping, a property deleted just before processing resumes is no longer matched by name, so its column is ignored without being listed (see Map the columns).
A property deleted and created again with another type is checked against its current type. The options shown on the import never change after creation.
Retries and idempotency
Send anIdempotency-Key header on every creation, and keep the key until you have the response.
A replayed response is the first response unchanged, including its upload URL and
expiresAt, and the import as it was at creation. Before you upload with it:
- Compare
expiresAtwith the current time. BeforeexpiresAt, upload with the replayed fields. - After
expiresAt, retrieve the import. If it is stillawaiting_upload, create a new import with a new key and upload with the new response. The old import expires on its own and writes nothing.
Imports and erasure requests
An import writes the rows of the file you uploaded, as you uploaded it. If you delete a contact after uploading a file that contains its address, the import can create that contact again when it processes the file. An import cannot be canceled once its file is uploaded, and it writes nothing later than 72 hours and 30 minutes after the upload. To honor an erasure request that arrives while an import is pending, wait until the import iscompleted or failed, then delete the contact. Better, remove the address from the file before you upload it. An import never removes an unsubscribe: if the person asked to stop receiving your emails, unsubscribe them. The unsubscribe stays in force even if the contact is deleted and later imported again. The uploaded file is never read more than 72 hours after its upload and is deleted within 7 days of upload.
See Data retention for what the import keeps after its file is deleted.
Next steps
Contacts, segments, and topics
Contact properties, segments, topics, and how recipients are chosen
Unsubscribe and suppression
What an unsubscribe changes and how the suppression list works
Create and send a broadcast
Send to your imported contacts
Idempotency keys
Key format, replayed responses, and error codes
