Refresh token

Refresh Token

The "Refresh Token" endpoint allows a user to generate new access and refresh tokens by providing a valid refresh token. These tokens are essential for authenticating and authorizing API requests.

Authentication

  • Include your x-api-key The API key provided by GenLogs. This header must be included in the request.

Endpoint

Request Parameters

  • refresh_token (string, required): The previously created valid refresh token.

Response

  • 200 OK: Successfully generated and returned the access and refresh tokens.

  • 401 Unauthorized: If the provided email, and password, resulting in a failure to create the tokens.

  • 500 Internal Server Error: If an error occurs on the server during token creation.

Response Body

  • access_token_data (TokenSchema): The schema representing the access token and its expiration.

    • token (string): The access token string used for authentication or authorization.

    • expires (datetime): The datetime when the access token will expire.

  • refresh_token_data (TokenSchema): The schema representing the refresh token and its expiration.

    • token (string): The refresh token string used for obtaining a new access token.

    • expires (datetime): The datetime when the refresh token will expire.

  • user_id (string): The ID of the user for whom the tokens were created.

Request Example:

Get the AccessToken And Refresh Token

post
Query parameters
refresh_tokenstringRequired

The previously created valid refresh token

Header parameters
acceptstringRequired

Specifies the format of the response.

Default: application/jsonExample: application/json
x-api-keystringRequired

API key for authentication

Example: [x-api-key]
Responses
chevron-right
200

Successful Response

application/json
access_token_dataobject · access_token_dataRequired
refresh_token_dataobject · refresh_token_dataRequired
user_idstringRequired
company_idintegerRequired
post
/token/refresh

Last updated