Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v75
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
  • Resources
  • Segments
    • Get statistics on resource
    • Update statistics on segment
    • Add or remove profile
    • Get profile data in a static segment
    • Create segment
    • Update segment
    • Get segment information
    • Get segments list
    • Delete segment
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Mailings
  • Automation scenarios
  • Loyalty Programs
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDev
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
  • Segments
  • Update segment
Documentation for version v75

Update segment

Description​

Updates segment building rules.

Request URL​

Method: POST

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

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"YesResponse data format.
By default – json
list_idint5Required for static segmentsDatabase ID
idint1YesSegment ID
namestring"New segment"YesSegment name
segmentJSON array
YesQueries to update

Request example​

tip

When updating segmentation conditions, the specified profile database cannot be changed

For static segments​

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

For dynamic segments​

When updating a dynamic segment, the presence of segmentation rules in the segment field is required.

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 14,
"list_id": 6,
"name": "Static segment 2",
"is_static": false,
"segment": [
{
"condition": "and",
"limit": 0,
"percent_from": 1,
"list_id": 6,
"percent_to": 99,
"queries": [
{
"compo": "domaingroup",
"name": "email",
"operator": "equal",
"type": "email",
"value": [
{
"name": "domaingroup",
"value": "Yahoo! (US)"
}
]
}
]
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>14</id>
<name>New segment 2</name>
<is_static>false</is_static>
<segment array="">
<list_id>6</list_id>
<condition>and</condition>
<limit>0</limit>
<percent_from>0</percent_from>
<percent_to>99</percent_to>
<queries array="">
<compo>domaingroup</compo>
<name>email</name>
<operator>equal</operator>
<type>email</type>
<value array="">
<name>domaingroup</name>
<value>Yahoo! (US)</value>
</value>
</queries>
</segment>
</xml>

For updatable segments​

  • JSON
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 28,
"list_id": 6,
"name": "Static segment 2",
"is_static": true,
"is_refresh_daily": true,
"segment": [
{
"condition": "and",
"limit": 0,
"percent_from": 1,
"list_id": 6,
"percent_to": 99,
"queries": [
{
"compo": "domaingroup",
"name": "email",
"operator": "equal",
"type": "email",
"value": [
{
"name": "domaingroup",
"value": "Yahoo! (US)"
}
]
}
]
}
]
}

</TabItem>

<TabItem value="XML" label="XML">

```xml
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>28</id>
<name>New segment 2</name>
<is_static>true</is_static>
<is_refresh_daily>true</is_refresh_daily>
<segment array="">
<list_id>6</list_id>
<condition>and</condition>
<limit>0</limit>
<percent_from>0</percent_from>
<percent_to>99</percent_to>
<queries array="">
<compo>domaingroup</compo>
<name>email</name>
<operator>equal</operator>
<type>email</type>
<value array="">
<name>domaingroup</name>
<value>Yahoo! (US)</value>
</value>
</queries>
</segment>
</xml>

Response example​

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

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idintSegment ID
Last updated on Jan 31, 2025
Previous
Create segment
Next
Get segment information
  • Description
  • Request URL
  • Request parameters
  • Request example
    • For static segments
    • For dynamic segments
    • For updatable segments
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.