curl -sS -X PUT 'https://matrix.example.com/_synapse/admin/v1/users/@alice:example.com/admin' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"admin":true}'

Category: Matrix & Synapse

curl -sS -X PUT 'https://matrix.example.com/_synapse/admin/v1/users/@alice:example.com/admin' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"admin":true}'

Grant or revoke server admin rights

Promotes a user to server admin with {"admin":true} or demotes them with {"admin":false}, giving or removing Admin API access. You cannot demote yourself, so always keep a second admin account. This is the API equivalent of register_new_matrix_user -a. Verify with the GET admin endpoint afterwards.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.