Skip to main content

View Segments

This endpoint retrieves a list of all segments created by users. The response is provided in JSON format.

GET
 https://api.pushengage.com/apiv1/segments

Request Parameters

Parameter NameTypeRequiredDescription
segment_idStringNoThe unique identifier generated when a segment is created.
limitIntegerNoSpecifies the maximum number of segments to display in the results. Minimum value is 1.
offsetIntegerNoThe starting index for displaying segments. Minimum value is 0.
segment_typeStringNoRetrieves all segments, including those based on geos, devices, and browsers, when set to 'all'.

Response Object

Property NameTypeRequiredDescription
segmentsSegment[]YesAn array representing the segments. For more details, refer to the segment object section.
successBooleanYesIndicates if the push response was successful. Possible values are true or false.
countIntegerYesRepresents the total number of segments returned.
messageStringNoProvided in the event of a failure, indicating the reason for the failure.

Segment Object

Property NameTypeDescription
segment_idStringThe unique identifier for the segment.
segment_nameStringThe name associated with the segment.

Example

Request

curl -X GET -H "api_key: <your_pushengage_api_key>" "https://api.pushengage.com/apiv1/segments"

Response

{
"segments": [
{
"segment_id": "234567",
"segment_name": "coupon"
},
{
"segment_id": "123455",
"segment_name": "laptop"
}
],
"success": true,
"count": 2
}