Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v72
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
    • Import profile
    • Update profile
    • Import multiple profiles
    • Update multiple profiles
    • Add multiple profiles
    • Add profile to database
    • Quick profile import
    • Import profile to RabbitMQ
    • Get profile data
    • Uploading profiles to a file
    • Suspend all database profiles
    • Unsuspend all profiles in a database
    • Delete profile
    • Subscription fields functional update
    • Database fields functional update
    • Merging multiple profiles
    • Unsubscribe profile from resource
    • Profile splitting
    • Subscriptions
    • Action history
    • Profile relations
    • Get data for multiple profiles
  • Databases
  • Resources
  • Segments
  • Static segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Automation scenarios
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDevv71
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
This is documentation for Altcraft Platform v72. This documentation is no longer maintained.
The information for up-to-date platform version at this page is available (v74).
  • Profiles
  • Merging multiple profiles
Documentation for version v72

Merging multiple profiles

Description​

Combining multiple profiles into a new profile or existing one.

caution
  • The profiles generated by merging are not imports. Import trigger does not work on them.
  • Email: localhost - as an absent field, it is created if necessary and is not copied to another profile.
  • Not localhost email is copied like any other field, but in order to avoid any conflicts, it disappears from the source profile, changes to empty (that is, localhost).

URL​

Method: POST

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

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
dataJSON object
"data":{
   "_fname": "John",
   "_lname": "Doe"
}
NoProfile data that will change after merging
db_idint1YesDatabase ID
skip_triggersbooltrueNoSkip trigger events
By default – false
sourcearray
"source": [
   {
      "db_id": 1,
      "email": "test1@mail.ru"
   },
   {
      "db_id": 2,
      "email": "test2@mail.ru"
   }
]
YesContains matching data about the profiles to be merged
destinationJSON object
"destination":{
      "db_id": 3,
      "email": "test3@mail.ru"
}
YesContains the matching data of the profile resulting from the merge
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 subscriptionsProfile 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_namestringcustom_IDYes, 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_stringYes, if
"matching": "custom"
Value of custom database field if matching : custom .
subscriptions
booltrueNoCopy and merge subscriptions. Subscriptions to resource categories and data from subscription fields will also be copied.
By default – true
historybooltrueNoCopy history and activity flags
By default – true
static_segments
booltrueNoWhether to make changes to static segments or not (source-profiles will leave the segments, and destination-profile will enter)
By default – true
overwritebooltrueNoWhether to copy the fields of source profiles or not.

If the destination profile has empty fields, in any case, these fields will be filled with the profile fields the priority of which is the highest.
deletebooltrueNoWhether to remove source profiles after merging or not

Copying profile fields​

moving(1).png

Request example​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"matching": "custom",
"field_name": "field_1",
"source": [
{
"db_id": 1,
"field_value": "1",
"data": {
"_fname": "Profile1",
"_lname": "LnameProfile1"
}
},
{
"db_id": 1,
"matching": "email",
"email": "test2@mail.ru",
"data": {
"_fname": "Profile2",
"_lname": "LnameProfile2"
}
}
],
"destination": {
"db_id": 2,
"matching": "email",
"email": "test3@mail.ru",
"data": {
"_fname": "Profile3",
"_lname": "LnameProfile3"
}
},
"subscriptions": true,
"static_segments": true,
"history": false
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<matching>custom</matching>
<field_name>field_1</field_name>
<source>
<db_id>1</db_id>
<field_value>1</field_value>
<data>
<_fname>Profile1</_fname>
<_lname>LnameProfile1</_lname>
</data>
</source>
<source>
<db_id>1</db_id>
<matching>email</matching>
<email>test2@mail.ru</email>
<data>
<_fname>Profile2</_fname>
<_lname>LnameProfile2</_lname>
</data>
</source>
<destination>
<db_id>2</db_id>
<matching>email</matching>
<email>test3@mail.ru</email>
<data>
<_fname>Profile2</_fname>
<_lname>LnameProfile2</_lname>
</data>
</destination>
<subscriptions>true</subscriptions>
<static_segments>true</static_segments>
<history>false</history>
</xml>

Response example​

  • JSON
  • XML
{
"destination_id": {
"db_id": 1,
"profile_id": "6613cb65dc4594c2934db63b"
},
"error": 0,
"error_text": "",
"source_ids": [
{
"db_id": 1,
"profile_id": "6613cb65dc4594c2934db63f"
},
{
"db_id": 1,
"profile_id": "6613cb65dc4594c2934db63b"
}
]
}
<xml>
<destination_id>
<db_id>2</db_id>
<profile_id>60a7855930b8bc8535b2acfb</profile_id>
</destination_id>
<error>0</error>
<error_text></error_text>
<source_ids>
<db_id>1</db_id>
<profile_id>60a7839330b8bc86a5bc5f62</profile_id>
</source_ids>
<source_ids>
<db_id>1</db_id>
<profile_id>60a7845230b8bc8535b2acf7</profile_id>
</source_ids>
</xml>

Response parameters​

ParameterTypeDescription
destination_idJSON objectContains data about the profile resulting from the merge:
db_id - database ID
profile_id - profile ID
source_idsJSON objectContains data about merged profiles as a list:
db_id - database ID
profile_id - profile ID
errorintError code
error_textstringError text
Last updated on Mar 12, 2024
Previous
Database fields functional update
Next
Unsubscribe profile from resource
  • Description
  • URL
  • Request parameters
  • Copying profile fields
  • Request example
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.