Documentation Index

Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt

Use this file to discover all available pages before exploring further.

Create segment

Prev Next
Post
/create/segment

Used to create a new segment.

For more information on segments review our segmentation guide. For details on the available conditions for this endpoint see our dedicated segment model properties guide.

Body parameters
object
apptoken
string Required

Your App token

title
string Required

Title of the segment

condition
string (json)

Conditions that define the segment

Responses
200

200

Result
{
  "code": "200",
  "success": "True",
  "message": "Segment successfully created",
  "model": {
    "id": "SEGMENT_ID",
    "project_id": "PROJECT_ID",
    "title": "Test",
    "conditions": {
      "0": {
        "0": [
          "tags",
          "=",
          "15_01_04",
          [
            "hits",
            ">",
            "5"
          ],
          [
            "daterange",
            "between",
            "2015-01-01 to 2015-01-30",
            "2015-01-01",
            "2015-01-30"
          ]
        ],
        "1": [
          "app_downloaded",
          null,
          null,
          [
            "days_ago",
            ">",
            null,
            null,
            null,
            "10"
          ]
        ],
        "2": [
          "country",
          "=",
          "IE"
        ],
        "operator": "AND"
      },
      "operator": "AND"
    }
  }
}
Expand All
object
code
integer
Default0
Example200
success
boolean
Defaulttrue
ExampleTrue
message
string
ExampleSegment successfully created
model
object
id
string
ExampleSEGMENT_ID
project_id
string
ExamplePROJECT_ID
title
string
ExampleTest
conditions
object
400

400

Result
{
  "code": "400",
  "success": "False"
}
object
code
integer
Default0
Example400
success
boolean
Defaulttrue
ExampleFalse