---
title: "Preview a segment"
description: "How many contacts a saved segment reaches: its members, the subscribed set a campaign would mail (0 means a campaign would send nothing), and a sample (which also needs contacts:read). `GET /api/v1/segments/{id}/preview`"
url: https://www.unitpost.com/docs/platform/get-segments-id-preview
section: "Platform API reference"
updated: 2026-10-13
---
# Preview a segment

`GET /api/v1/segments/{id}/preview`

How many contacts a saved segment reaches: its members, the subscribed set a campaign would mail (`0` means a campaign would send nothing), and a sample (which also needs `contacts:read`). Requires the `segments:read` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `segment_id` | string \| null | yes | The saved segment, or null for an unsaved filter. |
| `archived` | boolean \| null | yes | Whether the saved segment is archived (a campaign can't target it); null for an unsaved filter. |
| `member_count` | integer | yes | Contacts that match (or are members). |
| `subscribed_count` | integer | yes | Of those, the ones a campaign would mail: not unsubscribed. 0 means an empty send. |
| `sample` | object[] | yes | Up to 3 of the subscribed set. Empty without `contacts:read`. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The counts. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | Segment not found. |
| 422 | A query key (this operation takes none). |

## Example request

```bash
curl -X GET 'https://www.unitpost.com/api/v1/segments/seg_123/preview' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

## Example response (200)

```json
{
  "object": "segment_preview",
  "segment_id": "segment_123",
  "archived": false,
  "member_count": 1,
  "subscribed_count": 1,
  "sample": [
    {
      "id": "id_123",
      "email": "customer@example.com",
      "first_name": "string",
      "last_name": "string"
    }
  ]
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/get-segments-id-preview
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
