The request part with file is required. It has to be uploaded as file part in form-data. filename parameter must be
specified (request part header example: Content-Disposition: form-data; name="file"; filename="contacts.csv"). File
must have .csv or .txt extension and has to have a valid CSV format with size smaller than 32MB.
Every contact in the file must be in a separate line. The simplest file has just one column with header(messenger_id)
and value for new conversation in every line.
Example:
csv
messenger_id
4eefc52e-d001-481a-8fcf-d683ef82ee9b
daf93c3e-832c-4866-bbd3-e19d14205824
If the contact with the specific messenger_id already exists and the file has more than one column, conversation will
be updated with the values from file.
column name format required description messenger_id string R defines the new conversation messenger id signed_up datetime in ISO 9075 O defines the date of contact's opt-in, defaults to now marketing_opted_in datetime in ISO 9075 O defines the date of contact's marketing opt-in, defaults to null (no marketing) marketing_opted_out datetime in ISO 9075 O defines the date of contact's marketing opt-out, defaults to null labels semicolon separated strings O add labels to newly created conversation phone integer O set phone to newly created conversation email string O set email to newly created conversation name string O set name to newly created conversation, if set, system will not use the name provided by messenger * string O set attribute with custom key in newly created conversation
As a separate form-data part, the additional payload can be defined in payload part (request part header must
be: Content-Disposition: form-data; name="payload"). It has to contain a string with valid json in format defined
in payload field in scheme section.
If the additional data contains field labels, those labels will be added to every imported contact. It means, that
every contact will have default labels, labels from labels column from file (if provided) and labels from additional
data payload.
If the additional data contains field dry_run set to true, no changes will be applied. The imported file will be
just validated. Use it to check your file before upload.
Note: duplicated labels are ignored, and added just once to the contact.
Full file example:
csv
messenger_id,signed_up,marketing_opted_in,marketing_opted_out,labels,phone,email,name,attr1,attr2
4eefc52e-d001-481a-8fcf-d683ef82ee9b,2020-01-01T12:00:00Z,2020-01-01T12:00:00Z,2020-01-01T12:00:00Z,l1;l2,49678678676,[email protected] ,New Existing 3,a11,a12
daf93c3e-832c-4866-bbd3-e19d14205824,,,,,,,,,
607cf377-b787-403e-8aac-1acdffefc200,2020-01-01T12:00:00Z,2020-01-01T12:00:00Z,2020-01-01T12:00:00Z,l1;l2,49678678677,[email protected] ,New 1,a21,a22
Payload example:
JSON
{
"labels": [
"label-1",
"label-2",
"label-1"
]
}