Skip to Content
ZITADEL Docs
APIsCore ResourcesV2User

Create a User

Create a new user or service account in the specified organization.

Required permission:

  • user.write
POST
/v2/users/new

Request Body

application/json
  1. body
organizationId?organization_id

The unique identifier of the organization the user belongs to.

userId?|

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.

username?|

The username is a unique identifier for the user in the organization. If not specified, Zitadel sets the username to the email for user and to the user_id for Service Accounts. It is used to identify the user in the organization and can be used for login.

metadata?array<>

Metadata to be set. The values have to be base64 encoded.

human*|

Response Body

Success

application/json
  1. response
id?id

The unique identifier of the newly created user.

creationDate?creation_date

The timestamp of the user creation.

Formatdate-time
emailCode?|

The email verification code if it was requested by setting the email verification to return_code.

phoneCode?|

The phone verification code if it was requested by setting the phone verification to return_code.

Example Request
curl -X POST 'https://example.com/v2/users/new' \  -H 'Content-Type: application/json' \  -d '{  "human": {    "hashedPassword": {      "hash": "string"    }  }}'
Example Response200
{  "id": "string",  "creationDate": "2023-01-15T01:30:15.01Z",  "emailCode": "string",  "phoneCode": "string"}

Was this page helpful?