# Grant\_Admin / Revoke\_admin via API heeft herziening nodig

**URL:** <https://meta.discourse.org/t/grant-admin-revoke-admin-through-api-needs-revision/169559>\
**Category:** Bug\
**Created:** [8 november 2020 om 19:45 UTC](https://meta.discourse.org/t/grant-admin-revoke-admin-through-api-needs-revision/169559 "2020-11-08T19:45:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [9 november 2020 om 22:34 UTC](https://meta.discourse.org/t/grant-admin-revoke-admin-through-api-needs-revision/169559/2 "2020-11-09T22:34:49Z")

</div>

> [@Kimberly\_Boynton](#):
>
> because revoke absolutely doesn’t need one.

I’ve just tested this out on my own site. Revoking admin status via the API is done by making a `PUT` request to `https://forum.yourdomain.com/admin/users/<user_id>/revoke_admin`. When I try this, admin status is revoked and no email confirmation is required. I’m finding a couple of issues with the response that Discourse sends for this request though.

If the user _does_ have admin status, I’m getting an empty response instead of a success message when I revoke their admin status via the API.

If the user _does not_ have admin status, I get an HTML response if the `PUT` request is made to `https://forum.yourdomain.com/admin/users/<user_id>/revoke_admin` and an `invalid access` error if I make the request to `https://forum.yourdomain.com/admin/users/<user_id>/revoke_admin.json`.

It would be good to get informative success and failure messages for this route.

I’m not sure about allowing admin status to be _granted_ without a confirmation email. The way it currently works is intended to supply an extra layer of security.

---

_[View the full topic](https://meta.discourse.org/t/grant-admin-revoke-admin-through-api-needs-revision/169559)._
