Authentication API
REST endpoints for registering, logging in, and managing your app's users. All SDK auth endpoints use your project's public API key.
Base URL & auth header
Base URL: https://api.koolbase.com/v1/sdk
All requests require:
x-api-key: pk_live_your_public_key_hereEndpoints
POST
/sdk/auth/registerCreate a new user accountPOST
/sdk/auth/loginLogin and receive a session tokenPOST
/sdk/auth/logoutInvalidate the current sessionGET
/sdk/auth/meGet the currently authenticated userPOST
/sdk/auth/verify-emailVerify email with a tokenPOST
/sdk/auth/send-verificationSend a verification emailPOST
/sdk/auth/forgot-passwordRequest a password reset emailPOST
/sdk/auth/reset-passwordReset password using a tokenPOST /sdk/auth/register
// Request
{
"email": "user@example.com",
"password": "securepassword"
}
// Response 201
{
"id": "uuid",
"email": "user@example.com",
"verified": false,
"created_at": "2026-01-01T00:00:00Z"
}POST /sdk/auth/login
// Request
{
"email": "user@example.com",
"password": "securepassword"
}
// Response 200
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "uuid",
"email": "user@example.com",
"verified": true,
"created_at": "2026-01-01T00:00:00Z"
}
}Authenticated endpoints
After login, include the token in the Authorization header for endpoints that require authentication:
Authorization: Bearer <token>GET /sdk/auth/me
// Request headers
Authorization: Bearer <session_token>
// Response 200
{
"id": "uuid",
"email": "user@example.com",
"verified": true,
"created_at": "2026-01-01T00:00:00Z"
}POST /sdk/auth/forgot-password
// Request
{ "email": "user@example.com" }
// Response 200 (always succeeds — prevents email enumeration)
{ "message": "If that email exists, a reset link has been sent." }POST /sdk/auth/reset-password
// Request
{
"token": "reset_token_from_email",
"password": "newSecurePassword123"
}
// Response 200
{ "message": "Password updated successfully." }
// Error responses
// 400 token_expired — token is older than 1 hour
// 400 token_invalid — token not found or already usedError codes
400invalid_credentialsWrong email or password400email_not_verifiedUser must verify email before logging in400token_expiredPassword reset token has expired (1 hour TTL)400token_invalidToken not found or already used401unauthorizedMissing or invalid session token403user_disabledAccount has been disabled by project admin409email_takenEmail already registered