# Creating user via API

**URL:** https://meta.discourse.org/t/creating-user-via-api/36133
**Category:** Development
**Tags:** rest-api
**Created:** [2015年十一月29日 20:18 UTC](https://meta.discourse.org/t/creating-user-via-api/36133 "2015-11-29T20:18:49Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![cck197](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cck197/32/110338_2.png) [@cck197](https://meta.discourse.org/u/cck197)
#### Post date: [2018年十二月7日 22:20 UTC](https://meta.discourse.org/t/creating-user-via-api/36133/10 "2018-12-07T22:20:08Z")

</div>

OK I found this post:

> [@Creating Active Users via the API gem](https://meta.discourse.org/t/creating-active-users-via-the-api-gem/33133/3):
>
> I just spent the better part of today working on this and found a workaround for it. Here’s the process you have to go through to make this work. Create the account and set active=true. Note the user\_id that is provided from the API call. In your above example, the user\_id=7 so we’ll use that in this example. Make an API call to deactivate the user account. It will be something like this: [http://discourseURL/admin/users/7/deactivate.json?api\_key=xxxx&api\_username=yyyy](http://discourseURL/admin/users/7/deactivate.json?api_key=xxxx&api_username=yyyy) Make an API call to act…

If I do the create/deactivate/activate trick the click here to activate your account button works but I still can’t log in with `active=true`.

---

_[View the full topic](https://meta.discourse.org/t/creating-user-via-api/36133)._
