TaxMaxi supports OAuth for providers like Coinbase. Two flows are available: a browser redirect flow for web applications, and a polling flow for CLI and headless environments where you cannot intercept a redirect. Both flows start atDocumentation Index
Fetch the complete documentation index at: https://docs.taxmaxi.com/llms.txt
Use this file to discover all available pages before exploring further.
GET /auth/authorize/:provider and end with a session token you use to authenticate all subsequent requests.
Browser redirect flow
In a browser context, you redirect the user to the provider’s authorization page and handle the callback when they return.Get the authorization URL
Call
GET /auth/authorize/:provider to retrieve the URL to redirect your user to. Save the state value — you will need it to verify the callback.Redirect the user
Send the user to the
redirectUrl. After they grant access, the provider redirects them to /auth/callback/coinbase with code and state query parameters.GET /auth/authorize/:provider
Returns an authorization URL and astate value. Redirect the user to redirectUrl to start the OAuth flow.
Path parameters
The OAuth provider to authorize with, e.g.
coinbase.Query parameters
An optional frontend-relative path to navigate to after the browser-based OAuth flow completes (e.g.
/dashboard).Response — 200 OK
The full URL to redirect the user to for OAuth authorization.
A CSRF-protection token. In the polling flow, use this value as the
id when calling GET /auth/oauth/:id.Errors
| Status | Error | Description |
|---|---|---|
| 404 | ProviderNotFoundError | The specified provider is not enabled. The provider field confirms which one was requested. |
GET /auth/callback/:provider
Handles the OAuth provider redirect. The provider calls this endpoint automatically with acode and state after the user authorizes. It exchanges the code for tokens and returns a session.
Path parameters
The OAuth provider, e.g.
coinbase.Query parameters
The authorization code from the OAuth provider.
The state parameter for CSRF validation. Must match the value returned by
/auth/authorize/:provider.An error code from the provider if authorization failed.
A human-readable description of the provider error.
Response — 200 OK
Same asPOST /auth/login: returns token, user, provider, and expiresAt.
Errors
| Status | Error | Description |
|---|---|---|
| 400 | OAuthStateInvalidError | The state parameter does not match. Restart the OAuth flow. |
| 401 | ProviderAuthError | The OAuth provider rejected the authorization code. |
| 404 | ProviderNotFoundError | The specified provider is not enabled. |
Polling flow (CLI and headless environments)
When you cannot intercept a browser redirect — for example in a terminal CLI — show the user theredirectUrl and poll for completion using the state value as the session ID.
Get the authorization URL
Call
GET /auth/authorize/coinbase and display the redirectUrl to the user so they can open it in a browser. Record the state value.User authorizes in the browser
The user opens the URL, grants access, and the provider redirects back to TaxMaxi automatically.
GET /auth/oauth/:id
Returns the current status of an OAuth session. Use this to poll for completion in headless or CLI flows.Path parameters
The OAuth session ID. This is the
state value returned by GET /auth/authorize/:provider.Response — 200 OK
The OAuth session ID.
The OAuth provider for this session.
The current session status. One of:
pending— the user has not yet authorized in the browsercompleted— authorization succeeded;sessionTokenanduserIdare populatedfailed— the authorization was rejected or an error occurredexpired— the session window has passed; restart the flow
The OAuth authorization URL, if still available.
The session bearer token. Only present when
status is "completed". Use this as Authorization: Bearer <sessionToken> on protected requests.The authenticated user’s ID. Only present when
status is "completed".A human-readable message, present when
status is "failed" or "expired".ISO 8601 timestamp when this OAuth session expires.
Errors
| Status | Error | Description |
|---|---|---|
| 401 | ProviderAuthError | The OAuth provider returned an error for this session. |