Skip to main content
TaxMaxi uses session tokens for authentication. When you log in, the API returns a token that you attach to every subsequent request as a Bearer token in the Authorization header. Tokens have an expiration time and can be refreshed without logging in again. For Coinbase integration, TaxMaxi also supports an OAuth flow that the CLI handles automatically, but you can drive it yourself via the API if needed.

Register

Send POST /auth/register with your email, a password of at least 8 characters, and an optional display name:
The request body fields are: A successful 201 response starts the email verification flow:
If the email is already registered, you receive a 409 error. If the password is too short or weak, you receive a 400 error with a list of unmet requirements.

Verify your email

After registration, TaxMaxi sends a verification code to your email. Submit it to POST /auth/verify-email:
A successful response returns a redirectTo path indicating your account is verified and you can proceed to log in. If the code is invalid or has expired, you receive a 400 error. To resend a code, call POST /auth/resend-verification with no body.
You cannot log in with your local credentials until your email is verified. Attempting to do so returns a 403 response indicating verification is required.

Log in

Authenticate with POST /auth/login. For a local (email and password) account, set provider to "local" and pass your credentials in the credentials object:
A successful response:

Authenticate requests

Pass the session token as a Bearer token on every request that requires authentication:
All protected endpoints return 401 Unauthorized if the token is missing, invalid, or expired.

Refresh a session

To extend a session without logging in again, call POST /auth/refresh while you still have a valid token:
The response includes a new token and updated expiresAt. Replace your stored token with the new one.

OAuth with Coinbase

To connect a Coinbase account, TaxMaxi uses an OAuth flow. The easiest way to run it is with the CLI:
If you need to drive the flow from your own application:
  1. Call GET /auth/authorize/coinbase to get an authorization URL:
  1. Redirect your user to redirectUrl.
  2. After the user authorizes, poll GET /auth/oauth/:id (where :id is the OAuth session identifier from the authorization response) to check the flow status:
The status field cycles through "pending", "completed", "failed", or "expired". When status is "completed", use the sessionToken as your Bearer token for subsequent requests.

Log out

Invalidate the current session with POST /auth/logout:

Error reference