Users Operations Create

Users Operations Create
Create a new console user (Administrator only)

Creates a console user with a role and an initial LOCAL password; the account must change that password on first login.

Request
URI
POST
https://{api_host}/api/v1/users
COPY
Request Body

The new account: username, display name, optional email, role and the initial password.

CreateUserRequest of type(s) application/json
Required  

Show optional properties

{
    "username": "string",
    "displayName": "string",
    "role": "string",
    "initialPassword": "string"
}
{
    "username": "carol.example",
    "displayName": "Carol Example",
    "email": "[email protected]",
    "role": "AUDITOR",
    "initialPassword": "Exampl3-Passw0rd!"
}
string As ^(?=.{4,24}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._\\]+(?<![_.])$
username
Required  
Constraints: minLength: 4 maxLength: 24

Login username, unique case-insensitively (4-24 chars; letters, digits, '.', '', or ''; no leading/trailing or consecutive '.'/'')

string
displayName
Required  
Constraints: minLength: 1 maxLength: 128

Display name shown in the console UI

string As email As email
email
Optional
Constraints: maxLength: 254

Contact email address

string
role
Required  

Console user role — Administrator, Security Operator, or read-only Auditor

  • ADMIN: Administrator. Can use the operations open to every role and those restricted to ADMIN, such as user management, SSO settings, syslog destination changes and retention settings changes
  • SECURITY_OPERATOR: Security operator. Can use the operations open to ADMIN and SECURITY_OPERATOR and those open to every role, but not the ADMIN-only operations
  • AUDITOR: Auditor. Can use only the operations open to all three roles, not those restricted to ADMIN or to ADMIN and SECURITY_OPERATOR
Enumeration: ADMIN, SECURITY_OPERATOR, AUDITOR
string As password As ^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&+=(){}_-])(?=\S+$).{8,20}$
initialPassword
Required  
Constraints: minLength: 8 maxLength: 20

Initial password for the account; the user must change it on first login (8-20 chars; at least one digit, one lowercase, one uppercase, and one special character from !@#$%^&+=(){}_-; no whitespace)

Authentication
This operation uses the following authentication methods.
Responses
201

201 Created successful response envelope. The created user summary

Returns UserSummaryDto of type(s) application/json
{
    "id": 3,
    "username": "carol.example",
    "displayName": "Carol Example",
    "email": "[email protected]",
    "role": "AUDITOR",
    "authSource": "LOCAL",
    "lastLoginAt": null,
    "mustChangePassword": false
}
integer As int64 As int64
id
Required  

Unique user identifier

string
username
Required  

Login username, unique case-insensitively

string
displayName
Required  

Display name shown in the console UI

string As email As email
email
Optional

Contact email address

string
role
Required  

Console user role — Administrator, Security Operator, or read-only Auditor

  • ADMIN: Administrator. Can use the operations open to every role and those restricted to ADMIN, such as user management, SSO settings, syslog destination changes and retention settings changes
  • SECURITY_OPERATOR: Security operator. Can use the operations open to ADMIN and SECURITY_OPERATOR and those open to every role, but not the ADMIN-only operations
  • AUDITOR: Auditor. Can use only the operations open to all three roles, not those restricted to ADMIN or to ADMIN and SECURITY_OPERATOR
Enumeration: ADMIN, SECURITY_OPERATOR, AUDITOR
string
authSource
Required  

Authentication source a console user account was provisioned through

  • LOCAL: Account created in the console with a password held by the console; the only source that can sign in with a username and password
  • SAML: No behaviour is documented for this value. No producing site in the current server code
  • OIDC: Account provisioned automatically at the first successful SSO sign-in; it never sets a password and is not forced to change one
Enumeration: LOCAL, SAML, OIDC
string As date-time As date-time
lastLoginAt
Optional

Timestamp of the most recent successful login as an ISO 8601 date-time with offset

boolean
mustChangePassword
Required  

Whether the user must set a new password before continuing to use the console


400

400 Bad Request: USERNAME_REQUIRED or INVALID_USERNAME_FORMAT when the username is missing or malformed; INITIAL_PASSWORD_REQUIRED or INVALID_PASSWORD_FORMAT when the initial password is missing or breaks the password rules; DISPLAY_NAME_REQUIRED or DISPLAY_NAME_TOO_LONG for the display name; EMAIL_TOO_LONG or INVALID_EMAIL_FORMAT when an email is supplied and is not valid; ROLE_REQUIRED or INVALID_ROLE for the role; MALFORMED_REQUEST when the body cannot be read

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


403

403 Forbidden: FORBIDDEN when the signed-in role is not allowed to call this operation; CSRF_ERROR when the X-XSRF-TOKEN header is missing or wrong on a POST, PUT, PATCH or DELETE (only POST /api/v1/auth/login is exempt, and a request without a valid session gets 401 UNAUTHENTICATED instead); PASSWORD_CHANGE_REQUIRED when the account must change its password first (only GET /api/v1/auth/session, POST /api/v1/auth/logout and POST /api/v1/auth/change-password are exempt); LICENSE_REQUIRED or LICENSE_EXPIRED while the license pool is restricted (no license, or expired past grace) (exempt: every route under /api/v1/auth, GET /api/v1/user/preferences, GET /api/v1/licensing/summary and POST /api/v1/licensing/licenses)

Returns ForbiddenWrite of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


409

409 Conflict: USERNAME_ALREADY_EXISTS when the username is already in use, compared without regard to case

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"username":"string","displayName":"string","role":"string","initialPassword":"string"}' https://{api_host}/api/v1/users