Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    User documentationGetting StartedFAQAltcraft glossary
      Profiles and databasesarrow
    • Subscription resourcesManaging databasesSubscriber profileProfiles import and data updateScheduled customer data importAutomatic data collectionBulk customers profiles updateDouble opt-in subscriptionSuppression listsProfile relationsProfile history exportProfile exportCreating a static segment based on import resultsHow to open a CSV fileMatchingTypes of fields in the databaseGlobal control groupsSubscription Manager
      Communication channelsarrow
      • Email channelarrow
      • Email: ISP interactions best practicesEmail: sending domain configurationEmail: setting up and using postmastersБыстрый старт
        Push channelarrow
        • Mobile Pusharrow
        • Settings & implementation
            Integrate your app with Altcraftarrow
          • Providers: push message structureProcessing and adding a subscriptionEvent registration
          Web pusharrow
        • Preliminary Settings
            Web browser push configurationarrow
          • Firebase Cloud messagingApple SafariMozilla Services
          Connecting Web Push to a WebsiteTransferring Data to the PlatformWeb Push SDK Methods
            Import of subscriptions from third-party push servicesarrow
          • Migrating push subscriptions from third-party servicesHow to transfer push subscriptions configured for Safari?Migration from OneSignal
      SMS channel
        Creating mailing from scratcharrow
      • EmailSMSWeb PushMobile PushWhatsAppViber*™Руководство: SMS-рассылка через VK NotifyMAX BotMAX GroupNotifyTelegram BotTelegram Group
      Communication Channels WorkflowРуководство: SMS-рассылка через УТШРуководство: push-рассылка через сервис от "Согласие"
      Segmentationarrow
    • Static SegmentsDynamic SegmentsUpdatable Segments
        Segmentation Conditionsarrow
      • Segmentation by Profile dataSegmentation by Interactions with EntitiesSegmentation by Activity of the channelSegmentation by external dataSegmentation by external SQL tablesSegmentation by Profile structure
      Best Send Time (BST)Logical operators "AND" and "OR"Recommendations for working with segments
      Message templatesarrow
      • Working with message templatesarrow
      • Working in the editorEmail-templateSMS templatePush templateMAX templateTelegram templateWhatsApp templateViber™ templateNotify template
        Visual editor for email-templatearrow
      • Visual editor interfaceAdding blocksElements and their settingsCustom blocksStyle managerLayer manager
      Template fragmentsImage galleryContent personalizationCreating tables based on array elementsBlock editor for email template
        Altcraft Variables and Functionsarrow
      • Logical expressions in messagesLoops in messagesMarket variables in templatesUsing the JSONPath functionality
        Dynamic content in messagesarrow
      • Dynamic HTML contentDynamic JSON contentContent from SQL database in templatesDynamic API content
      Importing and exporting a message templateImporting a template from a third-party serviceExporting a template from Pixcraft
      Mailingsarrow
    • Mailings calendarBroadcast mailingsRegular mailingTrigger mailingMultivariate testingMailing testingMailing schedulePlacement mailing
      Campaignsarrow
    • Working with CampaignsLocal control groups (LCG)Stratification Violation ErrorAudience expansionAudience building
      Automation scenariosarrow
    • Managing scenariosNodes of the scenarioClassic marketing scenariosStep-by-step welcome scenario guideScenario for automatic notification of the managerAbandoned cart scenario
      Marketarrow
    • Market settings
        Productsarrow
      • How to create a product manuallyHow to import a product from a fileScheduled product importProduct and SKU SegmentsPreparing the YML file
      OrdersMarket variables in message templateGuide: how to send an order confirmation email
      Loyalty programsarrow
    • Loyalty programsLoyalty integration with external systemsБыстрый стартBasic loyalty program use casesOrder SegmentsPromotion codes
      Reports and analyticsarrow
    • Channel reportTraffic report
        Summary reportarrow
      • Summary report metrics
      Cohorts reportLifetime reportFunnels reportGoals reportAudience growth reportClick map reportLoyalty programs reportBounces reportUndeliveries reportReport on global control groups
      Integrationsarrow
      • Action hooksarrow
      • Altcraft Action HooksAction hooks event typesAction Hook Message StructureJSON batch request (HTTP POST action hook)Message to RabbitMQ brokerMessage to RabbitMQ exchangerMessage to Kafka brokerTest event
        Integration of third-party services using Albatoarrow
      • Connecting Altcraft to Albato Launching the welcome scenario using AlbatoTransmitting event dataSetting app a trigger mailingEvent registrationGoogle Sheets and Altcraft integration AmoCRM and Altcraft integration
      Facebook Ads Manager™Google Ads AudiencesMAXYandex.Audience™VK Ads™Static segment synchronizationYandex AppMetrica™Tilda™Lpgenerator™WhatsAppViber*™ integrationIntegration scopeData Transmitted During SynchronizationNotify
      Weblayersarrow
      • Formsarrow
      • Create a formForm constructorAppearanceActions after form activationData analyticsBinding data channel and formsConditional logic in forms and surveysNPS testing
        Pixelsarrow
      • Goal customer actions and scoring
        Pop-upsarrow
      • Creating and publishing a pop-upSetting up a popup in the code editorManaging pop-ups manually via scriptPopup analyticsGuide: pop-up for push subscriptionsCase: Creating a pop-up with the "Wheel of Fortune" widgetBasic cases of placing a popup via the Tag Manager
        Tag Managerarrow
      • Configuring and installing Tag ManagerTrigger typesVariables typesLinking a pixel and the Tag manager
      Settingsarrow
    • Account settingsCustom linksVirtual sendersSending policiesAudit journalTags FAQ
        Users, groups and accessarrow
      • Two-Factor Authentication (2FA)
        Connectionsarrow
      • Connection to Facebook Ads ManagerConnection to Google AdsConnecting to Yandex.Audience™Connection to 360dialogConnection to EdnaConnection to Devino TelecomConnection to SMSTrafficConnection to VK Ads™Connection to MTS OmniChannelCustom Authentication ConnectionOAuth2 connectionBasic Authentication connectionToken Authentication connectionConnection to RapportoMAX connectionConnection to Notify
      Attribute settings
      API requests: where to startarrow
    • Import or update a profileTrigger mailing launchEngage profile in scenario
      Changelogarrow
    • v2026.1.76v2025.4.75v2025.4.74v2025.3.73v2025.2.72v2025.1.71v2024.4.70v2024.3.69v2024.2.68.2v2024.1.68
    Documentation archivelibrary
  • API requests: where to start
  • Import or update a profile

