Skip to main content

Add multiple profiles

Description

Adds multiple new profiles to a database.

Profiles list is contained in "data" parameter as a JSON array. Server response will contain "result" parameter with occurring errors and profile IDs.

caution

In one request it is not recommended:

  • transfer more than 10,000 profiles;
  • transfer more than 10 MB of data. It is possible totransfer more data using multiple streams.

Request URL

Method: POST

https://example.com/api/v1.1/profiles/add_batch/

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
dataJSON object

[    {       "_fname": "John",       "_lname": "Doe",       "subscriptions": [          {              "channel": "email",              "email_data": {                  "email": "john@example.com"              },             "resource_id": 1          }       ]    } ]

YesProfiles fields data
db_idint1YesDatabase ID
skip_triggersbooltrueNoSkip trigger events.
By default – false
skip_invalid_subscriptionsbooltrueNoSkip invalid subscriptions.
By default – false

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"skip_triggers": true,
"data": [
{
"_fname": "John",
"_lname": "Doe",
"subscriptions": [
{
"channel": "email",
"email_data": {
"email": "example@example.com"
},
"resource_id": 27
}
]
}
]
}

Response example

{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"error": 0,
"error_text": "Successful operation",
"profile_id": "663a138cee44bb50a67115cd"
}
]
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
profile_idstringProfile ID