---
title: "Preview a rule"
method: POST
path: "/api/recurring/preview"
---

# Preview a rule

`POST /api/recurring/preview`

## Request

- Base URL: `https://postwire.io`
- URL: `https://postwire.io/api/recurring/preview`
- Auth: HTTP bearer

The next occurrences of a rule (and which text each would use) and the warnings, without saving anything.

## Request body

- object
  - `rule` object: When it repeats. Daylight saving: a time that does not exist on the day clocks go forward runs that much later (02:30 -> 03:30); a time that happens twice runs the first time.
    - `freq` 'daily' | 'weekly' | 'monthly', required
    - `interval` integer: Every N days / weeks / months, counted from start.
    - `days` string[]: weekly: the weekdays (default: the start date's).
    - `month_days` integer[]: monthly: days of the month; -1 = the last day. 31 falls on the last day of shorter months.
    - `times` string[]: 24-hour HH:MM, 1-4 a day. Default 09:00.
    - `timezone` string: IANA name. Default: the brand's queue timezone, else UTC.
    - `start` string, date: First day (default today); also the anchor of every N.
    - `until` string, date: Last day, inclusive.
    - `count` integer: Stop after N occurrences.
  - `variants` string[]
  - `guard_days` integer
  - `brand_id` string
  - `limit` integer

## Response `200`

{ rule, describe, next: [{ at, local, n, variant }], warnings }

## Other responses

- `400`: bad_rule

---

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