# Creating Active Users via the API gem

**URL:** https://meta.discourse.org/t/creating-active-users-via-the-api-gem/33133
**Category:** Development
**Tags:** rest-api
**Created:** [2015 年 9 月 11 日午後 6:06 UTC](https://meta.discourse.org/t/creating-active-users-via-the-api-gem/33133 "2015-09-11T18:06:38Z")
**Posts on this page:** 1
**Showing post:** 43

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [2020 年 8 月 5 日午後 1:57 UTC](https://meta.discourse.org/t/creating-active-users-via-the-api-gem/33133/43 "2020-08-05T13:57:50Z")

</div>

このコミットで解決しました：

> <https://github.com/discourse/discourse/commit/fec68d3d25bfc80d084af52e17882ad886fd5cd0>
>
> This commit is for a frequently requested task on meta so that only 1
> API call i…s needed instead of 3!
> 
> In order to create a user via the api and not have them receive an
> activation email you can pass in the \`active=true\` flag. This prevents
> sending an email, but it is only half of the solution and puts the db in
> a weird state where it has an active user with an unconfirmed email.
> 
> This commit fixes that and ensures that if the \`active=true\` flag is set
> the user's email is also marked as confirmed.
> 
> This change only applies to admins using the API.
> 
> Related topics on meta:
> 
> - https://meta.discourse.org/t/-/68663
> - https://meta.discourse.org/t/-/33133
> - https://meta.discourse.org/t/-/36133

---

_[View the full topic](https://meta.discourse.org/t/creating-active-users-via-the-api-gem/33133)._
