Skip to content

Token authentication

A token is created every time you log in. If necessary, it can be created via a request:

POST /api/tokens

For requests, the token, regardless of the generation method, can be sent in the following ways:

  • In cookies:
    curl --location '/api/users/current' --header 'Cookie: auth_token={jwt}'
    
  • In the Authorization header:
    curl --location '/api/users/current' --header 'Authorization: Bearer {jwt}'
    
  • In the X-Token header:
    curl --location '/api/users/current' --header 'X-Token: {value}'
    

Important

In cookies and in the Authorization header, the token is sent in JWT format. This format is used only during login and token creation. In all other cases, you must use the value value of the received token model in the X-Token header.