Rensei docs

API Overview

Auth mechanisms and route-group map.

The Rensei platform exposes a structured REST API surface organized into distinct route groups, each with a consistent authentication model. This page maps every group, its auth mechanism, and where to find the detailed reference.

Route group map

GroupPrefixAuth mechanismAudience
Public stats & sessions/api/public/*Cookie session or Bearer rsk_* (per-session routes also accept the session hash)Chat consumers, monitoring dashboards
Browser/CLI user/api/org/*, /api/projects/*, /api/workflows/*Cookie session or Bearer rsk_live_*Dashboard users, CLI operators
Worker protocol (pre-v1)/api/workers/*, /api/sessions/*Bearer <runtime_jwt> (preferred), registration token, or legacy opaque key (deprecated)Self-hosted daemon, donmai CLI
Worker protocol v1 (daemon-native)/v1/daemon/register, /v1/daemon/heartbeatRegistration token in body (register) / Bearer <runtime_jwt> (heartbeat)rensei-tui daemon
OAuth / Token/api/oauth/tokenclient_credentials grantM2M SDK clients, CI/CD pipelines
Webhook ingest/api/webhooks/ingest/[provider]HMAC signature per providerLinear, GitHub, Vercel, GitHub Actions
A2A protocol/api/a2a/*Cookie/bearerWorkflow editor users, peer agents
MCP tool endpoint/api/mcp/[sessionId]Bearer rsk_*Daemon/agent subprocesses
Audit log/api/audit/*Cookie/bearer; anchor/verify accept M2M JWTOperator admins, auditors, SIEM
Discovery/.well-known/agent-card.json, /.well-known/audit-keys/[workspace_id]None (public)A2A peers, external auditors
SCIM provisioning/api/scim/webhookSCIM bearer tokenIdP (Okta, Azure AD)
Admin (system)/api/admin/*scope='system' session or API keyOperator admins
Health/api/healthNone (public)Load balancers, status pages

The /api/org/* handlers use requireOrgAccess(), which is cookie-only. CLI clients that authenticate with a Bearer rsk_* key must use sub-paths that call getCliOrSessionAuth (e.g. /api/org/[orgId]/keys). See API Key Authentication for detail.

Authentication at a glance

Rensei uses three main authentication models depending on who is calling:

API reference sections

Base URL

All production API endpoints are served from https://app.rensei.ai. Example:

curl -s https://app.rensei.ai/api/health

Common request headers

HeaderRequiredExample
AuthorizationYes (auth'd routes)Bearer rsk_live_abc123
Content-TypeYes (POST/PATCH)application/json
AcceptOptionalapplication/json

Error responses

All API errors return JSON with error and optional message fields:

{
  "error": "Unauthorized",
  "message": "Missing or invalid bearer token"
}

Standard HTTP status codes apply: 400 for validation errors, 401 for missing auth, 403 for insufficient permissions, 404 for not found, 500 for internal errors.

Self-hosting

The full worker-protocol API surface - registration, poll, heartbeat, session lifecycle, credentials - can be hosted independently using the @donmai/nextjs package. It provides pre-built Next.js App Router route handlers that implement the same contracts as the Rensei hosted platform. The donmai daemon connects to a self-hosted backend without any configuration changes.

pnpm add @donmai/nextjs @donmai/core @donmai/server

See TypeScript SDK for the package catalogue and quick-start guide.

On this page