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

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

Response example

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

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
profile_idstringProfile ID