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
  • Import profile
Documentation for version v72

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 campaign 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.
ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
db_idint1YesDatabase ID
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 emailProfile 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_triggersbooltrueNoSkip trigger events.
By default – false
skip_invalid_subscriptionsbooltrueNoSkip invalid subscriptions
By default – false
detect_geobooltrueNoDetect location by _regip or _ip from data object
add_to_segmentsarray
[1, 2]
NoAdd a profile to a segment
remove_from_segmentsarray
[1, 2]
NoRemove a profile from a segment
dataJSON object
{
"_fname": "John",
"_lname": "Doe"
}
YesProfile 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.

ParameterTypeExampleDescription
resource_idint1Resource ID
statusstring"subscribed"

Subscription status

It is recommended to pass the parameter in the request only in cases where it is necessary to update the subscription status.

priorityint1Subscription priority

If the subscription priority is passed in the request, the "Increase priority for new subscriptions" option in the resource does not work.
custom_fieldsobject
{
   "_browser_name": "Chrome",
   "_device_type": "web"
}
System and custom subscription fields.

You can get information about available subscription fields in a resource using the /v1.1/resources/fields_get method
catsarray
[
   "category_1",
   "category_2"
]
Resource categories to which to subscribe the profile.
Email channel
channelstring"email"Channel type
emailstring"john@example.com"Email
SMS channel
channelstring"sms"Channel type
phonestring"+79000000000"Phone number
Push channel
channelstring"push"Channel type
providerstring"Firefox"Provider type
subscription_idstring"abcdefghijklmnqrstuvwxyz"Subscription ID
Telegram Bot channel
channelstring"telegram_bot"Channel type
cc_dataobject
{
   "id": 1
}
Telegram Bot chat ID
WhatsApp* channel
channelstring"whatsapp"Channel type
cc_dataobject
{
   "phone": "+79000000000"
}
Profile phone number on WhatsApp*
Viber channel
channelstring"viber"Channel type
cc_dataobject
{
   "phone": "+79000000000"
}
Profile phone number on Viber

Request example​

Importing a profile and adding an email channel subscription​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"matching": "email",
"email": "example@example.com",
"detect_geo": true,
"data": {
"_fname": "Olly",
"_lname": "Lambert",
"email": "example@example.com",
"phones": ["+79000000000"],
"subscriptions": [
{
"resource_id": 1,
"channel": "email",
"email": "example@example.com"
}
]
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<email>example@example.com</email>
<matching>email</matching>
<detect_geo>true</detect_geo>
<data>
<_fname>Olly</_fname>
<_lname>Lambert</_lname>
<email>example@example.com</email>
<phones>+79511059000</phones>
<subscriptions array='true'>
<resource_id>1</resource_id>
<channel>email</channel>
<email>example@example.com</email>
</subscriptions>
</data>
</xml>

Importing a profile with extended data​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"matching": "email",
"email": "example@example.com",
"detect_geo": true,
"data": {
"_fname": "Olly",
"_lname": "Lambert",

"email": "example@example.com",
"phones": ["+79000000000"],

"_bdate": "1990-02-22T21:00:00Z",
"_sex": 0,

"_regdate": "2019-03-14T22:00:00Z",
"_regip": "94.231.119.122",
"_ip": "94.231.119.122",

"_tz": "Europe/Moscow",
"_postal_code": "390000",

"_os": "Windows 10",
"_browser": "Firefox",

"_vendor": "form_#31",

"custom_field": "custom_value",

"subscriptions": [
{
"resource_id": 1,
"channel": "email",
"email": "example@example.com"
}
]
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<detect_geo>true</detect_geo>
<email>example@example.com</email>
<matching>email</matching>
<data>
<_fname>Olly</_fname>
<_lname>Lambert</_lname>
<email>example@example.com</email>
<phones>+79511059000</phones>
<_bdate>1990-07-06</_bdate>
<_sex>0</_sex>
<_regdate>2023-07-06</_regdate>
<_regip>192.168.0.179</_regip>
<_ip>192.168.0.179</_ip>
<_tz>Europe/Moscow</_tz>
<_postal_code>390000</_postal_code>
<_os>Windows 10</_os>
<_browser>Firefox</_browser>
<_vendor>form_#31</_vendor>
<custom_field>custom_value</custom_field>
<subscriptions array='true'>
<resource_id>1</resource_id>
<channel>email</channel>
<email>example@example.com</email>
</subscriptions>
</data>
</xml>

Importing a profile and adding subscriptions to multiple channels​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"matching": "email",
"email": "example@example.com",
"detect_geo": true,
"data": {
"_fname": "Olly",
"_lname": "Lambert",
"email": "example@example.com",
"subscriptions": [
{
"resource_id": 1,
"channel": "email",
"email": "example@example.com"
},
{
"resource_id": 2,
"channel": "sms",
"phone": "+79000000000"
},
{
"resource_id": 1,
"channel": "push",
"subscription_id": "a81c264a938b475",
"provider": "android-firebase",
"custom_fields": {
"_browser_name": "Firefox",
"_device_type": "web",
"custom_field_1": "test value"
},
"cats": [
"category_1",
"category_2"
]
},
{
"resource_id": 1,
"channel": "whatsapp",
"cc_data": {
"phone": "+79000000000"
}
},
{
"resource_id": 1,
"channel": "viber",
"cc_data": {
"phone": "+79000000000"
}
},
{
"resource_id": 1,
"channel": "telegram_bot",
"cc_data": {
"id": 12345
}
},
{
"resource_id": 1,
"channel": "notify",
"cc_data": {
"phone": "+79000000000"
}
}
]
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<detect_geo>true</detect_geo>
<email>example@example.com</email>
<matching>email</matching>
<data>
<_fname>Olly</_fname>
<_lname>Lambert</_lname>
<email>example@example.com</email>
<subscriptions>
<resource_id>1</resource_id>
<channel>email</channel>
<email>example@example.com</email>
</subscriptions>
<subscriptions>
<resource_id>1</resource_id>
<channel>sms</channel>
<phone>+79000000000</phone>
</subscriptions>
<subscriptions>
<resource_id>1</resource_id>
<channel>push</channel>
<subscription_id>a81c264a938b475</subscription_id>
<provider>android-firebase</provider>
</subscriptions>
<subscriptions>
<resource_id>1</resource_id>
<channel>whatsapp</channel>
<cc_data>
<phone>+79000000000</phone>
</cc_data>
</subscriptions>
<subscriptions>
<resource_id>1</resource_id>
<channel>viber</channel>
<cc_data>
<phone>+79000000000</phone>
</cc_data>
</subscriptions>
<subscriptions>
<resource_id>1</resource_id>
<channel>telegram_bot</channel>
<cc_data>
<id>12345</id>
</cc_data>
</subscriptions>
<subscriptions>
<resource_id>1</resource_id>
<channel>notify</channel>
<cc_data>
<phone>+79000000000</phone>
</cc_data>
</subscriptions>
</data>
</xml>

Response example​

  • JSON
  • XML
{
"error": 0,
"error_text": "Successful operation",
"profile_id": "54759eb3c090d83494e2d804"
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<profile_id>c1are24fu213lwith21that2axe9<profile_id>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
profile_idstringProfile ID

*The Meta organization, which owns Instagram, Facebook and WhatsApp products, has been declared as extremist and banned in Russia.

Last updated on Aug 20, 2024
Previous
Profiles
Next
Update profile
  • Description
  • Request URL
  • Request parameters
    • Subscriptions array
  • Request example
    • Importing a profile and adding an email channel subscription
    • Importing a profile with extended data
    • Importing a profile and adding subscriptions to multiple channels
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.