Skip to content

Auth API

Create a new user and organization.

{
"email": "user@example.com",
"password": "SecurePassword123!",
"name": "John Doe",
"organization_name": "My Company",
"organization_website": "https://example.com" // optional
}

Authenticate with email and password.

{
"email": "user@example.com",
"password": "SecurePassword123!"
}

Exchange refresh token for new access/refresh tokens.

{
"refresh_token": "eyJ..."
}

Get current user and organization. Requires authentication.

{
"user": {
"id": "uuid",
"email": "user@example.com",
"name": "John Doe",
"avatar_url": null,
"role": "owner",
"needs_org_setup": false,
"has_password": true,
"linked_providers": ["google"]
},
"organization": {
"id": "uuid",
"name": "My Company",
"slug": "my-company-abc123",
"website": "https://example.com",
"plan": "free"
}
}

Update current user profile. Requires authentication.

{
"name": "Jane Doe",
"avatar_url": "https://example.com/avatar.jpg"
}

Change password. Requires authentication.

{
"current_password": "OldPassword123!",
"new_password": "NewPassword456!"
}

Returns 204 No Content on success.

Logout (client should discard tokens). Requires authentication.

Returns 204 No Content.

Check if initial platform setup is needed. Public endpoint.

{
"needs_setup": true,
"has_users": false
}

Redirect to Google OAuth login page. Returns 302 Redirect.

OAuth callback handler. Redirects to frontend with tokens:

{frontend_url}/auth/callback?access_token=...&refresh_token=...

Initiate Google account linking. Requires authentication.

{
"redirect_url": "https://accounts.google.com/..."
}

Unlink OAuth provider. Requires authentication.

Returns 204 No Content.

Complete organization setup for OAuth users. Requires authentication.

{
"organization_name": "My Company",
"organization_website": "https://example.com" // optional
}