Skip to main content

Get segments list

Description

Retrieves all segments list.

Request URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format.
By default – json
from_idint1NoThe first ID in the list
By default – 1
limitint1NoSegments list limit.
By default – 1000
ui_tags[]String[ "tag1", "tag2" ]NoList of tags for search
groups[]String[ "group1", "group2" ]NoList of access groups
groups_id[]int[ 0, 1 ]NoList of access groups IDs

Request example

{
"limit": 2,
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

{
"data": [
{
"id": 1,
"name": "Segment A",
"ui_tags": [
"tag1",
"tag2"
],
"Groups": [
{
"Id": 1,
"Name": "subaccount"
}
]
},
{
"id": 2,
"name": "Segment B",
"ui_tags": [

],
"Groups": [
{
"Id": 0,
"Name": "main"
}
]
}
],
"error": 0,
"error_text": "Successful operation",
"next_from_id": 2
"total_count": 2
}



## Response parameters \{#Getsegmentslist-Responseparameters}


|Parameter|Type|Description|
|---|---|---|
|error|int|Error code|
|error\_text|string|Error text|
|next_from_id|int|The index must be passed in the next request to receive another piece of data, until the result output contains 0 history lines|
|total\_count|int|Total segments count|
|id|int|Segment ID|
|name|string|Segment name|
|ui\_tags|\[\]String|List of tags|
|groups|\[\]String|List of groups|