# How to Set User Passwords For Users Created From API

**URL:** <https://community.labelstud.io/t/how-to-set-user-passwords-for-users-created-from-api/62>\
**Category:** Slack Archivist\
**Created:** [August 1, 2023, 7:28pm UTC](https://community.labelstud.io/t/how-to-set-user-passwords-for-users-created-from-api/62 "2023-08-01T19:28:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archivist](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Archivist](https://community.labelstud.io/u/Archivist)\
**Post date:** [August 1, 2023, 7:28pm UTC](https://community.labelstud.io/t/how-to-set-user-passwords-for-users-created-from-api/62/1 "2023-08-01T19:28:02Z")

</div>

**Quentin RIBAUD** : Hello! I want to create users through the API, but there is no way to specify the password in the payload. Thus, whenever I create a user, it is successfully added to the organization page, but I can’t login with it since I can’t specify a password. Do you have any recommendation? Here is the code i’m using to create the user, if you need any other information, feel free to ask :

`def create_user(email, password):`  
`url = f"{api_endpoint}/users/"`  
`data = {`  
`"email": email,`  
`# "password": password, there is no password clause to specify the password that I can use to connect to the organization page`  
`"username": email`  
`}`  
`response = <http://requests.post|requests.post>(url, headers=headers, json=data)`

```
`if response.status_code == 201:`
    `print(f"User '{email}' created successfully.")`
`elif response.status_code == 400:`
    `print(f"{email} already has an account")`
`else:`
    `print(f"Failed to create user '{email}'. Error: {response.text}")`

```

**Chris Hoge (HumanSignal)**: Label Studio doesn’t allow setting the password through the API. If you have access to the system hosting Label Studio, you can reset the password on the command line using: `label-studio reset_password --username &lt;username&gt; --password &lt;password&gt;`

**Chris Hoge (HumanSignal)**: Details are here [https://labelstud.io/guide/signup.html#Reset-password](https://labelstud.io/guide/signup.html#Reset-password)

**Chris Hoge (HumanSignal)**: Because Label Studio open source allows any user to use their token to access the API, the app only allows password resets from the command line for security reasons.

**Note** : _This post was generated by the Label Studio Archive Bot from a conversation in the [Label Studio Slack](https://slack.labelstud.io/?source=discourse), a gathering place for the Label Studio community. Someone in the community thought this was worth sharing!_

_If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs._

---

<div class="post-metadata">

**Author:** ![Archivist](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Archivist](https://community.labelstud.io/u/Archivist)\
**Post date:** [August 2, 2023, 8:47am UTC](https://community.labelstud.io/t/how-to-set-user-passwords-for-users-created-from-api/62/3 "2023-08-02T08:47:40Z")

</div>

**Quentin RIBAUD** : Hi! that makes sense since any user can use their token to access and use the API, you cannot change the passwords that way, that’s what I was thinking, but thank you for the details!
