Import profile
Description
Imports a customer profile. It also can be used to update an existing profile.
Can delete custom fields, add or delete tags, increase or decrease field values. See update functions for reference.
tip
To launch a trigger mailing right after the import you can use Import + trigger request.
Request URL
Method: POST
https://example.com/api/v1.1/profiles/import
Request parameters
caution
- For JSON body use the following header: Content-Type: application/json.
- For XML body use the following header: Content-Type: application/xml.
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| db_id | int | 1 | Yes | Database ID |
| matching | string | "email" "email_profile" "email_sub" "phone" "phone_sub" "profile_id" "push_sub" "custom" "custom_sub" "email_phone" "email_phone_sub" | No, if matched by email | Profile matching mode By default — email For each type of matching, certain fields must be passed in the request body. Learn more about these fields here. |
| skip_triggers | bool | true | No | Skip trigger events. By default – false |
| skip_invalid_subscriptions | bool | true | No | Skip invalid subscriptions By default – false |
| detect_geo | bool | true | No | Detect location by _regip or _ip from data object |
| add_to_segments | array | [1, 2] | No | Add a profile to a segment |
| remove_from_segments | array | [1, 2] | No | Remove a profile from a segment |
| data | JSON object | { | Yes | Profile fields data, including resource subscription data ( subscriptions) |
Subscriptions array
The subscriptions array stores data about the profile's subscriptions to resources. One object is one subscription.
| Parameter | Type | Example | Description |
|---|---|---|---|
| resource_id | int | 1 | Resource ID |
| status | string | "subscribed" | Subscription status |
| priority | int | 1 | Subscription priority If the subscription priority is passed in the request, the "Increase priority for new subscriptions" option in the resource does not work. |
| custom_fields | object | { |