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
    • Create segmentGet statistics on resourceUpdate statistics on segmentAdd or remove profileGet profile data in a static 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 programBatch adding participants to loyalty programTask for batch add participants to loyalty programRemove member from loyalty program
      Formsarrow
    • Get form informationGet form listGet form fillsPublish formUnpublish formDelete form
      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
      Sendersarrow
    • 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
  • Segments
  • Create segment

Create segment

Description​

Create a new segment.

Request URL​

Method: POST

https://example.com/api/v1.1/segments/add/

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format
(by default – "json")
namestring"New segment"YesSegment name
list_idint5Yes, for static segmentsDatabase ID from which profiles will be taken. For dynamic and updatable segments, specify inside the segment array
segmentJSON array
Yes, for dynamic and updatable segmentsSegmentation conditions. The array must contain at least one object. Not used for static segments.
is_refresh_dailybooltrueNoFlag to activate segment schedule. By default false. Used only for updatable segments.

Segment type is determined by a combination of parameters:

  • is_static is false — the segment is dynamic
  • is_static is true and no conditions — the segment is static
  • is_static is true and conditions present — the segment is updatable. Schedule activity is determined by the is_refresh_daily parameter

Parameters of the segment array​

ParameterTypeExampleRequiredDescription
conditionstring"and"YesLogical condition for combining queries. Possible values: and, or
limitint0NoLimit the number of profiles in the segment (0 - no limit)
list_idint2YesDatabase ID
percent_fromint0NoStart of the sample percentage range (0-99)
percent_toint99NoEnd of the sample percentage range (1-100)
queriesJSON array-YesArray of filter conditions

Parameters of the queries object​

An object that is part of the queries array.

ParameterTypeExampleRequiredDescription
compostring"default"YesSource of the value for comparison
namestring"_sex", "_region"YesField name for filtering
operatorstring"equal"YesComparison operator. Available values depend on the field type.
typestring"enum"YesField type
valuearray[
  {
    "name": "default",
    "value": 2
  }
]
YesValue for filtering. Format depends on the field type.

Request example​

For static segments​

  • JSON
  • XML
{
"name": "Static segment",
"is_static": true,
"list_id": 5,
"is_refresh_daily": false,
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<list_id>5</list_id>
<name>Static segment</name>
<is_static>true</is_static>
<is_refresh_daily>false</is_refresh_daily>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>

For dynamic segments​

  • JSON
  • XML
{
"name": "Dynamic segment",
"is_static": false,
"segment": [
{
"condition": "or",
"limit": 0,
"list_id": 2,
"percent_from": 0,
"percent_to": 99,
"queries": [
{
"compo": "default",
"name": "_sex",
"operator": "equal",
"type": "enum",
"value": [
{
"name": "default",
"value": 1
}
]
},
{
"compo": "default",
"name": "_sex",
"operator": "equal",
"type": "enum",
"value": [
{
"name": "default",
"value": 2
}
]
}
]
}
],
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<name>Dynamic segment</name>
<is_static>false</is_static>
<segment>
<condition>or</condition>
<limit>0</limit>
<list_id>2</list_id>
<percent_from>0</percent_from>
<percent_to>99</percent_to>
<queries>
<compo>default</compo>
<name>_sex</name>
<operator>equal</operator>
<type>enum</type>
<value>
<name>default</name>
<value>1</value>
</value>
</queries>
<queries>
<compo>default</compo>
<name>_sex</name>
<operator>equal</operator>
<type>enum</type>
<value>
<name>default</name>
<value>2</value>
</value>
</queries>
</segment>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>

For updatable segments​

  • JSON
  • XML
{
"name": "Updatable segment",
"is_static": true,
"is_refresh_daily": true,
"segment": [
{
"condition": "or",
"limit": 0,
"list_id": 2,
"percent_from": 0,
"percent_to": 99,
"queries": [
{
"compo": "default",
"name": "_sex",
"operator": "equal",
"type": "enum",
"value": [
{
"name": "default",
"value": 1
}
]
},
{
"compo": "default",
"name": "_sex",
"operator": "equal",
"type": "enum",
"value": [
{
"name": "default",
"value": 2
}
]
}
]
}
],
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<name>Updatable segment</name>
<is_static>true</is_static>
<is_refresh_daily>true</is_refresh_daily>
<segment>
<condition>or</condition>
<limit>0</limit>
<list_id>2</list_id>
<percent_from>0</percent_from>
<percent_to>99</percent_to>
<queries>
<compo>default</compo>
<name>_sex</name>
<operator>equal</operator>
<type>enum</type>
<value>
<name>default</name>
<value>1</value>
</value>
</queries>
<queries>
<compo>default</compo>
<name>_sex</name>
<operator>equal</operator>
<type>enum</type>
<value>
<name>default</name>
<value>2</value>
</value>
</queries>
</segment>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>

Response example​

  • JSON
  • XML
{
"data": {
"saved_id": 1
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<saved_id>1</saved_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError message
saved_idintNew segment ID
Last updated on May 22, 2026
Previous
Segments
Next
Get statistics on resource
  • Description
  • Request URL
  • Request parameters
    • Parameters of the segment array
    • Parameters of the queries object
  • Request example
    • For static segments
    • For dynamic segments
    • For updatable segments
  • Response example
  • Response parameters
© 2015 - 2026 Altcraft, LLC. All rights reserved.