Open Inventory / Docs
EndpointsAuthenticationAuthLogin

Sign in a native client with a local account

The API runs on your application instance. Schemas and field names come directly from the OpenAPI specification. Session-authenticated requests require a session on that instance.

POST
/auth/login

Request Body

application/json
  1. body
email*string
Formatemail
Lengthlength <= 320
password*string
Formatpassword
Length1 <= length <= 72
deviceName?string
Length1 <= length <= 80
Default"iOS"
organizationId?string

Optional membership to select when signing in. The first membership is used when omitted.

Formatuuid

Response Body

Signed in and issued a revocable user-bound bearer token

application/json
  1. response
token*string

Opaque secret returned only once.

user*
scopes*array<>
expiresAt*string
Formatdate-time
organization*
organizations*array<>
Items1 <= items
Example Request
curl -X POST 'https://inventory.example.com/api/v1/auth/login' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "password": "pa$$word"}'
Example Response
{  "token": "string",  "user": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "email": "user@example.com",    "role": "editor"  },  "scopes": [    "read"  ],  "expiresAt": "2019-08-24T14:15:22Z",  "organization": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "slug": "string",    "role": "string",    "roleName": "string",    "isReadOnly": true,    "allowNegativeStock": true,    "canManage": true  },  "organizations": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "slug": "string",      "role": "string",      "roleName": "string",      "isReadOnly": true,      "allowNegativeStock": true,      "canManage": true    }  ]}