Importing Email Subscriptions

Batch supports importing your known email subscribers in three ways:

  • CSV Import
  • Profile API
  • Using our mobile SDKs iOS/Android

CSV Import

CSV Imports allow you to easily import user emails and their subscription state into Batch without having to implement an API. The downside is that importing those files can only be done manually or periodically.

See with your technical contact for more info about the import frequency

File format

In order to be able to be imported, the file MUST be a valid CSV file. If your delimiter is something else than a comma, make sure to mention it when sending us the file.

The CSV file MUST contain the following fields, in this order:

email,custom_user_id,marketing_subscription,language,region,timezone

All columns but the first two are optional: they must be present but they can have an empty value.
The file's first line can be the CSV column header.

IdDescription
email - Required
The user's email
custom_user_id - Required
Custom User ID of the user you want to set the email on. This is the same ID set using the SDK and Custom Data API
E.g."john_doe, ba380e36-394f-4d46-a403-00c77df0c3a7"
marketing_subscription - Optional
Should the user be subscribed to marketing emails? Leave empty if you don't know, set to 0 if they should not, 1 if they should. You should only subscribe a user when they have given their EXPLICIT CONSENT to subscribe to marketing emails.
E.g."0"
language - Optional
Language of the user in ISO 639-1 format. See here for all valid language codes.
E.g."en"
region - Optional
Country of the user. If you do not specify a region, the user will automatically be put in the XX (no country) category. This should be written in ISO 3166-1 alpha-2 format. See here for all valid region codes.
E.g."US"
timezone - Optional
Timezone of the user. This should be written in IANA TZ identifier format. See here for more info about allowed values.
E.g."Europe/Paris"

Example:

email,custom_user_id,marketing_subscription,language,region,timezone
test@batchtest.com,test_user,1,fr,FR,Europe/Paris
foo@sample.batch.com,abcdef,,,,
sample+unknown@batch.com,abcdef,,EN,US,America/Dawson_Creek

Once you're done, send the CSV file to your technical contact. We will notify you once the import is complete.

Profile API

The Profile API allows you to to both an initial sync of your userbase and periodic synchronisations using backend-to-backend communication.
Updates are processed as soon as the API gets called.

You can find its documentation in the API section.