POST/user

Create a user account

Creates a user account in the user service. Supply user details such as username, firstName, lastName, email, password, and phone in the optional request body. Only the authenticated user can create a user.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

8 body fields

User details for the account to create; the request body is optional.

idintegeroptional
The user's integer identifier.
usernamestringoptional
The user's username.
firstNamestringoptional
The user's first name.
lastNamestringoptional
The user's last name.
emailstringoptional
The user's email address.
passwordstringoptional
The user's password.
phonestringoptional
The user's phone number.
userStatusintegeroptional
User Status

2 status codes
200Returns the created user object, including its identifier, username, name, email, password, phone, and status.
idintegeroptional
usernamestringoptional
firstNamestringoptional
lastNamestringoptional
emailstringoptional
passwordstringoptional
phonestringoptional
userStatusintegeroptional
User Status
defaultReturned when an unexpected error occurs.

Error handling

Only the authenticated user can create a user. The optional body can include username and other user properties; the schema does not mark any properties as required.