Nimbu Developer Docs
ReferenceCustomer Sessions

Login customer

POST
/customers/login

Authenticates a customer with credentials and returns a session token. A customer with two-factor authentication also needs a code, in the Nimbu-Two-Factor header or as two_factor_code: without a valid one the answer is 401 with code 210, and 211 once locked out after too many wrong codes. 503 when the code cannot be checked right now (2FA customers only): retry later.

Authorization

AuthorizationBearer <token>

Personal access token tied to a user account. Requires the X-Nimbu-Site header to scope requests.

In: header

X-Nimbu-Site<token>

Identifier of the site context when authenticating with a personal access token.

In: header

Header Parameters

X-Nimbu-Site*string

Site identifier

Nimbu-Two-Factor?string

Two-factor code (TOTP or backup code) for a customer with 2FA; X-Nimbu-Two-Factor works too

Request Body

application/json

Customer login payload

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/customers/login" \  -H "X-Nimbu-Site: string" \  -H "Content-Type: application/json" \  -d '{    "username": "user@example.com",    "password": "string"  }'
{
  "id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "firstname": "string",
  "lastname": "string",
  "email": "string",
  "language": "string",
  "number": "string",
  "slug": "string",
  "status": "string",
  "groups": [
    "string"
  ],
  "url": "http://example.com",
  "confirmation_token": "string",
  "last_activity_at": "2019-08-24T14:15:22Z",
  "roles": [
    "string"
  ],
  "session_token": "string"
}
Empty
Empty