---
title: "POST /scheduling-rules/preview"
method: POST
path: "/scheduling-rules/preview"
tags: ["scheduling-rules"]
---

# POST /scheduling-rules/preview

`POST /scheduling-rules/preview`

**Required scope:** automation:workflows:read

## Request body

- union
  - RRulePreviewRequest
    - `id` string, uuid4
    - `count` integer
    - `businessCalendar` string, uuid4
    - `ruleType` 'rrule', required
    - `rrule` RRule, required
      - `freq` 'YEARLY' | 'MONTHLY' | 'WEEKLY' | 'DAILY' | 'HOURLY' | 'MINUTELY' | 'SECONDLY', required
      - `datestart` string, date, required — The recurrence start.
      - `interval` integer — The interval between each freq iteration.
      - `wkst` 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU' — The week start day.
      - `count` integer — How many occurrences will be generated.
      - `until` string, date-time — Specifying the upper-bound limit of the recurrence.
      - `bysetpos` union — Each given integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside the frequency period
        - integer
        - integer[]
      - `bymonth` union — The months to apply the recurrence to.
        - integer
        - integer[]
      - `bymonthday` union — The month days to apply the recurrence to.
        - integer
        - integer[]
      - `byyearday` union — The year days to apply the recurrence to.
        - integer
        - integer[]
      - `byeaster` union — Each integer will define an offset from the Easter Sunday. Passing the offset 0 to byeaster will yield the Easter Sunday itself.
        - integer
        - integer[]
      - `byweekno` union — The week numbers to apply the recurrence to.
        - integer
        - integer[]
      - `byweekday` string[] — Define the weekdays where the recurrence will be applied.
      - `byhour` union — The hours to apply the recurrence to.
        - integer
        - integer[]
      - `byminute` union — The minutes to apply the recurrence to.
        - integer
        - integer[]
      - `bysecond` union — The seconds to apply the recurrence to.
        - integer
        - integer[]
      - `byworkday` 'WORKING' | 'HOLIDAYS' | 'OFF'
  - GroupingRulePreviewRequest
    - `id` string, uuid4
    - `count` integer
    - `businessCalendar` string, uuid4
    - `ruleType` 'grouping', required
    - `groupingRule` GroupingRule, required
      - `combine` string[]
      - `intersect` string[]
      - `subtract` string[]
  - FixedOffsetRulePreviewRequest
    - `id` string, uuid4
    - `count` integer
    - `businessCalendar` string, uuid4
    - `ruleType` 'fixed_offset', required
    - `fixedOffsetRule` FixedOffsetRule, required
      - `rule` string, uuid4, required
      - `offset` number, required — Offset days
  - RelativeOffsetRulePreviewRequest
    - `id` string, uuid4
    - `count` integer
    - `businessCalendar` string, uuid4
    - `ruleType` 'relative_offset', required
    - `relativeOffsetRule` RelativeOffsetRule, required
      - `direction` 'next' | 'previous', required
      - `sourceRule` string, uuid4, required
      - `targetRule` string, uuid4, required

## Response `200`

- RulePreviewResponse
  - `nextExecutions` string[], required
  - `valid` boolean, required
  - `error` string, required

## Other responses

- `4XX`

---

[API](https://skmtc.net/dynatrace/apis/automation.md) · [All operations](https://skmtc.net/dynatrace/apis/automation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dynatrace/automation/versions/0fe23f9b256b/schema)