Import or update a profile

This article will show you how to write and submit API requests to perform the following tasks:

  • Adding a profile to the database
  • Updating profile data
  • Subscribing a profile to different channels

Getting an API token​

API token is a key to access the platform via API. It is used in any API request.

You can find the token in Altcraft platform settings, in the "Tokens" section. If you don't have a token yet, create one by clicking on the corresponding button:

caution

Only master users can create an API token. If you do not have rights to create a token, contact a user with master rights.

Installing and running Postman​

To work with API requests, you need an application that allows you to send and receive them.

1. Download and install the Postman application or open its web version.

2. Select the POST method for your request.

3. Click the Body tab and select raw mode. Make sure the JSON format is selected.

Request URL​

To send a request to the server you need to enter its URL. It is individual for each request. For example, for a profile import request, the URL would be:

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

Instead of example.com you need to specify the address where the platform is located. You can get it directly from the address bar:

Creating a request​

Adding a new profile​

Let's move on to writing the query. Suppose we want to manually add a customer profile with e-mail i.petrov@example.com to database #5. Let's make a query:

{
"token": "abcdefghklmnopqrstzxc",
"db_id": 5,
"matching": "email",
"email": "i.petrov@example.com",
"data": {
"email": "i.petrov@example.com"
}
}
  • "token " - API token. You can read more about where to find it at the beginning of the article.
  • "db_id " - number of the database to which the profile is added. This number is indicated next to the name of the profile database to the right of the # sign.
  • "data " - the object that contains the profile data. In the example above, we only pass the client's email address in this object.
  • "matching " and "email " - parameters by which the query will determine whether this profile exists in the database. In this case, the email address is used to search for the profile. If the profile with this address already exists in the database, the query will update its data, if not - it will create a new profile. The "matching" parameter can take different values. However, it is not mandatory and if it is not specified, the profile will be searched by email.
