Overview

The Auth API handles user registration, authentication, session management, and organization membership. Sessions are token-based; include the returned token in the Authorization: Bearer <token> header for authenticated requests.

Endpoints

MethodPathDescription
POST/auth/registerRegister a new user and create an org with a default API key
POST/auth/loginAuthenticate with email/password, return session token
POST/auth/logoutInvalidate the current session
GET/auth/meReturn current user profile and org stats
PATCH/auth/meUpdate user name or password
GET/auth/me/membersList organization members
PATCH/auth/me/members/:userId/roleChange a member's role
POST/auth/accept-inviteAccept an invitation

Example

curl -X POST http://localhost:4000/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","password":"..."}'