Skip to main content

Authentication

In the Auth section, we provide detailed guides for managing user authentication, log out, and refreshing tokens. These endpoints play a crucial role in securing access to our platform. By following the documentation for these endpoints, you will gain a comprehensive understanding of how to authenticate users, safely log them out, and refresh their authentication tokens. Let's dive into the details of each endpoint and explore the authentication capabilities of our platform.


Authenticate using email/password

This endpoint allows users to authenticate using their email and password.

Endpoint: /api/v1/auth/login Method: POST

Request Body

Media Type: application/json

Body:

{
"email": "string",
"password": "string"
}

Responses

200 (OK) This response indicates successful authentication and returns an access token.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:29:46.402Z",
"data": {
"access_token": "string",
"expires_in": 0,
"refresh_expires_in": 0,
"refresh_token": "string",
"token_type": "string",
"id_token": "string",
"not-before-policy": 0,
"session_state": "string",
"scope": "string",
"error": "string",
"error_description": "string",
"error_uri": "string"
},
"version": "string"
}

401 (Unauthorized) This response is returned if the authentication attempt fails due to invalid credentials.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:29:46.402Z",
"data": "string",
"version": "string"
}

404 (Not Found) This response is returned if the requested endpoint is not found.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:29:46.403Z",
"data": "string",
"version": "string"
}

412 (Precondition Failed) This response is returned if a precondition for the request is not met.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:29:46.403Z",
"data": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"version": "string"
}

500 (Internal Server Error) This response is returned if an unexpected internal server error occurs while processing the request.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:29:46.403Z",
"data": "string",
"version": "string"
}

Refresh Token

This endpoint allows users to refresh their authentication token.

Endpoint

Endpoint: /api/v1/auth/refresh Method: POST

Request Body

Media Type: application/json

Body:

{
"refreshToken": "string"
}

Responses

200 (OK) This response indicates successful token refresh and returns a new access token.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:35:16.059Z",
"data": {
"access_token": "string",
"expires_in": 0,
"refresh_expires_in": 0,
"refresh_token": "string",
"token_type": "string",
"id_token": "string",
"not-before-policy": 0,
"session_state": "string",
"scope": "string",
"error": "string",
"error_description": "string",
"error_uri": "string"
},
"version": "string"
}

401 (Unauthorized) This response is returned if the token refresh request is unauthorized.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:35:16.060Z",
"data": "string",
"version": "string"
}

404 (Not Found) This response is returned if the requested endpoint is not found.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:35:16.060Z",
"data": "string",
"version": "string"
}

412 (Precondition Failed) This response is returned if a precondition for the request is not met.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:35:16.060Z",
"data": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"version": "string"
}

500 (Internal Server Error) This response is returned if an unexpected internal server error occurs while processing the request.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:35:16.060Z",
"data": "string",
"version": "string"
}

Logout

This endpoint allows users to log out and invalidate their authentication token.

Endpoint

Endpoint: /api/v1/auth/logout Method: POST

Body:

{
"refreshToken": "string"
}

Responses

200 (OK) This response indicates successful logout and token invalidation.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:39:21.904Z",
"data": {},
"version": "string"
}

401 (Unauthorized) This response is returned if the logout request is unauthorized.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:39:21.904Z",
"data": "string",
"version": "string"
}

404 (Not Found) This response is returned if the requested endpoint is not found.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:39:21.904Z",
"data": "string",
"version": "string"
}

412 (Precondition Failed) This response is returned if a precondition for the request is not met.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:39:21.904Z",
"data": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"version": "string"
}

500 (Internal Server Error) This response is returned if an unexpected internal server error occurs while processing the request.

Body:

{
"message": "string",
"timestamp": "2023-09-28T16:39:21.905Z",
"data": "string",
"version": "string"
}