Skip to content

Sign in

POST
/v1/auth/login
curl --request POST \
--url https://api.emite.cr/v1/auth/login \
--header 'Content-Type: application/json' \
--data '{ "email": "ventas@emite.cr", "password": "S3guroPass!" }'

Exchanges the email and password for a session token (JWT), returned in the body and in the X-Session-Token header. When the account has two-factor authentication enabled, it returns an MFA challenge instead of the token (mfaRequired: true): complete it at POST /v1/auth/2fa/challenge/verify. The token carries the company when the person belongs to exactly one; with several, choose one with POST /v1/auth/switch-tenant. 401 INVALID_CREDENTIALS for a wrong password or an email with no active account. At most 10 requests per minute per client IP: 429 AUTH_RATE_LIMITED, with Retry-After.

Media typeapplication/json
object
email
required

Email of the account, compared case-insensitively.

string
Example
ventas@emite.cr
password
required

Password of the account. A wrong password and an email with no active account both answer 401 INVALID_CREDENTIALS, so the response never says which of the two failed.

string
Example
S3guroPass!

A session token (LoginResponseDto) or, when the account has two-factor authentication, the challenge that completes the sign-in (MfaRequiredResponseDto, with mfaRequired: true and no accessToken).

Media typeapplication/json
One of:
object
accessToken
required

The session token, a signed JWT: send it as Authorization: Bearer <accessToken>. It acts for the person, in the company it names when it names one (currentTenantId in GET /v1/auth/me). The same token comes in the X-Session-Token response header.

string
tokenType
required

Always Bearer: the scheme to send the token with in the Authorization header.

string
Allowed values: Bearer
expiresIn
required

Remaining life of this token: whole seconds followed by s ("28800s" = 8 hours). It never reaches past the maximum of the session, which counts from the sign-in, so a re-issued token (switching company, renewing) lives less. Under a company inactivity rule it also ends that many minutes after it was issued, unless it is renewed with POST /v1/auth/sessions/renew.

string
expiresAt
required

The instant this token expires (ISO 8601, UTC): expiresIn as a date.

string format: date-time
passwordChangeSuggested

Present, and true, only in the answer of POST /v1/auth/login, when the password that just signed in does not meet the rule a new password must meet today (12 to 72 characters, nothing of the person, hard to guess: see POST /v1/auth/signup). A suggestion to change it, never a refusal: the sign-in went through.

boolean
Example
{
"tokenType": "Bearer",
"expiresIn": "28800s",
"expiresAt": "2026-10-22T22:30:00.000Z",
"passwordChangeSuggested": true
}