Skip to main content

Signup

Creates an organisation, admin user, team, and first workspace in a single atomic call.
POST /api/signup
Request body:
FieldTypeRequiredDescription
org_namestringYesOrganisation name
admin_namestringYesAdmin user’s display name
admin_emailstringYesAdmin user’s email
admin_passwordstringYesPassword (min 8 characters)
workspace_namestringYesFirst workspace name
team_namestringYesTeam name for the workspace
system_promptstringNoOptional system prompt for the workspace
Response:
{
  "status": "ok",
  "org_id": "de14cfd7...",
  "user_id": "20939ded...",
  "workspace_id": "ws-support-bot"
}
Sets the session cookie automatically.

Login

POST /api/auth/login
Request body:
FieldTypeRequired
emailstringYes
passwordstringYes
Accepts both JSON and application/x-www-form-urlencoded. Response:
{
  "status": "ok",
  "user": {"id": "...", "email": "...", "name": "...", "role": "admin"}
}
Sets the supaproxy_session cookie (JWT, httpOnly, 24h expiry).

Session

GET /api/auth/session
Response:
// Authenticated
{"user": {"id": "...", "email": "...", "name": "...", "role": "admin"}}

// Not authenticated
{"user": null}

Logout

GET /api/auth/logout
Clears the session cookie. Redirects to /login or returns {"status": "ok"}.