# API creates inactive users after adding them to a group

**URL:** https://meta.discourse.org/t/api-creates-inactive-users-after-adding-them-to-a-group/71347
**Category:** Support
**Created:** [October 3, 2017, 7:53pm UTC](https://meta.discourse.org/t/api-creates-inactive-users-after-adding-them-to-a-group/71347 "2017-10-03T19:53:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [October 3, 2017, 7:53pm UTC](https://meta.discourse.org/t/api-creates-inactive-users-after-adding-them-to-a-group/71347/1 "2017-10-03T19:53:08Z")

</div>

On a newly installed instance, I created an empty team group with a primary option enabled. Then using a bulk editor I added a list of emails of inexistent users (no one from the list existed, 19 emails total, team members). The system reported that I need to check if users exist, and as a result, nobody added to the group.

After that, I created users (\>1000) using API (I used pydiscourse module in python). 4 users from 1000 (incliding 19 members) created as inactive and the system sent them activation emails. I find such behavior weird.

If I first create users and then add 19 members to a group, everything is ok, everybody is active.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 4, 2017, 1:16am UTC](https://meta.discourse.org/t/api-creates-inactive-users-after-adding-them-to-a-group/71347/2 "2017-10-04T01:16:00Z")

</div>

This is a usage issue or pydiscourse issue, you can use the API to register activated accounts.

> <https://github.com/discourse/discourse/blob/main/app/controllers/users_controller.rb#L901-L907>

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/api-creates-inactive-users-after-adding-them-to-a-group/71347/3 "2024-06-08T12:44:07Z")

</div>

This topic was automatically closed after 2439 days. New replies are no longer allowed.
