Skip to main content
Axottle’s administrative API uses session tokens, so you log in with your username and administrator password, you get a token, and you pass it on every subsequent request.
For whom: developer and administrator. Required rights: Panel administrator account.

Two Ways to Transfer a Session

For integrations, use Bearer – it is not dependent on cookies and is not subject to browser checks.
Requests with cookies that change data (POST, PUT, PATCH, DELETE) are verified by the source: the header Origin or Referer must match the address of the panel. Requests with Authorization: Bearer do not pass this check and do not break because of it.

Entry and receipt of the token

Send your login and password to the login method:
The response returns the session token. Save it, it will be required for all secure methods. In the same response, the browser is given a session cookie.
If the account has 2FA enabled, the first request will return 401 with the code TOTP_REQUIRED. Repeat the request by adding the totp_code field to the body.
An account without a password (entry only through Telegram) cannot enter through this method - it is logged in via Telegram in the browser, see Login via Telegram.
Never transfer a password or token in a URL or query settings and save them in shared logs. Only transfer secrets to the query body or Authorization header.

Use of the token

Transfer the token in the title Authorization:
You can check the current session using the “who am I” method:

Conclusion of the session

After the release, the token becomes invalid.

Authentication errors

Resetting the administrator password

If access to the panel is lost, the password is reset from the command line on the server (the action requires permissions on the server and is recorded in the audit):
More information: CLI.

Verification

A request to GET /api/v1/auth/me with your token returns the current administrator data and the status of 200.

Rollback

Tokens are recalled by an exit (logout) or reset of the account password, after which the previous sessions cease to operate.