token_create
POST/public-api/token/
Authenticate with your username and password to obtain an access token and a refresh token.
How to obtain a token pair
-
Send a
POSTrequest to this endpoint with yourusernameandpassword.Example request body:
"username": "john.doe","password": "ExamplePassword123!" -
Receive a response containing:
access: use this token to authenticate API requests.refresh: use this token to obtain a new token pair when the access token expires.
Example response body:
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.access-token-example","refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.refresh-token-example" -
Use the access token in the
Authorizationheader for protected endpoints.Example header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.access-token-example -
When the access token expires after 15 minutes, use the refresh token at the endpoint
/token/refresh/instead of calling this endpoint again. -
When the refresh token expires after 60 days, authenticate again with your username and password to obtain a new token pair.
Important notes
- Do not use this endpoint repeatedly to get new access tokens, because the number of outstanding tokens is limited.
- Prefer
/token/refresh/to continue an authenticated session. - If too many failed login attempts occur, the endpoint may temporarily return
429 Too Many Requests.
Request
Responses
- 200
- 400
- 401
- 403
- 429
No Content
Unauthorized
Forbidden: Too many outstanding tokens
Too Many Requests: Too many failed login attempts