---
title: "POST /api/automation-rules/preview"
method: POST
path: "/api/automation-rules/preview"
tags: ["Automation Rules"]
---

# POST /api/automation-rules/preview

`POST /api/automation-rules/preview`

Count what a condition tree matches before it belongs to a rule — what the create form calls while the author is still building it. Runs the same compiler and the same SQL as a scheduled run, and writes nothing.

## Request body

- object
  - `conditions` Schema0Input, required — unresolved $ref
  - `resourceType` string
  - `timezone` string
  - `sampleSize` integer
  - `sampleOffset` integer

## Response `200`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required — True when the request succeeded.
  - `data` object, required
    - `matchedCount` integer, required
    - `columns` string[], required
    - `rows` object[], required
    - `anchorDate` string, required
    - `projectionStatus` 'backfilling' | 'ready', required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response

---

[API](https://skmtc.net/retraced/apis/api-reference.md) · [All operations](https://skmtc.net/retraced/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/retraced/api-reference/revisions/60d6c901bc4e/schema)
