curl -sS 'https://matrix.example.com/_matrix/client/v3/account/whoami' -H "Authorization: Bearer $ACCESS_TOKEN"

Category: Matrix & Synapse

curl -sS 'https://matrix.example.com/_matrix/client/v3/account/whoami' -H "Authorization: Bearer $ACCESS_TOKEN"

Verify an access token is valid

Returns the user ID and device ID the token belongs to, or an M_UNKNOWN_TOKEN error if it is expired or revoked. The first debugging step when API calls suddenly return 401. Tokens can be invalidated by password resets, logouts, or admin deactivation. The access token comes from an admin user's account settings.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.