For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create token

Create Access Token

The "Create Access Token" endpoint allows a user to generate new access and refresh tokens by providing their email and password. 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

Credentials must be provided in the JSON request body.

Send email and password in a JSON body with the Content-Type: application/json header. No URL-encoding of special characters is needed (e.g. 1234+ can be sent as-is).

curl -X POST 'https://api.genlogs.io/auth/token/'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-H 'x-api-key: {your_api_key}'
-d '{"email": "{email}", "password": "{password}"}'

Body schema:

Parameters

  • email (string, required): The email address of the user requesting the tokens.

  • password (string, required): The password of the user for authentication.

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

Note: The refresh token is not usable at his time. Please create a new token after your original access token has expired

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

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

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

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

    • token (string): The refresh token string used to obtain a new access token.

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

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

  • company_id (int): The ID of the company associated with the authenticated user.

  • customer_name (string): The name of the customer associated with the authenticated user.

Request Example:

Create access and refresh tokens

post

Create and return new access and refresh tokens for a user based on their email and password.

Query parameters
emailstring · emailRequired

Email of the user requesting tokens.

passwordstring · passwordRequired

Password of the user requesting tokens.

Responses
200

Access and refresh tokens created successfully.

application/json
user_idintegerRequired
company_idinteger · nullableOptional
customer_namestring · nullableOptional
post/auth/token

Last updated