Current Web API
These are the session-backed routes used by the ZOYYA web app today. They are useful for understanding the product surface, but they are not a stable public /api/v1 contract yet. All endpoints require a session cookie unless noted. Resource access is scoped to the caller's active org, set via POST /api/active-org.
Auth
BetterAuth handles signup / signin / signout under /api/auth/*. See BetterAuth docs for the canonical reference.
Orgs
| Verb | Path | Notes |
|---|
| GET | /api/orgs | List the caller's memberships |
| POST | /api/orgs | Create a team org { name, slug } |
| GET | /api/orgs/:slug/members | Members + invites of an org |
| POST | /api/orgs/:slug/members | Invite by email { email, role } |
| POST | /api/active-org | Switch active org { slug } |
| POST | /api/invites/:token/accept | Accept an invite (sets active-org cookie) |
Runs
| Verb | Path | Notes |
|---|
| GET | /api/runs | List runs in active org |
| POST | /api/runs | Start a run { objective }. Rate-limited. |
| GET | /api/runs/:id | Run summary; 404 if not in active org |
| GET | /api/runs/:id/steps | Paginated steps |
| GET | /api/runs/:id/stream | Server-Sent-Events live trace |
| POST | /api/runs/:id/halt | Halt an active run |
| GET | /api/orgs/:slug/queue | Tasks waiting at the concurrency cap (202-queued) |
| DELETE | /api/orgs/:slug/queue/:id | Remove a still-waiting queued task (browser session only) |
Billing
| Verb | Path | Notes |
|---|
| GET | /api/billing/subscription | Current plan, status, period |
| POST | /api/billing/checkout | Create payment invoice { planSlug, currency? } |
| POST | /api/billing/webhook | NOWPayments IPN. HMAC-verified. |
| POST | /api/billing/mayar-webhook | Mayar payment webhook. URL-secret guarded. |
| POST | /api/billing/cancel | Mark cancellation at period end |
Status
| Verb | Path | Notes |
|---|
| GET | /api/status | Public. JSON snapshot of every dependency |
Stats
| Verb | Path | Notes |
|---|
| GET | /api/stats | Aggregate run/llm/tool stats for the active org |