Documentation Index
Fetch the complete documentation index at: https://docs.knowledgestack.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authentication methods
| Method | Description |
|---|---|
| Email/password | Users sign up with an email address and password. |
| Google SSO | Sign in with a Google account using OAuth2. |
| Tenant SSO | Connect your own OpenID Connect identity provider for single sign-on. |
How sessions work
When a user signs in, Knowledge Stack issues a session token as anhttpOnly cookie called ks_uat. This cookie is automatically sent with every subsequent API request — no need to manage tokens manually.
- The session cookie is secure and not accessible to client-side JavaScript.
- Sessions are scoped to a specific tenant. To switch tenants, refresh the token via the
/auth/uatendpoint.
Email/password authentication
Sign-up flow
- Verify email — Call
POST /auth/pw/email_verificationwith the user’s email. They’ll receive a verification token. - Create account — Call
POST /auth/pw/userwith the verification token and their chosen password.
Sign-in
ks_uat session cookie. Include this cookie in all subsequent requests.
Password reset
Two flows are available:- Authenticated reset — A signed-in user calls
POST /auth/pw/resetwith their current and new password. - Forgot password — Call
POST /auth/pw/send_reset_email, thenPOST /auth/pw/reset_with_tokenwith the emailed token.
SSO (Google and Tenant providers)
Knowledge Stack implements the Authorization Code with PKCE flow for SSO.SSO flow
- Initiate — Call
POST /auth/sso/initiatewith the provider type. The response includes an authorization URL. - Redirect — Redirect the user to the authorization URL. They authenticate with their identity provider.
- Callback — The provider redirects back to your application. The callback endpoint (
GET /auth/sso/oauth2/callback) exchanges the authorization code for a session and sets theks_uatcookie.
Tenant switching
A user can belong to multiple tenants. To switch the active tenant:Signing out
API reference
| Endpoint | Method | Description |
|---|---|---|
/auth/pw/email_verification | POST | Send email verification token |
/auth/pw/user | POST | Create account from verification token |
/auth/pw/signin | POST | Sign in with email and password |
/auth/pw/send_reset_email | POST | Send password reset email |
/auth/pw/reset | POST | Reset password (signed in) |
/auth/pw/reset_with_token | POST | Reset password with emailed token |
/auth/sso/initiate | POST | Start SSO flow |
/auth/sso/oauth2/callback | GET | OAuth2 callback |
/auth/uat | POST | Refresh or switch tenant |
/auth/signout | POST | Sign out |
