A Generator API

A Generator is a scheduling engine sold as an API. We start with schools: school software calls our API to build the timetable and find substitutes; schools without such software use Vyorm Schedule, our web app on the same engine.

A Generator API 0.3.0: 84 endpoints, listed below. JSON over HTTPS; errors are application/problem+json (RFC 9457).

Base URL

https://ag-api.alrevion.workers.dev — every path below starts there. Requests carry your key: Authorization: Bearer <key>.

Early access

There is no self-serve sign-up yet. Write to team@alrevion.com and we will set up your organization and keys.

From data to a timetable

  1. POST /v1/problems — upload the school's data as a Problem.
  2. POST /v1/problems/{problem_id}/solve — start a solve; the answer is a job (202).
  3. GET /v1/jobs/{job_id} — poll every 2–5 s until the job is done.
  4. GET /v1/jobs/{job_id}/result — the timetable and its score.

A TypeScript client for this flow and the machine-readable OpenAPI 3.1 contract exist but are not published yet; ask us for them.

Engine: problems, solves, checks

POST /v1/problems Upload a Problem
GET /v1/problems/{problem_id} Problem metadata and input validation status
GET /v1/problems/{problem_id}/content The stored Problem, streamed as uploaded or built
POST /v1/problems/{problem_id}/precheck Feasibility prechecks (202 job)
POST /v1/problems/{problem_id}/solve Start generation
POST /v1/problems/{problem_id}/explain Minimal conflict sets and suggested relaxations (job `explain`)
POST /v1/problems/{problem_id}/resolve MPP re-solve against a baseline, optionally repairing one moved lesson (job `resolve_mpp`)
POST /v1/validate Independent validator (202 job)
POST /v1/moves/candidates Candidates for a cell (202, job `check.moves` op=candidates)
POST /v1/moves/check Check a lesson move (202, job `check.moves` op=check; our UI checks moves in the browser)
POST /v1/moves/suggest Top-N slots for a lesson (202, job `check.moves` op=suggest)
POST /v1/substitutions/recommend Substitution candidates (check.recommend) or day reshuffle (reshuffle_day)
POST /v1/constraints/parse Phrase → draft constraint (confirmed_at = null) + "understood as"
GET /v1/norms/profiles Norms catalogue
GET /v1/norms/profiles/{code} One norms profile with editions
POST /v1/compliance/report Compliance report (job `check.compliance`; JSON only)

Jobs

GET /v1/jobs List jobs of the organization (newest first)
GET /v1/jobs/{job_id} Job status (poll every 2–5 s)
POST /v1/jobs/{job_id}/cancel Cancel
GET /v1/jobs/{job_id}/result Result, streamed as stored

Platform: webhooks, usage, health

GET /v1/webhooks Active webhook endpoints
POST /v1/webhooks Register a webhook endpoint (secret shown once)
DELETE /v1/webhooks/{webhook_id} Disable an endpoint
GET /v1/webhooks/{webhook_id}/deliveries Delivery log (last 50)
GET /v1/usage Tariff limits and this month's usage (jobs, CPU seconds, LLM tokens)
GET /v1/health Liveness: database, queue, alerts and the last successful job

Organizations and storage (directories, timetables)