More details about the matching parameter

The matching parameter defines by which field the profile will be searched in the database. Several search modes are available in the platform, for example, the platform can search for a profile by email address, phone number, system ID or by any value you store in an additional field in the database.

The main thing is that the field by which you launch a search in the database is unique for the profile, i.e. the value of this field should not be the same for different profiles in the same database.

If you want to find a profile by its email, then matching will look like this:

{
"matching": "email",
"email": "example@example.com"
}

Search for a profile by phone::

{
"matching": "phone",
"phone": "+79000000000"
}

Search for a profile by ID (only when updating a profile):

{
"matching": "profile_id",
"profile_id": "012452gf62fcd71fjh8ec0"
}

The profile ID can be found here:

If you use a custom field to search for a profile, then your query will look like this:

{
"matching": "custom",
"field_name": "CRM_ID",
"field_value": "12345"
}

where CRM_ID is the name of the field, and 12345 is the value of this field for the profile.

Updating profile data​

Let's assume that we have new data about the client: his name is Ivan Petrov, born 15.01.1990, lives in Moscow, phone number - +79000000000. Now we need to update the profile and add this information. The query will look like this:

{
"token": "abcdefghklmnopqrstzxc",
"db_id": 5,
"matching": "email",
"email": "i.petrov@example.com",
"data": {
"email": "i.petrov@example.com",
"_fname": "Ivan",
"_lname": "Petrov",
"_sex": "male",
"_bdate": "1990-01-15T12:00:00Z",
"_city": "Moscow",
"phones": ["+79000000000"]
}
}

We have extended the "data" parameter with the following data:

  • "_fname" - first name
  • "_lname" - last name
  • "_bdate" — date of birth in the format "1990-01-15T12:00:00Z"
  • "_sex" - gender, "male" for men, "female" for women
  • "_city" - city
  • "phones" — phone number.

Adding subscriptions to a profile​

We have updated the profile and now we need to subscribe it to email, sms and push channels in resource #1. To do this we need to add the subsriptions array to data:

{
"token": "abcdefghklmnopqrstzxc",
"db_id": 5,
"matching": "email",
"email": "i.petrov@example.com",
"data": {
"email": "i.petrov@example.com",
"_fname": "Ivan",
"_lname": "Petrov",
"_sex": "male",
"_bdate": "1990-01-15T12:00:00Z",
"_city": "Moscow",
"phones": ["+79000000000"],
"subscriptions": [
{
"channel": "email",
"email": "i.petrov@example.com",
"resource_id": 1
},
{
"channel": "sms",
"phone": "+79000000000",
"resource_id": 1
},
{
"channel": "push",
"provider": "Firefox",
"resource_id": 1,
"subscription_id":"abcdefghijklmnqrstuvwxyz"
}
]
}
}

For each communication channel, the following parameters must be specified:

  • "channel" — type of channel, for example, "email", "sms", "push"
  • "resource_id" is the resource ID that you must configure before. Also, depending on the channel you are subscribing to, you will need to provide certain contact information. For example, for an email channel it is an email address, for an sms channel it is a phone number, and for a push channel you need to specify the provider (provider) and the push token (subscription_id).
tip

Pay attention to the syntax of your request. Any extra character, be it a parenthesis, comma or period, can lead to errors when sending a request. Likewise, the query will not work if you do not close any quotes or parentheses.

Sending a request​

To send a request, click Send in Postman. If the request is successful, the following message will appear:

If something went wrong, the error code and its description will be indicated in the reply message:

If you are unable to resolve the error yourself, please forward the error code and description to Altcraft Support team.

tip

This article describes only some of the possible parameters for this request. The remaining parameters can be found here.

Last updated on Oct 16, 2024
Previous
API requests: where to start
Next
Trigger mailing launch
  • Getting an API token
  • Installing and running Postman
  • Request URL
  • Creating a request
    • Adding a new profile
    • Updating profile data
    • Adding subscriptions to a profile
  • Sending a request
© 2015 - 2026 Altcraft, LLC. All rights reserved.