Skip to main content

Auth API

All auth endpoints are under /api/v1/auth. Rate limit: 20 requests/minute.

Endpoints


Register

Create a new user account. Sends a verification email.

Request Body

Response 201 Created

Errors


Login

Authenticate and receive JWT access + refresh tokens.

Request Body

Response 200 OK

Token Expiry

Errors


Logout

Revoke the current refresh token (invalidates the session).

Response 200 OK


Verify Email

Confirm an email address using the token from the verification email.

Request Body

Response 200 OK

Errors


Request Password Reset

Send a password reset email.

Request Body

Response 200 OK

Always returns 200 even if the email is not registered (prevents user enumeration).

Confirm Password Reset

Set a new password using the token from the reset email.

Request Body

Response 200 OK

Errors


Refresh Token

Exchange a refresh token for a new access token. The refresh token is rotated on each use.

Request Body

Response 200 OK

Token rotation is enabled — each refresh invalidates the old refresh token and issues a new one.

Errors


Google OAuth

Single sign-on via Google. Redirects through Google’s consent screen and returns tokens on success.

Step 1 — Initiate

Redirect the user’s browser to:
This redirects to Google’s OAuth consent screen.

Step 2 — Callback

After the user approves, Google redirects back to:
On success, the server redirects to the frontend with the access token:
The frontend (AuthCallback page) reads the token from the URL, fetches the user profile, and stores auth state.

New vs Returning Users

  • New user — account is auto-created with auth_provider = "google", no password set
  • Returning user — existing account is found by email and tokens are issued

Using Tokens

Include the access token in the Authorization header for all protected endpoints:
When the access token expires (60 min), call POST /auth/refresh to get a new one. The frontend Axios interceptor handles this automatically.