---
title: "Preview contact group criteria"
method: POST
path: "/v1/contact-groups/preview"
tags: ["Contact Groups"]
---

# Preview contact group criteria

`POST /v1/contact-groups/preview`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/contact-groups/preview`
- Auth: API key in header `x-api-key`

Evaluates group criteria without persisting, returning the matching contact count and a sample of matches.

## Request body

- object
  - `criteria` object, required
    - `tags` string[], nullable
    - `channels` string[], nullable
    - `match` 'all' | 'any', nullable
    - `conditions` object[], nullable
      - `field` string, required
      - `operator` string, required
      - `value` union, required
        - string
        - number
        - boolean
        - JsonValue[]
        - object

## Response `200`

Success

- object
  - `count` integer, required
  - `sample` object[], required
    - `id` string, required
    - `name` string, required
    - `status` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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