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
  • Communication channels
  • Push channel
  • Mobile Push
  • Integrate your app with Altcraft
  • Processing and adding a subscription

Processing and adding a subscription

Once the app received a push token, the app must transfer it to Altcraft MP in order to create a subscription. The API request is used for it.

With this request, you can:

  • Add new subscriptions.
  • Change the status of existing subscriptions.

The profile search mode can be set using the matching field in the request (see specification below). If the profile is not found, a new one will be created.

Moreover, if several databases are specified in the resource, then all of them will be processed separately. A request to such a resource will create and update profiles in several databases at once. An example of such a case can be seen below.
If there are no databases in the resource, then an error will be returned.

URL​

Method: POST

https://<cookiesaver_host>/push_subscribe

Request parameters​

ParameterTypeExampleRequiredDescription
idstring"abcdefghijklmnqrstuvwxyz"NoProfile ID
resource_tokenstring"abcdefghijklmnqrstuvwxyz"YesUnique resource ID.
db_ids[ ] int[ 2,3 ]NoResource database filter.
matchingstring"custom"NoProfile search mode.
If the parameter is not passed or is empty, profile search by ID will be used. If ID is also not passed, search by push subscriptions will be used.

For the push_subscribe method, this parameter can only accept the following values:
  • custom
  • profile_id
subscriptionsJSON array
SubscriptionObject
[{
"provider" : "android-firebase",
"subscription_id" : "%subscriptionid%"
}]
YesPush subscriptions that should be added to profile or should be updated.
"subscription_id" is unique for each device, Firebase provides it.

SubscriptionObject​

ParameterTypeExampleRequiredDescription
providerstring"android-firebase"YesAltcraft MP Provider ID.
The available values:
  • android-firebase
  • ios-firebase
  • ios-apns
  • yandex-Appmetrica-device-id-ios
  • yandex-Appmetrica-device-id-android
  • yandex-Appmetrica-ios-ifa
  • yandex-Appmetrica-google-aid
  • yandex-Appmetrica-android-token
  • yandex-Appmetrica-ios-token
  • android-huawei
  • ios-huawei

>Each token type in AppMetrica has its own provider ID.
subscription_idstring"abcdef-ghijklmn-qrstuvwxyz"YesSubscription push token
unsubscribeboolfalseNoUnsubscribe flag. Dismiss subscription if its value — true.

Response parameters​

ParameterTypeDescription
dataJSON array
DataObject
Information about the created subscriptions.

The array can contain several objects in the following cases:
  • Several SubscriptionObject were passed in the request.
  • ID field was not used in the request, and the Altcraft MP resource uses several databases. In this case, a new profile with subscriptions will be added for each database from the resource.
errorintError code
error_textstringError text

DataObject​

ParameterTypeDescription
subscription_idstring"abcdef-ghijklmn-qrstuvwxyz"Subscription push token
unsubscribeboolfalseFlag whether the subscription was added or canceled
profile_idstring"5fb62e815ae47a4aa04dfadd"ID of the profile (transferred or newly created) for which the subscription was added.
providerstring"android-firebase"Altcraft MP Provider ID.
The available values:
  • android-firebase
  • ios-firebase
  • ios-apns
  • yandex-Appmetrica-device-id-ios
  • yandex-Appmetrica-device-id-android
  • yandex-Appmetrica-ios-ifa
  • yandex-Appmetrica-google-aid
  • yandex-Appmetrica-android-token
  • yandex-Appmetrica-ios-token
  • android-huawei
  • ios-huawei

Each token type in AppMetrica has its own provider ID.
db_idint2Altcraft MP Database ID. The profile is stored in this database.
resource_idint1Altcraft MP resource ID.
subscription_hash_idstring"92807e89"Subscription hash
statusstring"error"Operation status
  • ok
  • error
descriptionstring"Duplicate push subscription"Error description

Examples​

Request with matching by system profile ID​

  • Request
  • Response
{
"id": "59db33d269d426509e9c4bf9",
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}
{
"data": [
{
"subscription_id": "%subscriptionid%",
"unsubscribe": false,
"profile_id": "59db33d269d426509e9c4bf9",
"provider": "android-firebase",
"db_id": 17,
"resource_id": 5,
"subscription_hash_id": "adsfdfdffdf",
"status": "ok",
"description": ""
}
],
"error": 0,
"error_text": "Successful operation"
}

Request with matching by a custom profile field​

  • Request
  • Response
{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 123,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}
{
"data": [
{
"subscription_id": "%subscriptionid%",
"unsubscribe": false,
"profile_id": "59db33d269d426509e9c4bfс",
"provider": "android-firebase",
"db_id": 17,
"resource_id": 5,
"subscription_hash_id": "adsfdfdffdf",
"status": "ok",
"description": ""
}
],
"error": 0,
"error_text": "Successful operation"
}

Request with matching by push subscriptions​

  • Request
  • Response
{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}
{
"data": [
{
"subscription_id": "%subscriptionid%",
"unsubscribe": false,
"profile_id": "59db33d269d426509e9c4bfa",
"provider": "android-firebase",
"db_id": 17,
"resource_id": 5,
"subscription_hash_id": "adsfdfdffdf",
"status": "ok",
"description": ""
}
],
"error": 0,
"error_text": "Successful operation"
}

Request to a resource with several databases​

  • Request
  • Response
{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 12345,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}
{
"error": 200,
"error_text": "Successful operation",
"data": [
{
"db_id": 34,
"description": "",
"profile_id": "6156ed18eb7fec10a206e916",
"provider": "android-firebase",
"resource_id": 22,
"status": "ok",
"subscription_hash_id": "340ca49c",
"subscription_id": "%subscriptionid%",
"unsubscribe": false
},
{
"db_id": 2,
"description": "matching error: unknown field",
"resource_id": 22,
"status": "error"
}
]
}

Request with matching by a custom profile field in a certain database​

  • Request
  • Response
{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"db_ids": [1],
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 123,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}
{
"error": 0,
"error_text": "Successful operation",
"data": [
{
"db_id": 1,
"description": "",
"profile_id": "637f1a284fda7c5c08be62f",
"provider": "android-firebase",
"resource_id": 31,
"status": "ok",
"subscription_hash_id": "f8af057de",
"subscription_id": "%subscriptionid%",
"unsubscribe": false
}
]
}

Request did not update or add any profile subscriptions​

  • Request
  • Response
{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 12345,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}
{
"error": 200,
"error_text": "Successful operation",
"data": [
{
"db_id": 34,
"description": "",
"profile_id": "6156ed18eb7fec10a206e916",
"resource_id": 22,
"status": "ok"
}
]
}
Last updated on Nov 5, 2024
Previous
Providers: push message structure
Next
Event registration
  • URL
  • Request parameters
    • SubscriptionObject
  • Response parameters
    • DataObject
  • Examples
    • Request with matching by system profile ID
    • Request with matching by a custom profile field
    • Request with matching by push subscriptions
    • Request to a resource with several databases
    • Request with matching by a custom profile field in a certain database
    • Request did not update or add any profile subscriptions
© 2015 - 2026 Altcraft, LLC. All rights reserved.