GET /v1/memberships Organizations of the signed-in user with the role (org switcher)
POST /v1/invites/accept Accept an invitation (session whose email matches the invited address)
GET /v1/organizations/{org}/invites Invitations of the organization (owner/admin)
POST /v1/organizations/{org}/invites Invite a person by email (owner/admin)
DELETE /v1/organizations/{org}/invites/{invite_id} Revoke a pending invitation
GET /v1/organizations Organizations visible to the caller
POST /v1/organizations Create an organization
GET /v1/organizations/{org} Organization, settings (calendar, locale), norms profile
PATCH /v1/organizations/{org} Update (settings are merged, JSON Merge Patch)
DELETE /v1/organizations/{org} Delete the tenant
GET /v1/organizations/{org}/teachers Teachers (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/teachers Bulk upsert teachers (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/student-sets Student-sets (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/student-sets Bulk upsert student-sets (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/rooms Rooms (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/rooms Bulk upsert rooms (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/buildings Buildings (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/buildings Bulk upsert buildings (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/subjects Subjects (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/subjects Bulk upsert subjects (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/bell-schedules Bell-schedules (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/bell-schedules Bulk upsert bell-schedules (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/activities Activities (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/activities Bulk upsert activities (≤ 500 items, ≤ 1 MB)
GET /v1/organizations/{org}/constraints Constraints (confirmed data; drafts with ?draft=true)
PUT /v1/organizations/{org}/constraints Bulk upsert constraints (≤ 500 items, ≤ 1 MB)
POST /v1/organizations/{org}/confirm Confirm drafts (draft_data → data in one SQL statement, audited)
POST /v1/organizations/{org}/problems Build a Problem from the stored directories
GET /v1/organizations/{org}/api-keys API keys of the organization (no secrets)
POST /v1/organizations/{org}/api-keys Create an org-bound API key (shown once; environment follows the organization)
DELETE /v1/organizations/{org}/api-keys/{key_id} Revoke a key (other edge isolates honour it within 60 s)
GET /v1/organizations/{org}/labels Person labels (names) for client-side texts — the only place names leave the API
PUT /v1/organizations/{org}/labels Upsert labels by code (≤ 200 per request)
GET /v1/organizations/{org}/schedules Schedule versions
POST /v1/organizations/{org}/schedules New version from a solve job result, or an empty manual one for a problem
GET /v1/organizations/{org}/schedules/{schedule_id} Version metadata (ETag = rev)
POST /v1/organizations/{org}/schedules/{schedule_id}/publish Publish
POST /v1/organizations/{org}/schedules/{schedule_id}/archive Archive a version
GET /v1/organizations/{org}/schedules/{schedule_id}/lessons Current revision, streamed (ETag = rev)
PUT /v1/organizations/{org}/schedules/{schedule_id}/lessons Replace with a whole new revision
GET /v1/organizations/{org}/absences Teacher absences overlapping [from, to]
POST /v1/organizations/{org}/absences Record an absence (teacher code, dates, reason code)
DELETE /v1/organizations/{org}/absences/{absence_id} Remove an absence
POST /v1/organizations/{org}/absences/{absence_id}/recommend Substitution candidates (check.recommend) or a reshuffled day (reshuffle_day) for a stored schedule
GET /v1/organizations/{org}/substitutions Proposed and confirmed substitutions (history)
POST /v1/organizations/{org}/substitutions Propose a substitution (emits substitution.proposed)
POST /v1/organizations/{org}/substitutions/{substitution_id}/confirm Confirm (emits substitution.confirmed, audited)

Free audit

POST /v1/organizations/{org}/audit/files Store a schedule file for the free audit (deleted after 30 days)

Onboarding

POST /v1/organizations/{org}/onboarding Start an onboarding session
GET /v1/organizations/{org}/onboarding/{session_id} Session status and summary (files, chunk progress for resuming, tokens, precheck result)
POST /v1/organizations/{org}/onboarding/{session_id}/files Store a source file (only if the user agreed)
POST /v1/organizations/{org}/onboarding/{session_id}/chunks Store an encoded cell chunk (names already replaced by codes)
POST /v1/organizations/{org}/onboarding/{session_id}/llm Language-model step for one chunk (JSON Schema output)
POST /v1/organizations/{org}/onboarding/{session_id}/voice Voice phrase → text (≤ 2 min)
PUT /v1/organizations/{org}/onboarding/{session_id}/questions Questions to the school from the merge step (≤ 200; each needs text and at least one source)
POST /v1/organizations/{org}/onboarding/{session_id}/check Build a Problem "as if drafts were confirmed" and run inputcheck + precheck
GET /v1/organizations/{org}/questions Questions to the school, with sources and defaults
POST /v1/organizations/{org}/questions/{question_id}/answer Answer a question (or take the default)