Manual
CLI
API
Log in Get started free

Log in

Exchanges an email address and password for a session token.

Exchanges an email address and password for a session token.

HTTP
POST /auth/login

Access: No token needed.

Request body #

JSON.

FieldTypeRequiredDescription
emailstringyesThe email address of the account. Not case sensitive.
passwordstringyesThe password.
codestringwhen two-factor authentication is onA 6-digit code from the authenticator app, or a recovery code. Leave it out first: the answer mfa_required says it is needed.
JSON
{ "email": "ada@example.com", "password": "correct horse battery" }

Response 200 #

A session was started.

JSON
{
  "token": "9f2c...e1",
  "expiresAt": "2026-10-23T09:30:00+00:00",
  "user": {
    "id": "0197a3c2-5b1e-7c4a-9d2f-3e8b6a1f0c55",
    "email": "ada@example.com",
    "name": "Ada Lovelace",
    "locale": "en-GB",
    "mfaSetupRequired": false
  }
}

Response fields #

FieldTypeDescription
tokenstringThe session token. Send it as Authorization: Bearer <token>. It is shown only once.
expiresAtstringWhen the token expires, as an ISO 8601 timestamp. A token lasts 7 days.
user.idstringThe id of the user.
user.emailstringThe email address.
user.namestringThe name.
user.localestring or nullThe interface language the user picked, for example en-GB, or null until they pick one.
user.mfaSetupRequiredbooleantrue when the organisation requires two-factor authentication and the account has none. Every route except the ones for the account and two-factor setup answers 403 mfa_setup_required until it is set up.

Errors #

StatuserrorWhen
401invalid_credentialsThe email address or the password is wrong.
401mfa_requiredThe account uses two-factor authentication and code is missing. The password was right.
401invalid_codecode is wrong or was used already.
422invalid_requestemail or password is missing.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.