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 API documentationAPI interactionMatching
      Profilesarrow
    • Import profileUpdate profileImport multiple profilesUpdate multiple profilesAdd multiple profilesAdd profile to databaseQuick profile importImport profile to RabbitMQGet profile dataUploading profiles to a fileSuspend all database profilesUnsuspend all profiles in a databaseDelete profileSubscription fields functional updateDatabase fields functional updateMerging multiple profilesUnsubscribe profile from resourceProfile splitting
        Subscriptionsarrow
      • Add or edit subscriptionGet all profile subscriptionsGet all subscriptions from multiple profilesGet profile subscriptionDelete profile subscriptionRestore deleted subscriptionSuspend all subscriptionsUnsuspend all suspended subscriptions
        Action historyarrow
      • Get profile action historyGet multiple profiles action history
        Profile relationsarrow
      • Attach relationDetach relationModify relation propertiesOverwrite relation propertiesGet profile relations infoGet profile relations info
      Get data for multiple profiles
      Databasesarrow
    • Get database statisticsUpdate statistics on databaseGet database listGet database informationGet database fieldsDatabase wipe
      Resourcesarrow
    • Get resource statisticsUpdate statistics on resourceGet resources listGet resource informationGet resource subscription fields
      Segmentsarrow
    • Get statistics on resourceUpdate statistics on segmentAdd or remove profileGet profile data in a static segmentCreate segmentUpdate segmentGet segment informationGet segments listDelete segment
      Suppression listsarrow
    • Create suppression listUpdate suppression listGet suppression list infoGet the list of suppression listsDelete suppression listUpload suppression list data to file
        Suppression list actionsarrow
      • Check if email is suppressedAdd email to suppression listAdd multiple emails to suppression listRemove email from suppression listRemove all emails from suppression listCheck if domain is suppressedAdd domain to suppression listAdd multiple domains to suppression listRemove domain from suppression listRemove all domains from suppression listCheck if phone number is suppressedAdd phone number to suppression listAdd multiple phones to suppression listRemove phone number from suppression listRemove all phone numbers from suppression list
      Templates and fragmentsarrow
    • Get templates listGet template infoDelete templateAdd templateUpdate templateChannel object
      Campaignsarrow
    • Get campaign informationGet campaign listActivate campaignComplete campaignDeactivate campaignGet campaign status
      Mailingsarrow
    • Activate mailingDeactivate mailingGet mailing listGet mailing informationGet mailing logClone mailingDelete mailingGet mailing status
        Broadcast mailingsarrow
      • Get broadcasts listGet broadcast informationCreate broadcast mailingUpdate broadcast mailingLaunch a broadcast mailing
        Regular mailingsarrow
      • Get regular mailings listGet regular mailing informationCreate regular mailingUpdate regular mailingLaunch a regular mailing
        Trigger mailingsarrow
      • Get trigger mailings listGet trigger mailing informationCreate trigger mailingUpdate trigger mailingTrigger launch (API call)Profile import + trigger mailing launchTask for bulk trigger launchTask for bulk profiles import + trigger launchBulk trigger launchBulk profiles import + trigger mailing launchClone a trigger mailingData array
      Automation scenariosarrow
    • Engage profile in scenarioImport and engage profile in scenarioBatch import and engage profiles in a scenarioTask for batch import and engaging profiles in the scenarioGet scenarios listActivate scenarioDeactivate scenario
      Loyalty Programsarrow
    • Get profile tier in a loyalty programExport points transactionsExpiring points for a periodGet profile account transactionsGet trigger promotions listAccrue points to a memberRedeem member pointsCommit temporary transactionPreliminary Order CalculationOrder ConfirmationRoll back temporary transactionCancel points transactionGet points account balanceRegister member in a loyalty programRemove member from loyalty program
      Promo codesarrow
    • Import promo codesGet promo code informationActivate promo codeUpdate promo codeAttach promo codeDetach promo codeGet all promo codes
      Goalsarrow
    • Goals and goal values registration
      Application push notificationsarrow
    • Processing and adding a subscriptionAdd app push events
      Marketarrow
      • Market objectsarrow
      • Order data objectProduct data objectSKU data objectCategories arrayCustom fields array
        Ordersarrow
      • Import order and item statusesGet orders listDelete orderGet order statusUpdate order line status
        Products and SKUarrow
      • Import products, SKUs and categoriesImport SKUs and categoriesGet products listGet SKUs listDelete productsDelete SKU
      Analytic reportsarrow
    • Get summary reportGet soft bounces reportGet undeliveries report
      SendersDevarrow
    • Get senders list
        Virtual senders (Smart accounts only)arrow
      • Get virtual senders listGet virtual sender informationClone virtual senderCreate virtual senderUpdate virtual senderDelete virtual sender
      External datatables queriesarrow
      • Segmentation queriesarrow
      • Add segmentation queryUpdate segmentation queryGet segmentation query informationGet segmentation queries listDelete segmentation query
        Template queriesarrow
      • Add template queryUpdate template queryGet template query informationGet template queries listDelete template query
      Objectsarrow
    • AKMTA objectContent objectEmail rule objectFile objectProfile data objectSMS rule objectSender objectSender typesStart schedule objectSubscription objectTrigger types
      Miscellaneousarrow
    • Upload fileGet message web versionPush providersDeduplication of requestsHow to send API request with RabbitMQList of gender identificationsObtain valid values for fields: browsers, devices, tz, oses, languages
    Importing the API collection in PostmanList of API endpoints
      SDKarrow
      • mSDKarrow
        • Androidarrow
        • Quick StartSDK FunctionalitySDK ConfigurationPublic SDK API
            Provider configuration androidarrow
          • Firebase Cloud MessagingHuawei Mobile ServicesRuStore
          iOSarrow
        • Quick StartSDK FunctionalitySDK ConfigurationPublic SDK API
            Provider configurationarrow
          • Apple Push Notification ServiceFirebase Cloud MessagingHuawei Mobile Services
          React Native (Android/iOS)arrow
        • Quick StartSDK ConfigurationSDK FunctionalityPublic SDK APIProvider setup
        Managing JWT and Role Token
  • Application push notifications
  • Processing and adding a subscription

Processing and adding a subscription

The API request is used to transfer the push token from the mobile application to the Altcraft Platform for creating a subscription.

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.

Request 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​

ParameterTypeExampleDescription
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 Aug 5, 2025
Previous
Application push notifications
Next
Add app push events
  • Request 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.