View segment
View segment
Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters.
GET
View segment
Overview
Retrieve details for a single segment by its ID. By default, this endpoint returns only the subscriber count. Use the optionalinclude-segment-detail parameter to also retrieve segment metadata and filters.
The
segment_id can be found using the View segments API or in the URL of the segment when viewing it in the dashboard.How to use this API
Basic usage
By default, this endpoint returns only the subscriber count for the segment:Include segment details
To retrieve full segment details including metadata and filters, setinclude-segment-detail=true:
payload object containing segment details:
Filters format
Thefilters array uses the same format as the Create segment API. This means you can:
- Read filters from this endpoint
- Modify them as needed
- Use them directly with the Update segment or Create segment APIs
Operator object - combines filters:
Payload fields
Headers
Your App API key with prefix Key. See Keys & IDs.
Path Parameters
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.
Query Parameters
Set to true to include segment metadata and filters in the response.