---
title: "Preview a condition"
method: POST
path: "/v1/segments/preview"
tags: ["segments"]
---

# Preview a condition

`POST /v1/segments/preview`

## Request

- Base URL: `https://api.wraps.dev`
- URL: `https://api.wraps.dev/v1/segments/preview`
- Auth: HTTP bearer

Counts and samples the audience an unsaved condition would reach, without creating a segment.

## Request body

- object
  - `condition` unknown, required
  - `limit` number

## Response `200`

- object
  - `count` number, required
  - `sample` string[], required

## Other responses

- `400`
- `401`: Missing, malformed, or revoked credentials. Send `Authorization: Bearer <api key>`.
- `403`: Authenticated, but the resource belongs to another organization.
- `404`: No such route, or no such resource in this organization.
- `422`: The request parsed but failed schema validation.
- `429`: Rate limit exceeded. Wait for the window named by the RateLimit headers.
- `500`: Unexpected server failure. Safe to retry with backoff; quote `requestId` if it persists.

---

[API](https://skmtc.dev/wraps/apis/wraps-platform-api.md) · [All operations](https://skmtc.dev/wraps/apis/wraps-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wraps/apis/wraps-platform-api/revisions/12116fb21af7?raw)
