Vercel cron jobs
Vercel calls a route in your project on a cron schedule you declare in vercel.json. Build the expression here (in UTC, with numeric values), then paste the block.
At 05:00, every day.
Next 10 runs
Calculating in your browser…
Times are computed in your browser for the selected zone and are informational. The server that runs the job uses its own zone (often UTC) and cron flavour, so verify there.
Same schedule in other dialects
0 5 * * *0 0 5 * * ?0 0 5 * * ?cron(0 5 * * ? *)Describe it in words, get the expression
Uses AI (Unix dialect). The answer is checked by the same validator before you can apply it.
vercel.json
Fix the expression above to generate a working snippet.
{
"crons": [
{
"path": "/api/cron/cleanup",
"schedule": "0 5 * * *"
}
]
}The endpoint
Vercel sends an HTTP GET to the path on your production domain. A minimal handler that checks the secret:
export function GET(request: Request) {
if (request.headers.get('authorization') !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response('Unauthorized', { status: 401 })
}
// do the work
return Response.json({ ok: true })
}Keep jobs idempotent: a run can occasionally be delivered more than once, and Vercel does not retry failed invocations for you. For work longer than your function’s maximum duration, have the cron route enqueue it instead.