CreateUser
Create a User
Create a new human or machine user in the specified organization.
Required permission:
- user.write
Request Body
application/json
The unique identifier of the organization the user belongs to.
The ID is a unique identifier for the user in the instance. If not specified, it will be generated. You can set your own user id that is unique within the instance. This is useful in migration scenarios, for example if the user already has an ID in another Zitadel system. If not specified, it will be generated. It can't be changed after creation.
The username is a unique identifier for the user in the organization. If not specified, Zitadel sets the username to the email for users of type human and to the user_id for users of type machine. It is used to identify the user in the organization and can be used for login.
Users of type human are users that are meant to be used by a person. They can log in interactively using a login UI. By default, new users will receive a verification email and, if a phone is configured, a verification SMS. To make sure these messages are sent, configure and activate valid SMTP and Twilio configurations. Read more about your options for controlling this behaviour in the email and phone field documentations.
Response Body
application/json
application/json
curl -X POST "https://loading/v2/users/new" \ -H "Content-Type: application/json" \ -d '{ "human": { "profile": { "givenName": "string", "familyName": "string" }, "email": { "email": "string", "isVerified": true }, "hashedPassword": { "hash": "string" } } }'{
"id": "string",
"creationDate": "1s",
"emailCode": "string",
"phoneCode": "string"
}{
"code": "not_found",
"message": "string",
"detail": {
"type": "string",
"value": "string",
"debug": {}
}
}Was this page helpful?