Auth
API reference for auth endpoints.
Auto-generated
make generate-docs to refresh after spec changes.DELETE /api/v1/auth/account
/api/v1/auth/accountDelete Account
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| password | string | Optional | password |
| confirm | boolean | Optional | ConfirmDefault: False |
Request Example
curl -X DELETE https://api.alterlab.io/api/v1/auth/account \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}POST /api/v1/auth/add-password
/api/v1/auth/add-passwordAdd Password
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| password | string | Required | Password |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/add-password \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"password": "example_password"
}'Response Example
{
"message": "example"
}POST /api/v1/auth/change-password
/api/v1/auth/change-passwordChange Password
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| current_password | string | Required | Current Password |
| new_password | string | Required | New Password |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/change-password \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"current_password": "example_current_password",
"new_password": "example_new_password"
}'Response Example
{
"status": "ok"
}POST /api/v1/auth/check-email
/api/v1/auth/check-emailCheck Email
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/check-email \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email"
}'Response Example
{
"exists": true,
"has_password": true
}GET /api/v1/auth/check-email-exists
/api/v1/auth/check-email-existsCheck Email Provider
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required |
Request Example
curl -X GET 'https://api.alterlab.io/api/v1/auth/check-email-exists?email=<email>' \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}POST /api/v1/auth/complete-signup
/api/v1/auth/complete-signupComplete Signup
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | ||
| code | string | Required | Code |
| device_fingerprint | object | Optional | Device fingerprint data collected from client. |
| attribution | object | Optional | First-touch attribution data captured at signup. All fields are optional strings — the frontend sends whatever it has. Values are sanitized (HTML stripped, max 500 chars each). |
| anonymous_id | string | Optional | anonymous_id |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/complete-signup \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email",
"code": "example_code"
}'Response Example
{
"status": "ok"
}POST /api/v1/auth/forgot-password
/api/v1/auth/forgot-passwordForgot Password
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/forgot-password \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email"
}'Response Example
{
"message": "example"
}POST /api/v1/auth/initiate-signup
/api/v1/auth/initiate-signupInitiate Signup
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | ||
| password | string | Required | Password |
| name | string | Optional | name |
| device_fingerprint | object | Optional | Device fingerprint data collected from client. |
| attribution | object | Optional | First-touch attribution data captured at signup. All fields are optional strings — the frontend sends whatever it has. Values are sanitized (HTML stripped, max 500 chars each). |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/initiate-signup \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email",
"password": "example_password"
}'Response Example
{
"message": "example",
"email": "example",
"expires_in_minutes": 0
}GET /api/v1/auth/linked-accounts
/api/v1/auth/linked-accountsGet Linked Accounts
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/linked-accounts \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"accounts": [],
"primary_method": "example",
"has_password": true
}POST /api/v1/auth/linked-accounts/callback
/api/v1/auth/linked-accounts/callbackComplete Link
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| state | string | Required | State |
| provider | string | Required | Provider |
| provider_account_id | string | Required | Provider Account Id |
| provider_email | string | Optional | provider_email |
| display_name | string | Optional | display_name |
| avatar_url | string | Optional | avatar_url |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/linked-accounts/callback \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "example_state",
"provider": "example_provider",
"provider_account_id": "example_provider_account_id"
}'Response Example
{
"status": "ok"
}POST /api/v1/auth/linked-accounts/complete
/api/v1/auth/linked-accounts/completeComplete Link Public
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| state | string | Required | State |
| provider | string | Required | Provider |
| provider_account_id | string | Required | Provider Account Id |
| provider_email | string | Optional | provider_email |
| display_name | string | Optional | display_name |
| avatar_url | string | Optional | avatar_url |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/linked-accounts/complete \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "example_state",
"provider": "example_provider",
"provider_account_id": "example_provider_account_id"
}'Response Example
{
"status": "ok"
}POST /api/v1/auth/linked-accounts/initiate
/api/v1/auth/linked-accounts/initiateInitiate Link
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | Provider |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/linked-accounts/initiate \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "example_provider"
}'Response Example
{
"auth_url": "example",
"state": "example"
}DELETE /api/v1/auth/linked-accounts/{provider}
/api/v1/auth/linked-accounts/{provider}Unlink Account
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | provider |
Request Example
curl -X DELETE https://api.alterlab.io/api/v1/auth/linked-accounts/<provider> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"message": "example",
"remaining_methods": 0
}POST /api/v1/auth/login
/api/v1/auth/loginLogin
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | ||
| password | string | Required | Password |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/login \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email",
"password": "example_password"
}'Response Example
{
"id": "example",
"email": "example",
"name": "example",
"email_verified": true,
"is_admin": true,
"session_token": "example"
}GET /api/v1/auth/login-history
/api/v1/auth/login-historyGet Login History
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | Optional | limitDefault: 10 |
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/login-history \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}GET /api/v1/auth/me
/api/v1/auth/meGet Current User
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/me \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"id": "example",
"email": "example",
"name": "example",
"avatar_url": "example",
"created_at": "example",
"subscription_tier": "example"
}POST /api/v1/auth/oauth-signin
/api/v1/auth/oauth-signinOauth Signin
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | ||
| name | string | Optional | name |
| provider | string | Required | Provider |
| provider_account_id | string | Required | Provider Account Id |
| avatar_url | string | Optional | avatar_url |
| device_fingerprint | object | Optional | Device fingerprint data collected from client. |
| attribution | object | Optional | First-touch attribution data captured at signup. All fields are optional strings — the frontend sends whatever it has. Values are sanitized (HTML stripped, max 500 chars each). |
| anonymous_id | string | Optional | anonymous_id |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/oauth-signin \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email",
"provider": "example_provider",
"provider_account_id": "example_provider_account_id"
}'Response Example
{
"id": "example",
"email": "example",
"name": "example",
"email_verified": true,
"is_admin": true,
"session_token": "example"
}POST /api/v1/auth/onboarding-event
/api/v1/auth/onboarding-eventRecord Onboarding Event
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| event | "completed" | "skipped" | Required | Event |
| at_step | integer | Optional | at_step |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/onboarding-event \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "..."
}'Response Example
{
"status": "ok"
}GET /api/v1/auth/profile
/api/v1/auth/profileGet Profile
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/profile \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"id": "example",
"email": "example",
"name": "example",
"avatar_url": "example",
"created_at": "example",
"subscription_tier": "example"
}PATCH /api/v1/auth/profile
/api/v1/auth/profileUpdate Profile
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | name |
string | Optional |
Request Example
curl -X PATCH https://api.alterlab.io/api/v1/auth/profile \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"id": "example",
"email": "example",
"name": "example",
"avatar_url": "example",
"created_at": "example",
"subscription_tier": "example"
}POST /api/v1/auth/reset-password
/api/v1/auth/reset-passwordReset Password
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| token | string | Required | Token |
| new_password | string | Required | New Password |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/reset-password \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token": "example_token",
"new_password": "example_new_password"
}'Response Example
{
"message": "example"
}GET /api/v1/auth/security-overview
/api/v1/auth/security-overviewGet Security Overview
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/security-overview \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"primary_method": "example",
"has_password": true,
"linked_providers": [],
"can_add_password": true,
"email_verified": true
}POST /api/v1/auth/send-verification-code
/api/v1/auth/send-verification-codeSend Verification Code
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/send-verification-code \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email"
}'Response Example
{
"status": "ok"
}GET /api/v1/auth/sessions
/api/v1/auth/sessionsGet Sessions
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/sessions \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}DELETE /api/v1/auth/sessions
/api/v1/auth/sessionsRevoke All Sessions
Request Example
curl -X DELETE https://api.alterlab.io/api/v1/auth/sessions \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}GET /api/v1/auth/sessions/validate
/api/v1/auth/sessions/validateValidate Session
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/sessions/validate \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}DELETE /api/v1/auth/sessions/{session_id}
/api/v1/auth/sessions/{session_id}Revoke Session
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| session_id | string | Required | session_id |
Request Example
curl -X DELETE https://api.alterlab.io/api/v1/auth/sessions/<session_id> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}PATCH /api/v1/auth/sessions/{session_id}/activity
/api/v1/auth/sessions/{session_id}/activityUpdate Session Activity
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| session_id | string | Required | session_id |
Request Example
curl -X PATCH https://api.alterlab.io/api/v1/auth/sessions/<session_id>/activity \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}POST /api/v1/auth/signup
/api/v1/auth/signupSignup
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/signup \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}POST /api/v1/auth/unlock-welcome-bonus
/api/v1/auth/unlock-welcome-bonusUnlock Welcome Bonus
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/unlock-welcome-bonus \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}POST /api/v1/auth/verify-code
/api/v1/auth/verify-codeVerify Code
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | ||
| code | string | Required | Code |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/verify-code \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email",
"code": "example_code"
}'Response Example
{
"success": true,
"message": "example",
"credits_awarded": 0
}POST /api/v1/auth/welcome-shown
/api/v1/auth/welcome-shownMark Welcome Shown
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/welcome-shown \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"status": "ok"
}GET /api/v1/auth/welcome-status
/api/v1/auth/welcome-statusGet Welcome Status
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/welcome-status \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"reduced": true,
"full_bonus": 0,
"received": 0,
"remaining": 0,
"sibling_accounts": [],
"can_unlock": true
}POST /api/v1/auth/email-code/send
/api/v1/auth/email-code/sendSend Email Code
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/email-code/send \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email"
}'Response Example
{
"message": "example",
"expires_in_minutes": 0
}POST /api/v1/auth/email-code/verify
/api/v1/auth/email-code/verifyVerify Email Code
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | ||
| code | string | Required | Code |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/email-code/verify \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "example_email",
"code": "example_code"
}'Response Example
{
"id": "example",
"email": "example",
"name": "example",
"email_verified": true,
"is_admin": true,
"session_token": "example"
}POST /api/v1/auth/enterprise-accept
/api/v1/auth/enterprise-acceptAccept an enterprise invite and activate account
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| token | string | Required | Enterprise invite token from the magic link |
| password | string | Required | Password to set for the account (validated against NIST SP 800-63B rules) |
| attribution | object | Optional | attribution |
| last_touch | object | Optional | last_touch |
| anonymous_id | string | Optional | anonymous_id |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/enterprise-accept \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token": "example_token",
"password": "example_password"
}'Response Example
{
"id": "example",
"email": "example",
"name": "example",
"email_verified": true,
"is_admin": true,
"session_token": "example"
}GET /api/v1/auth/enterprise-invite/{token}
/api/v1/auth/enterprise-invite/{token}Look up enterprise invite metadata
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| token | string | Required | token |
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/enterprise-invite/<token> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"client_email": "example",
"org_name": "example",
"is_valid": true
}POST /api/v1/auth/exchange-session-token
/api/v1/auth/exchange-session-tokenExchange Session Token
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| session_token | string | Required | Session Token |
Request Example
curl -X POST https://api.alterlab.io/api/v1/auth/exchange-session-token \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_token": "example_session_token"
}'Response Example
{
"id": "example",
"email": "example",
"name": "example",
"email_verified": true,
"is_admin": true,
"session_token": "example"
}GET /api/v1/auth/identity
/api/v1/auth/identityGet Api Key Identity Endpoint
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/identity \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"key_id": "example",
"key_type": "example",
"principal_id": "example",
"organization_id": "example"
}GET /api/v1/auth/principal
/api/v1/auth/principalGet Api Key Principal Endpoint
Request Example
curl -X GET https://api.alterlab.io/api/v1/auth/principal \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
{
"auth_type": "example",
"principal_id": "example",
"user_id": "example",
"organization_id": "example",
"key_type": "example",
"key_id": "example"
}