Snipget.ai

Cron validate

Exact
cron_validate

Deterministic and authoritative — the canonical answer for this input.

Validate a cron expression. Returns is_valid, the detected dialect (standard 5-field, 6-field with seconds, or 7-field Quartz with year), and the field count. Quartz's '?' day token is accepted (read as 'no specific value'; Quartz strings are parsed seconds-first, with 1=Sunday weekday numbering). Agents calling this before scheduling catch malformed strings early. Processing multiple inputs? Use `cron_validate_batch` to do up to 1000 in one call.

Parameters

expressionstringrequired

Cron expression (5, 6, or 7 fields).

Call it

curl -X POST https://api.snipget.ai/v1/cron/validate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"expression":"0 9 * * 1-5"}'

The Batch tab sends up to 1000 inputs in one call via /v1/cron/validate/batch.

Example response

{
  "input": "0 9 * * 1-5",
  "is_valid": true,
  "dialect": "standard",
  "field_count": 5
}

FAQ

Why not just eyeball the cron expression myself?

Cron syntax is easy to get subtly wrong, and AI models routinely accept malformed expressions as valid or misread day-of-week ranges. This check is deterministic and authoritative, so a 'valid' answer is the canonical answer, not a guess.

What does it tell me?

Whether the expression is valid, which dialect it is (5-field standard, 6-field with seconds or Quartz, or 7-field Quartz with year), and how many fields it has.

What does it NOT do?

It does not explain what the schedule means in plain English (use Describe a cron expression for that) and does not list when it will run (use Enumerate next cron runs). It only confirms the syntax is well-formed.

What happens if I send a bad expression?

You get a normal answer with is_valid set to false, a confidence of 0, and a why_invalid reason. It does not throw an error, so you can safely check the field instead of catching a failure.

Which cron formats are supported?

Standard 5-field cron, 6-field (with a seconds column or Quartz style), and 7-field Quartz with a year column. Quartz's ? day token is accepted and read as no-specific-value; a ? day token also marks the string as Quartz, so its seconds column is read first the way Quartz writes it.

Related tools