# Cant create new users

**URL:** https://meta.discourse.org/t/cant-create-new-users/329394
**Category:** Support
**Tags:** rest-api
**Created:** [October 4, 2024, 6:32pm UTC](https://meta.discourse.org/t/cant-create-new-users/329394 "2024-10-04T18:32:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Denis\_Didkovsky](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@Denis\_Didkovsky](https://meta.discourse.org/u/Denis_Didkovsky)
#### Post date: [October 4, 2024, 6:32pm UTC](https://meta.discourse.org/t/cant-create-new-users/329394/1 "2024-10-04T18:32:52Z")

</div>

Can someone assist with API user creation. It was discussed several times in API category, I am following recommendations, the proposed request:

curl -X POST “[https://DISCOURSEURL/users.json](https://DISCOURSEURL/users.json)”   
-H “Api-Key: b5629e5139axxxxxxxxxxxxxxc93f623b0ab25fcd996bb424c6d5c71”   
-H “Api-Username: admin1”   
-H “Content-Type: multipart/form-data;”   
-F “[email=activeuser@example.com](mailto:email=activeuser@example.com)”   
-F “username=activeuser”   
-F “password=simplepass”   
-F “active=true”   
-F “approved=true”

gives “errors”:[“You are not permitted to view the requested resource. The API username or key is invalid.”],“error\_type”:“invalid\_access”}  
the user is admin and API key is valid. the Discourse version is 3.3.0.beta2-dev

---

<div class="post-metadata">

### Author: ![Denis\_Didkovsky](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@Denis\_Didkovsky](https://meta.discourse.org/u/Denis_Didkovsky)
#### Post date: [October 4, 2024, 6:41pm UTC](https://meta.discourse.org/t/cant-create-new-users/329394/2 "2024-10-04T18:41:12Z")

</div>

I have found the solution by setting the API key scopes to the following

 ![The image displays a user interface of an API, specifically pertaining to API keys, with fields for description, user level, and scope, and a question for what the key will be used for. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/f/2/e/f2e6f69337b960105f31bf11195a7dcf36498b6b.png)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 3, 2024, 6:41pm UTC](https://meta.discourse.org/t/cant-create-new-users/329394/3 "2024-11-03T18:41:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
