Skip to main content

Scheduler

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

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
  • 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

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.