API endpoints
This page is generated from apps/api/src/worker.ts and the routers it mounts. Every endpoint is tenant-scoped (requires x-tenant-id) unless explicitly noted otherwise.
Conventions
Section titled “Conventions”- Base URL —
https://api.cloudscode.comin production;http://localhost:8787in local dev. - Tenant header —
x-tenant-id: <tenant_id>is required on all data-plane calls. - Error envelope —
{ "error": "<message>" }on any non-2xx response. - Auth — session cookie (browser) or
Authorization: Bearer <api_token>(machine).
Health & auth
Section titled “Health & auth”| Method | Path | Description |
|---|---|---|
| GET | /healthz | Liveness probe. Returns { ok, env }. |
| GET | /auth/google/start | Begin Google OAuth login. |
| GET | /auth/google/callback | OAuth callback (server-driven). |
| POST | /auth/google/callback | OAuth callback (POST variant). |
| GET | /auth/me | Current session user. |
| POST | /auth/logout | Invalidate session. |
Tenants & onboarding
Section titled “Tenants & onboarding”| Method | Path | Description |
|---|---|---|
| * | /api/v1/tenants | Tenant CRUD, members, plan changes. |
| * | /api/v1/onboarding | First-run onboarding flow. |
| * | /api/v1/admin | Admin console surface. |
| * | /api/admin-debug | Admin debug tools (gated). |
Runtime instances
Section titled “Runtime instances”| Method | Path | Description |
|---|---|---|
| * | /instances | Create, list, stop runtime instances. |
| * | /internal/jobs | Internal job dispatch (operator-only). |
| * | /liveview | WebSocket live-view of running instances. |
| * | /runs | Replay finished runs. |
| * | /public/runs | Public-facing replay viewer. |
Conversations & LLM
Section titled “Conversations & LLM”| Method | Path | Description |
|---|---|---|
| * | /api/v1/conversations | Send/receive messages, list history. |
| * | /api/v1/llm | Direct LLM proxy with BYOK key. |
| Method | Path | Description |
|---|---|---|
| POST | /byok | Add a provider key for the tenant. |
| GET | /byok | List keys (metadata only). |
| DELETE | /byok/:id | Remove a key. |
| * | /api/v1/byok | Same surface, versioned alias. |
Billing
Section titled “Billing”| Method | Path | Description |
|---|---|---|
| * | /subscriptions | Plan and subscription management. |
| * | /credits | Credit balance and ledger. |
| * | /usage | Metered usage rollups. |
| * | /webhooks/stripe | Stripe webhook receiver (when wired). |
| * | /referral | Referral / partner credits. |
Skills
Section titled “Skills”| Method | Path | Description |
|---|---|---|
| * | / | Skills router (root-mounted; multiple paths). |
| POST | /skills/verify | Verify a skill manifest signature. |
| * | /cron/skill-registry | Periodic skill-registry reconciliation. |
Channels
Section titled “Channels”Channel routers are root-mounted; each one owns its own webhook + send paths.
| Provider | Path prefix (typical) |
|---|---|
| Telegram | /channels/telegram |
/channels/whatsapp | |
| Slack | /channels/slack |
| Discord | /channels/discord |
| iMessage | /channels/imessage |
| Matrix | /channels/matrix |
| Signal | /channels/signal |
| Teams | /channels/teams |
| Nextcloud | /channels/nextcloud |
| Nostr | /channels/nostr |
| Zalo | /channels/zalo |
| Feishu | /channels/feishu |
Governance
Section titled “Governance”| Method | Path | Description |
|---|---|---|
| * | /teams | Team & member management. |
| * | /audit | Append-only audit log. |
| * | /approvals | Multi-party approval workflows. |
| * | /residency | Data-residency policy. |
| * | /enterprise | Enterprise SSO, SCIM, audit export. |