# Approving an already-existing user through API?

**URL:** https://meta.discourse.org/t/approving-an-already-existing-user-through-api/71998
**Category:** Development
**Created:** [October 13, 2017, 9:18am UTC](https://meta.discourse.org/t/approving-an-already-existing-user-through-api/71998 "2017-10-13T09:18:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)
#### Post date: [October 13, 2017, 9:18am UTC](https://meta.discourse.org/t/approving-an-already-existing-user-through-api/71998/1 "2017-10-13T09:18:40Z")

</div>

I have created 17500 users via the Discourse API and uploaded all user avatars with the help of some very nice people here on Meta Discourse. All these users are in a “pending” state, and I would like to approve these users in bulk via the API. However, I only see an API endpoint to “activate” a user. As all my users are already active (but not approved) my question is, can I approve the users via the API, or must approval be done manually by the screenfull in the admin backend of Discourse? 17500 users will be a lot to have to approve manually.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)
#### Post date: [October 13, 2017, 9:27am UTC](https://meta.discourse.org/t/approving-an-already-existing-user-through-api/71998/2 "2017-10-13T09:27:36Z")

</div>

I must also mention here that my user creation calls already had “approved” set to “true”, however this did not actually set the users to the approved state on creation.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [October 13, 2017, 9:33am UTC](https://meta.discourse.org/t/approving-an-already-existing-user-through-api/71998/3 "2017-10-13T09:33:20Z")

</div>

> [@Frank\_Bailey](#):
>
> can I approve the users via the API, or must approval be done manually by the screenfull in the admin backend of Discourse?

This topic might come handy 😉

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

---

<div class="post-metadata">

### Author: ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)
#### Post date: [October 13, 2017, 10:17am UTC](https://meta.discourse.org/t/approving-an-already-existing-user-through-api/71998/4 "2017-10-13T10:17:40Z")

</div>

Thanks, that was an interesting read and very helpful.

For anyone finding this topic on the Googles, this is the syntax I used:

 ![approve_member](https://global.discourse-cdn.com/meta/original/3X/7/a/7a96fc9655a521270c51f067c54ab9a2ed4948d2.jpg)
