---
title: "View segment"
method: GET
path: "/apps/{app_id}/segments/{segment_id}"
---

# View segment

`GET /apps/{app_id}/segments/{segment_id}`

Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters.

## Path parameters

- `app_id` string, required
- `segment_id` string, required

## Query parameters

- `include-segment-detail` boolean

## Headers

- `Authorization` string, required

## Response `200`

200

- object
  - `subscriber_count` integer — The number of subscribers matching this segment.
  - `payload` object — Segment details. Only included when `include-segment-detail=true`.
    - `id` string — The unique identifier for the segment (UUID v4).
    - `name` string — The segment name.
    - `description` string, nullable — Human-readable description for the segment. `null` when unset. Maximum 255 characters.
    - `created_at` integer — Unix timestamp when the segment was created.
    - `source` 'default' | 'custom' | 'quickstart' — The source of the segment.
    - `filters` union[] — Array of filter and operator objects defining the segment criteria. Uses the same format as the Create segment API, so filters can be directly used to recreate or update the segment.
      - union
        - object — A filter condition.
          - `field` string — The filter type.
          - `relation` '>' | '<' | '=' | '!=' | 'exists' | 'not_exists' | 'in_array' | 'not_in_array' | 'time_elapsed_gt' | 'time_elapsed_lt' — The comparison operator.
          - `value` string — The filter value.
          - `key` string — The filter key (used for tag filters).
          - `hours_ago` string — Hours ago value (used for last_session/first_session filters).
          - `radius` string — Radius in meters (used for location filters).
          - `lat` string — Latitude (used for location filters).
          - `long` string — Longitude (used for location filters).
          - `unsupported_in_api` boolean — If true, this filter type cannot be used with the Create/Update segment APIs. These filters were created via the dashboard UI using features not available in the public API (e.g., message_event, custom_event filters).
        - object — A logical operator to combine filters.
          - `operator` 'AND' | 'OR', required — The logical operator.

## Other responses

- `400` — 400
- `404` — 404
- `429` — Rate limit exceeded. Wait the number of seconds in the `Retry-After` header before retrying.
- `503` — Service temporarily unavailable. Retry after a short backoff. The body may be empty or non-JSON in some failure modes.

---

[API](https://skmtc.net/onesignal/apis/api-onesignal-com.md) · [All operations](https://skmtc.net/onesignal/apis/api-onesignal-com/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onesignal/api-onesignal-com/versions/0fc223f7e338/schema)
