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.

Renew JWT token

Prev Next
Post
/identity/users/me/renewToken

Renews the JWT token using the Refresh token, User and Tenant Id obtained from the initial login.
Since the JWT token has a limited lifetime (generally one hour, see tokenExpirationTimestamp in the login response), this endpoint keeps the session alive without asking the user for the credentials again.

The response provides a new token together with a new refresh token, which replaces the previous one and must be stored for the next renewal.
A 400 error is returned when the current token has not expired yet.

Security
HTTP
Type bearer
Header parameters
X-Servitly-Tenant
stringRequired

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

Body parameters

The renew token body.

object

The payload message for renew token requests.

refreshToken
string

The refresh token obtained during the user login.

Example{{refreshToken}}
userId
string

The identifier of the user who gained the JWT token initially.

Example{{userId}}
tenantId
string

The id of the tenant.

Example{{tenantId}}
Responses
200

Renew succeeded.

object

The response message for renew token request.

token
string

The new JWT token to be used as bearer token in the 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 to be used to obtain a new JWT token.

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

The id of the authenticated user.

Example6616689a0de6d87b47cd6308
tenantId
string

The id of the tenant.

Example661533a57bba156cf6e8d04b
400

Token cannot be renewed because not yet expired.

401

User not authenticated.

object
message
string

The error response.

ExampleUser not authenticated
403

User not authorized.

object
message
string

The error response.

ExampleUser not authorized
404

Resource was not found.

object
message
string

The error response.

ExampleResource not found
429

API call rate limit exceeded.

object
message
string

The error response.

ExampleAPI call rate limit exceeded
500

Internal server error.

object
message
string

The error response.

ExampleInternal Server Error