Skip to main content

CreateUser

Create a database user and assign existing roles.

Requires access_control.create permission. No input or output blobs are used.

Parameters​

  • username (string, required): at least four characters, no whitespace, and no leading underscore.

  • password (string, required): at least ten characters with a letter, digit, and punctuation; no whitespace or unsupported characters.

  • roles (array of strings, required): names of existing roles; may be empty.

  • email (string, optional): defaults to an empty string.

Behavior​

The username must be new and every assigned role must exist. Roles created earlier in the same query are available. All changes roll back if execution of any command fails. The user receives the combined permissions of its roles; see Access Control.

Response​

Success returns status: 0. Failures return a negative status and an info message; see Responses for error envelopes and retry guidance.

Examples​

[{
"CreateUser": {
"username": "john",
"password": "love4Aperture!",
"roles": ["admin", "user", "architect"],
"email": "jfk@aperturedata.io"
}
}]

Response:

[{
"CreateUser": {
"status": 0
}
}]