---
title: "Use this when you need to check whether a 5-field cron expression is well-formed, instead of guessing."
method: POST
path: "/v1/validate_cron"
tags: ["datetime"]
---

# Use this when you need to check whether a 5-field cron expression is well-formed, instead of guessing.

`POST /v1/validate_cron`

## Request

- Base URL: `https://api.clean.tools`
- URL: `https://api.clean.tools/v1/validate_cron`
- Auth: none declared

Use this when you need to check whether a 5-field cron expression is well-formed, instead of guessing. Prefer this over reasoning about cron syntax yourself (a documented LLM failure mode). Deterministic: same input, same output. On success returns valid=true, the normalized expression, and the expanded matching values per field; on failure returns valid=false with a specific error (out-of-range value, reversed range, invalid step, wrong field count, or a field that matches nothing). Example: '99 * * * *' -> {valid:false, error:'Minute field: value out of range "99"'}.

## Request body

- object
  - `expression` string, required: 5-field cron expression to validate.

## Response `200`

Structured tool result.

- object
  - `tool` string
  - `result` object
    - `valid` boolean, required: Always true on the success result (a failed validation instead returns {valid:false, error}).
    - `error` unknown, required
    - `normalized` string, required: The normalized 5-field cron expression.
    - `fields` object, required
      - `minute` integer[], required: Matching minutes, 0-59.
      - `hour` integer[], required: Matching hours, 0-23.
      - `dayOfMonth` integer[], required: Matching days of month, 1-31.
      - `month` integer[], required: Matching months, 1-12.
      - `dayOfWeek` integer[], required: Matching weekdays, 0=Sunday .. 6=Saturday (7 folds to 0).

## Other responses

- `400`: Invalid input or the tool reported an error.
- `413`: Request body exceeds the 128 KB limit.
- `429`: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.

---

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