POST Users

POST Users

Creates a new user.

Request
URI
POST
https://{api_host}/api/v2/users
COPY
Request Body
users.post.request of type(s) application/json
Optional
{
    "username": "johnDoe",
    "email": "[email protected]",
    "roleIds": [
        "00000000-0000-0000-0000-000000000002"
    ]
}
Authentication
This operation uses the following authentication methods.
Responses
201

Successfully added a user.

Returns users.post.response of type(s) application/json
{
    "id": "de305d54-75b4-431b-adb2-eb6b9e546014",
    "username": "johnDoe",
    "roleIds": [
        "00000000-0000-0000-0000-000000000002"
    ],
    "capabilities": [
        {
            "id": "VIEW_SHARED_DASHBOARDS"
        },
        {
            "id": "VIEW_INTERACTIVE_ANALYTICS"
        },
        {
            "id": "VIEW_CONTENT_PACKS"
        },
        {
            "id": "VIEW_SHARED_DASHBOARD_URLS"
        },
        {
            "id": "VIEW_CONTENT_PACK_DASHBOARDS"
        },
        {
            "id": "EDIT_USER_DASHBOARDS"
        },
        {
            "id": "EDIT_EXPORT"
        },
        {
            "id": "VIEW_ALERTS"
        },
        {
            "id": "VIEW_USER_DASHBOARDS"
        },
        {
            "id": "EDIT_INTERACTIVE_ANALYTICS"
        },
        {
            "id": "EDIT_SHARED_DASHBOARD_URLS"
        },
        {
            "id": "EDIT_CONTENT_PACKS"
        },
        {
            "id": "VIEW_EXTRACTED_FIELDS"
        },
        {
            "id": "VIEW_EXPORT"
        },
        {
            "id": "EDIT_SHARED_DASHBOARDS"
        },
        {
            "id": "EDIT_EXTRACTED_FIELDS"
        }
    ],
    "email": "[email protected]",
    "type": "DEFAULT",
    "authStatus": "ACTIVE",
    "domain": "",
    "upn": ""
}

400

User already exists

Returns error of type(s) application/json
{
    "errorMessage": "Some fields have incorrect values",
    "errorCode": "FIELD_ERROR",
    "errorDetails": {
        "username": [
            {
                "errorCode": "com.vmware.loginsight.api.errors.field_required",
                "errorMessage": "Required value is null"
            }
        ],
        "email": [
            {
                "errorCode": "com.vmware.loginsight.api.errors.field_value_doesnt_match_pattern",
                "errorMessage": "Value doesn't match email pattern."
            }
        ]
    }
}
string
errorMessage
Required

A message describing the error.

string
errorCode
Optional

A code representing the type of error.

Possible values are : LIMIT_ERROR, FIELD_ERROR, TEST_ERROR, JSON_FORMAT_ERROR, LICENSE_ERROR, VSPHERE_INTEGRATION_ERROR, VROPS_INTEGRATION_ERROR, UPGRADE_ERROR, SEARCH_ERROR, AGENT_ERROR, RBAC_COMMON_ERROR, RBAC_USERS_ERROR, RBAC_GROUPS_ERROR, RBAC_ADGROUPS_ERROR, RBAC_DATASETS_ERROR, RBAC_VIDM_GROUPS_ERROR, RBAC_VIDB_GROUPS_ERROR, SECURITY_ERROR, DEPLOYMENT_ERROR, SUPPORT_BUNDLE_ERROR, LOAD_BALANCER_ERROR, VIDM_ERROR, VIDB_ERROR, QUERY_ERROR, SSL_CERTIFICATE_ERROR, PROXY_ERROR,
object
errorDetails
Optional

Dynamic error details, where the field name can vary depending on the request field and error code.


401
Operation doesn't return any data structure

409

User already exists

Returns error of type(s) application/json
{
    "errorMessage": "Specified user already exists.",
    "errorCode": "RBAC_USERS_ERROR",
    "errorDetails": {
        "errorCode": "com.vmware.loginsight.api.errors.rbac.user_already_exists"
    }
}
string
errorMessage
Required

A message describing the error.

string
errorCode
Optional

A code representing the type of error.

Possible values are : LIMIT_ERROR, FIELD_ERROR, TEST_ERROR, JSON_FORMAT_ERROR, LICENSE_ERROR, VSPHERE_INTEGRATION_ERROR, VROPS_INTEGRATION_ERROR, UPGRADE_ERROR, SEARCH_ERROR, AGENT_ERROR, RBAC_COMMON_ERROR, RBAC_USERS_ERROR, RBAC_GROUPS_ERROR, RBAC_ADGROUPS_ERROR, RBAC_DATASETS_ERROR, RBAC_VIDM_GROUPS_ERROR, RBAC_VIDB_GROUPS_ERROR, SECURITY_ERROR, DEPLOYMENT_ERROR, SUPPORT_BUNDLE_ERROR, LOAD_BALANCER_ERROR, VIDM_ERROR, VIDB_ERROR, QUERY_ERROR, SSL_CERTIFICATE_ERROR, PROXY_ERROR,
object
errorDetails
Optional

Dynamic error details, where the field name can vary depending on the request field and error code.


440
Operation doesn't return any data structure

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/api/v2/users