Question: In the [Matrix](https://matrix.org/) instant messaging protocol, when using the reference implementation of the Matrix server (called `synapse`), there is an [admin API](https://github.com/matrix-org/synapse/blob/master/docs/admin_api/) with functions like [resetting a password](https://github.com/matrix-org/synapse/blob/master/docs/admin_api/user_admin_api.rst#reset-password) for a user etc..

Accessing this requires an [`access_token`](https://matrix.org/docs/spec/client_server/latest#using-access-tokens) "API key" of a server admin user.

How do I get one?

Answer: 
Solution to find your access token:

1. Log in to the account you want to get the access token for. Click on the name in the top left corner, then "Settings".
2. Click the "Help & About" tab (left side of the dialog).
3. Scroll to the bottom and click on `<click to reveal>` part of Access
Token.
4. Copy your access token to a safe place.
These `access_token` API keys were listed in the [Riot](https://riot.im/) web application until not too long ago, somewhere under the account settings. In the newest version, I could no longer find them there.

So instead, I use a technique I found [here](https://github.com/matrix-org/synapse/issues/1707#issuecomment-405455882), which is basically a login procedure done with `curl`. The server's answer will contain the `access_token`.

1. Find out the Matrix user ID and password of a server admin user. The username has to be in the fully qualified form, for example `@user:example.com`.
2. Execute the following command on a Linux-based system that has `curl` installed. Of course, supply the address of you Matrix server for `example.com`, and also your Matrix user ID and password.

```
curl -XPOST \
  -d '{"type":"m.login.password", "user":"<userid>", "password":"<password>"}' \
  "https://example.com:8448/_matrix/client/r0/login"

```