Authentication
The API uses a personal API key per user, sent as Bearer token. There is no login with username and password, no session and no cookie, so the API cannot be called with the browser login of a user.
Creating a key
- Open API-Schlüssel in the profile menu (
/api-schluessel). - Optional: set an expiry date under Gültig bis. Without a date, the key does not expire.
- Click Schlüssel erstellen.
- Copy the key with Kopieren. It looks like
xtk_...(256 bit random) and is shown only once. Afterwards, only its beginning is visible.
Treat the key like a password: whoever knows it can tip in your name. It works until you revoke, regenerate or delete it.
Sending the key
Send the key in the Authorization header of every call:
curl -H "Authorization: Bearer xtk_..." https://your-site/api/v1/leagues
In the Swagger UI (/api/docs), enter the key with Authorize to try out the calls.
Managing the key
A user has exactly one key. The key page shows when it was created, when it was last used, until when it is valid and its status (Aktiv, Gesperrt or Abgelaufen).
| Action | Effect |
|---|---|
| Sperren (revoke) | Stops the key. The entry stays visible. |
| Neu erzeugen (regenerate) | Replaces the secret and starts the key again. The old key stops working, programs that use it need the new one. |
| Löschen (delete) | Removes the key, so that a new one can be created. |
When a key is refused
All of these get the same 401 answer, so a caller cannot tell them apart:
- unknown keys,
- revoked and expired keys,
- keys of inactive or deleted users,
- keys of users without access to the API.
Ten failed attempts per minute and address answer 429. A valid key is not blocked by failed attempts of others.