Skip to main content

POST /api/userAuth/login

Validates the user’s credentials and returns a short-lived JWT access token. A refresh token is also issued to keep the session alive without requiring the user to log in again.

Required Header

x-api-key: your pk_live_… key.

Request Body

string
required
The user’s registered email address.
string
required
The user’s password.

Response Fields

string
Short-lived JWT. Include this in the Authorization: Bearer header for authenticated requests.
string
Human-readable duration until the access token expires (e.g., "15m").
object
The response also includes a token field as a backward-compatibility alias of accessToken. The token alias will be removed in a future release — migrate your clients to accessToken now.

Refresh Token Delivery

The refresh token is issued alongside the access token and delivered differently depending on the client type:
  • Web (browser): issued as an HTTP-only cookie. Your browser stores and sends it automatically — you do not need to handle it manually.
  • Mobile / non-browser: returned in the x-refresh-token response header. Store it securely and include it when calling /api/userAuth/refresh-token.

Code Examples

Success Response

Errors