Skip to main content

Scheduler

  • Sells as: the scheduler product (a product-scoped API key). This capability has no separate product-face contract — its public product route reuses the capability contract below; see the Edge route table's Product face row.

Durable background-job scheduling capability — register a one-shot (date), interval, or cron job with a callback_url; the scheduler persists it (own Postgres store, I4) and fires the callback when due, exactly once (single-owner Postgres advisory-lock election + FOR UPDATE SKIP LOCKED claim). A one-shot survives a restart because it is a durable row, not an in-memory job. The callback service token is resolved server-side (Infisical), never stored per-job or logged.

  • Group: Comms & workflow
  • Contract: contracts/scheduler/v1/openapi.yaml
  • Console: Manage the scheduler product in the console →
  • Runbook: operational checklist for schedulerinternal (Vagary Labs ops; not part of this public site): docs/runbooks/capability-operations.md#scheduler
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/jobs

Edge route table

The routes this capability actually serves on the public edge — live-synced from GET https://api.vagarylabs.com/product/v1/_meta/catalog (snapshot v1). The metric is the request-granularity billing counter; the scope is the key permission required.

Product face (customer-keyed)

MethodPathMetricScope
POST/product/v1/jobsjob_operationswrite

Endpoints

MethodPathSummary
POST/v1/jobsRegister (upsert) a durable job with a callback_url
GET/v1/jobsList the caller's org jobs
GET/v1/jobs/&#123;job_id&#125;Get one job
DELETE/v1/jobs/&#123;job_id&#125;Remove one job
GET/healthliveness
GET/metricsPrometheus

Schemas

JobRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6)
job_idstringstable id, unique per org (upsert key)
kindstring
callback_urlstringhttp(s) URL the scheduler POSTs when the job is due
payloadobjectarbitrary JSON forwarded to the callback
run_atstringrequired when kind=date
interval_secondsintegerrequired when kind=interval
cronobjectrequired when kind=cron

JobAccepted

FieldTypeDescription
job_idstring
kindstring
statusstring
next_run_atstring

Job

FieldTypeDescription
job_idstring
organization_idstring
kindstring
callback_urlstring
payloadobject
interval_secondsinteger
cronobject
run_atstring
next_run_atstring
statusstring
attemptsinteger
last_errorstring

Error

FieldTypeDescription
errorstring

Generated by scripts/gen-capability-docs.py from contracts/scheduler/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page. The Edge route table section is synced from the live edge catalog snapshot (v1) — re-sync with python3 scripts/sync-edge-catalog.py.