Need help managing tokens via API

I have an application that pulls data from our Fibery database, I would like to rotate the API token on a regular basis and would prefer to do this via the API rather than the web interface. I have found the endpoints to call but they do not seem to be working.

If I log in through a browser, and use the developer console to send a POST to /api/tokens, it does create a new API token. If I use Postman to try this same I get the following error:
{“message”: “Invalid value "undefined" for header "cookie"”}

The API documentation says these endpoints require you to be authenticated with a browser cookie or with an already existing token. I am passing the API token that I generated through the web browser and this token works for all other commands (i.e., getting and creating entries).

Any help, or examples of using the following token management endpoints would be greatly appreciated.

  • GET /api/tokens — lists all access tokens that were given to current user
  • POST /api/tokens — creates new token for current user
  • DELETE /api/tokens/:token_id — deletes token by id

Hello, indeed api/tokens endpoint for now works only when cookie is provided. Your use case is pretty valid, will discuss with devs what can we do about it.