Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters.
include-segment-detail parameter to also retrieve segment metadata and filters.
segment_id can be found using the View segments API or in the URL of the segment when viewing it in the dashboard.include-segment-detail=true:
payload object containing segment details:
filters array uses the same format as the Create segment API. This means you can:
| Field | Type | Description |
|---|---|---|
field | string | The filter type: tag, last_session, first_session, session_count, session_time, language, app_version, location, country, email, rooted |
relation | string | The comparison operator: >, <, =, !=, exists, not_exists, time_elapsed_gt, time_elapsed_lt |
value | string | The filter value (for most filter types) |
key | string | The filter key (required for tag filters) |
hours_ago | string | Hours ago value (for last_session/first_session filters) |
radius, lat, long | string | Location parameters (for location filters) |
unsupported_in_api | boolean | If true, this filter cannot be used with Create/Update segment APIs (see note below) |
| Field | Type | Description |
|---|---|---|
operator | string | Either AND or OR. Filters connected with AND have higher priority than OR. |
| Field | Type | Description |
|---|---|---|
id | string | The unique identifier for the segment (UUID v4). |
name | string | The segment name (max 128 characters). |
created_at | integer | Unix timestamp when the segment was created. |
source | string | The source of the segment: default, custom, or quickstart. |
filters | array | Array of filter and operator objects that define the segment criteria. |
Your App API key with prefix Key. See Keys & IDs.
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
The segment's unique identifier. Can be found using the View segments API or in the dashboard URL.
Set to true to include segment metadata and filters in the response.