Reference

Cron Jobs

Scheduled background jobs on Vercel.

Recurex runs two cron jobs configured in vercel.json. Both require authentication.

Authentication

Authorization: Bearer {CRON_SECRET}

Alternatively: ?secret={CRON_SECRET}

Reminders + FX refresh

GET /api/cron/reminders
PropertyValue
ScheduleDaily at 08:00 UTC (0 8 * * *)
Max duration60 seconds

What it does

  1. Select active expenses with reminder_enabled = true and next_due set
  2. Filter orgs with reminders:email plan feature
  3. Resolve org owner → reminder_email and timezone
  4. Roll forward stale next_due dates for recurring bills
  5. Send reminder digest emails for items in the lead window
  6. Log sends in reminders_log (idempotent per expense + due date)
  7. Piggyback daily FX rate refresh (refreshFxRates)

Response

{
  "ok": true,
  "candidates": 12,
  "nextDueAdvanced": 3,
  "digestsSent": 2,
  "remindersSent": 5,
  "fxRefreshed": true,
  "errors": []
}

Provider sync

GET /api/cron/provider-sync
PropertyValue
Schedule2nd of month at 06:00 UTC (0 6 2 * *)
Max duration60 seconds

What it does

  1. Compute previous calendar month period (YYYY-MM-01)
  2. Load all provider_links
  3. Skip orgs without bills:variable feature
  4. Run runProviderSync() per link
  5. Collect per-link errors (best-effort)

Response

{
  "ok": true,
  "period": "2026-05-01",
  "links": 8,
  "synced": 7,
  "errors": []
}

Manual triggering

For local testing:

curl -H "Authorization: Bearer $CRON_SECRET" \
  https://recurex.app/api/cron/reminders