Documentation Index

Fetch the complete documentation index at: https://learn.servitly.com/llms.txt

Use this file to discover all available pages before exploring further.

User login (user credentials)

Prev Next
Post
/identity/users/login

Authenticates the user in the DPS by using personal credentials (username and password), and opens a new session.
The tenant is identified by the X-Servitly-Tenant header, while the apiKey query parameter identifies the client application performing the request.

On success the response provides the JWT token to be sent as bearer token on every subsequent authenticated call, its expiration timestamp, and the refreshToken, userId and tenantId required to renew the token once expired.
The optional devices node allows mobile clients to register the device that will receive push notifications.

For security reasons unknown users and wrong passwords are reported with the same 401 error.

Header parameters
X-Servitly-Tenant
stringRequired

The name of the tenant (e.g. acme).

Query parameters
apiKey
stringRequired

The API KEY identifying the client.

Example{{apiKey}}
Body parameters

The login credentials and optional device details.

Expand All
object

The payload message for login requests.

email
string

The user registration email address.

Example{{userEmail}}
password
string

The user private password.

Example{{userPassword}}
devices
Array of object | null
object

Details about the device on which the API client is currently running.

deviceId
string

The unique identifier which is used to match the device among different logins.

os
string

The device operating system.

ExampleAndroid_9, iOS_11
model
string

The mobile device model.

ExampleONEPLUS A6013
platform
string

The mobile platform name.

Valid values[ "Android", "iOS" ]
notificationDeviceId
string

The device notification identifier obtained from the platform provider during the device registration for notifications.

Responses
200

Authentication succeeded.

object

The response message for login requests.

token
string

The JWT token to include as the bearer token in authenticated requests.

Example661fd29342541977c4002ec7...
tokenExpirationTimestamp
integer (int64)

The timestamp when the token will expire and must be refreshed.
Generally one hour after issuance, but this may vary over time.

Example1578438000000
refreshToken
string

The refresh token used to request a new JWT token when the current one expires.

Examplecd2bd3a0-861d-4798-8fd6-2a2a99fb92e8
userId
string

The id of the authenticated user.

Example6616689a0de6d87b47cd6308
tenantId
string

The id of the tenant.

Example661533a57bba156cf6e8d04b
401

Invalid credentials, user not authenticated.

object
message
string

The error response.

ExampleInvalid credentials
500

Internal server error.

object
message
string

The error response.

ExampleInternal Server Error