Page tree
Skip to end of metadata
Go to start of metadata

Description

Splitting a profile into multiple new or existing profiles.

The profiles generated by splitting are not imports. Import trigger does not work on them.

URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
dataJSON object
"data": {
    "_fname": "John",
    "_lname": "Doe"
}
No

Profile data that will change after splitting

db_idint1YesDatabase ID
skip_triggersbooltrueNoSkip trigger events
By default – false
sourceJSON object
"source": {
	"db_id": 1,
	"email": "test1@mail.ru"
}
YesContains matching data about the profiles to be split
destination

array

"destination": [
	{
		"db_id": 3,
		"email": "test3@mail.ru"
	}
]
Yes

Contains the matching data of the profile resulting from the splitting

matchingstring

"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 from the profile or subscriptions

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.

field_name

stringcustom_ID

Yes, if

"matching": "custom"

Name of custom database field if matching : custom. In the data collection form, a field with the same name is required for search.
field_valueint/stringcustom_string

Yes, if

"matching": "custom"

Value of custom database field if matching : custom.
subscriptions


booltrueNo

Copy and split subscriptions

By default – true

historybooltrueNo

Copy history and activity flags

By default – true

static_segments


booltrueNo

Whether to make changes to static segments or not (source-profiles will leave the segments, and destination-profile will enter)

By default – false

subscription_filtersJSON object
"subscription_filters": [
	{
		"resource_id": 1,
		"channel": "push",
		"provider": "Safari"
	}
]
No

Filter to copy specific subscriptions.

If not specified, all subscriptions are copied.

overwritebooltrueNo

Whether to copy the fields of source profiles or not

If the destination profiles have empty fields, these fields will be filled with the fields of the source profile in any case.

deletebooltrueNoWhether to delete source profiles after splitting or not

Request example

{ 
	"matching": "custom", 
	"field_name": "field_1",
	"source": { 
		"db_id": 1, 
		"field_value": 1, 
		"data": { 
			"_fname": "Profile1",
			"_lname": "LnameProfile1" 
		}
	},
 	"destination": [
		{ 
			"db_id": 2, 
			"matching": "email", 
			"email": "test2@mail.ru", 
			"data": { 
				"_fname": "Profile2", 
				"_lname": "LnameProfile2"
			},
		},
		{
			"db_id": 2,
			"field_value": 3,
			"data": {
				"_fname": "Profile3",
				"_lname": "Lname3"
			},
			"subscription_filters": [
				{
					"resource_id": 1,
					"channel": "push",
					"provider": "Safari"
				},
				{
					"resource_id": 2,
					"channel": "email",
				}
			]
		}
	],
	"subscriptions": true, 
	"static_segments": true, 
	"history": false, 
	"token": "abcdefghijklmnqrstuvwxyz" 
}

Copying profile fields

moving(1).png

Response example

{
	"destination_ids": [
		{
			"db_id": 2,
			"profile_id": "60a7b150fa3adb6f1179fe7f"
		},
		{
			"db_id": 2,
			"profile_id": "60a7b150fa3adb6f1179fe80"
		}
	],
	"error": 0,
	"error_text": "",
	"source_id": {
		"db_id": 1,
		"profile_id": "60a7a45bfa3adb7132dcceaa"
	}
}

Response parameters

ParameterTypeDescription
destination_idsJSON object

Contains data about the profile resulting from the split:

db_id - database ID

profile_id - profile ID

source_idJSON object

Contains data about split profiles as a list:

db_id - database ID

profile_id - profile ID

errorintError code
error_textstringError text
  • No labels