create_user

To create a new user, use the core/create_user method.

Copied!
svc=core/create_user&params={
  "creatorId": <long>,
  "name": "<text>",
  "password": "<text>",
  "dataFlags": <uint>
}

Parameters

Parameter Description
creatorId The ID of the user that should be the new user’s creator.
name The name of the new user (4–50 characters).
password The password of the new user.
dataFlags Flags with the user properties for the response (see Users).

Response

If the request is completed successfully, the response is returned in the following format:

Copied!
{
  "item": {         /* Created user. */
    ...
  },
  "flags": <uint>   /* Applied flags with properties. */
}

The format of the item parameter is described on the Users page.

If the request fails, an error code is returned.

Error codes

Error code Description
4 Wrong input parameters.
6 One of the following errors:
  • Failed to fetch the creator, or you have no Act on behalf of this user access right to the creator.
  • The current user doesn’t have the Can create items flag (0x04).
  • Failed to create the user.
7 The creator is a top account user, or failed to check the create_users billing transaction.
1002 A user with this name already exists, or failed to create the user because of the billing rules.

If you find a mistake in the text, please select it and press Ctrl+Enter.