Open Inventory / Docs
EndpunkteAuthenticationAuthLogin

Sign in a native client with a local account

Die API läuft auf deiner Anwendungsinstanz. Schemas und Feldnamen stammen unverändert aus der OpenAPI-Spezifikation. Browsergebundene Aufrufe benötigen eine Sitzung auf der Instanz.

POST
/auth/login

Anfrageinhalt

application/json
  1. body
email*string
Formatemail
Längelength <= 320
password*string
Formatpassword
Länge1 <= length <= 72
deviceName?string
Länge1 <= length <= 80
Standard"iOS"
organizationId?string

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

Formatuuid

Antwortinhalt

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<>
Einträge1 <= items
Beispielanfrage
curl -X POST 'https://inventory.example.com/api/v1/auth/login' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "password": "pa$$word"}'
Beispielantwort
{  "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    }  ]}