Skip to main content
POST
Log in
Every authenticated route takes one credential in the Authorization header: an API key, which you create once on your account page, or a login token, which this endpoint returns in exchange for your password. If you are writing a program, use a key and skip this page; the Authentication overview compares the two. A login token is valid for 30 days, after which it is rotated in place (see Token rotation).

Log in

POST /user/login

Request

string
required
Account username (or email).
string
required
Account password.

Response

The token is returned both as data.user.auth and as a signed auth cookie (Set-Cookie). For most server-side integrations you’ll want to capture data.user.auth and discard the cookie.
See User in the OpenAPI schema for every field.

Error responses

Authorizing requests

Pass the token from data.user.auth on every subsequent request. An API key goes in exactly the same place. Three header / payload formats are accepted, in this order of preference:
If no credential is provided, or it is unknown, revoked or expired, the server responds with 401 InvalidCredentials (an expired API key says 401 ApiKeyExpired). A credential refused for where the request came from, or for a frozen account, is a 403; the API keys page lists every message.

Token rotation

Authenticated requests with tokens older than 30 days automatically rotate to a new token. When this happens, the new token is returned in the X-Auth-Token response header (and as an updated signed auth cookie). The old token stops working immediately; the request that triggered the rotation still succeeds, but every later request with the old value returns 401. Long-lived integrations should watch for this header and persist the new value, or simply log in again on any 401.

Logging out

POST /user/logout invalidates the token used to make the call. Subsequent requests with that token return 401; other tokens held for the same account, and API keys, are unaffected. Logout takes a login token; a key is refused here with 403 LoginSessionRequired.

Two-factor authentication

Two-factor authentication protects withdrawals, not login. POST /user/login never requires a code, regardless of the account’s 2FA setting.

Body

application/json
username
string
required
password
string<password>
required

Response

Login successful. The auth token is returned both as data.user.auth and as a signed auth cookie.

data
object