Send email verification
POST https://api-staging.knowledgestack.ai/v1/auth/pw/email_verification
Send a verification email to the provided address. The email contains a token that you pass to the create user endpoint. This is the first step when registering a new password-based user.
Request body
The email address to verify. Must be a valid email format.
Response
Returns anEmailSentResponse on success.
ID of the sent email message.
Example
Create user
POST https://api-staging.knowledgestack.ai/v1/auth/pw/user
Create a new password-based user account. You must complete email verification first and supply the token from that email.
Request body
The user’s password. Minimum 8 characters.
The email verification token received from the verification email.
User’s first name (optional).
User’s last name (optional).
Response 201
Returns a UserResponse on success.
User ID.
User’s email address.
First name.
Last name.
Identity provider type. One of
PASSWORD, GOOGLE, TENANT.The tenant the user is currently scoped to.
The user’s role in the current tenant.
The tenant the user is signed into by default.
Example
Sign in
POST https://api-staging.knowledgestack.ai/v1/auth/pw/signin
Validate email and password credentials. On success, the server sets a ks_uat session cookie containing the user access token and returns the user record.
Request body
The user’s email address.
The user’s password.
Target tenant to sign into. If omitted, the user’s default tenant is used.
Response 200
Returns a UserResponse. See Create user for field descriptions.
The
ks_uat cookie returned by this endpoint is your user access token (UAT). Pass it as Authorization: Bearer <uat> on subsequent requests, or let the browser send it automatically via the cookie.Example
Send password reset email
POST https://api-staging.knowledgestack.ai/v1/auth/pw/send_reset_email
Send a password reset email to the given address. The email contains a token that you pass to reset with token.
Request body
The email address associated with the account.
Response 200
Returns an EmailSentResponse.
ID of the sent email message.
Example
Reset password
POST https://api-staging.knowledgestack.ai/v1/auth/pw/reset
Reset the password for the currently authenticated user using their existing password. Requires a valid UAT.
Request body
The user’s current password.
The new password. Minimum 8 characters.
Response 200
Returns a UserResponse reflecting the updated user.
Example
Reset password with token
POST https://api-staging.knowledgestack.ai/v1/auth/pw/reset_with_token
Reset the password using an email verification token from the send reset email flow. This does not require an existing session.
Request body
The password reset token from the reset email.
The new password. Minimum 8 characters.
Response 200
Returns a UserResponse.
Example
Refresh UAT
POST https://api-staging.knowledgestack.ai/v1/auth/uat
Refresh the user access token or switch the active tenant. Call this when the current UAT has expired or when you want to operate under a different tenant.
Query parameters
Target tenant ID to switch to. Omit to refresh the current tenant.
Response 200
Returns a UserResponse with the updated current_tenant_id.
Example
Sign out
POST https://api-staging.knowledgestack.ai/v1/auth/signout
Invalidate the current session and clear the ks_uat cookie.
Response 200
Returns an empty JSON object {}.