Creates a new user

POST /users

Creates a new user.

Body Required

The user to create

  • user_name string Required

    The user's identifier

  • security object Required

    The user's security information

    Additional properties are allowed.

    Hide security attributes Show security attributes object
    • roles array[string]

      The set of roles assigned to a user

    • permissions array[string]

      The distinct set of permissions allowed by the user's roles. These correspond to operationId values in the OpenAPI definition.

    • The user's elevated permission status

      Additional properties are allowed.

      Hide elevated_permissions attributes Show elevated_permissions attributes object
      • enabled boolean Required

        True if the user has elevated permissions

      • expires_at string(date-time)

        The time at which the user's elevated permissions expire

    • password string

      The user's password. Only used when modifying a user.

    • enabled boolean

      True if the user is enabled

    • The user's security realm

      Additional properties are allowed.

      Hide security_realm attributes Show security_realm attributes object
      • type string Required

        The type of the security realm

        Values are native, ldap, saml, or active_directory.

      • id string Required

        The identifier for the security realm

  • metadata object

    The users metadata

    Additional properties are allowed.

    Hide metadata attributes Show metadata attributes object
    • The Id of the user that created this user

    • created_at string(date-time)

      The date and time when the user was created

    • The Id of the user that last updated this user

    • updated_at string(date-time)

      The date and time when the user was last updated

    • first_login_at string(date-time)

      The date and time when the user first logged in

    • last_login_at string(date-time)

      The date and time when the user last logged in

  • The user's optional full name

  • email string

    The user's optional email address

  • builtin boolean

    True if the user is a built-in read-only user

Responses

  • User successfully created

    Hide response attributes Show response attributes object
    • user_name string Required

      The user's identifier

    • security object Required

      The user's security information

      Additional properties are allowed.

      Hide security attributes Show security attributes object
      • roles array[string]

        The set of roles assigned to a user

      • permissions array[string]

        The distinct set of permissions allowed by the user's roles. These correspond to operationId values in the OpenAPI definition.

      • The user's elevated permission status

        Additional properties are allowed.

        Hide elevated_permissions attributes Show elevated_permissions attributes object
        • enabled boolean Required

          True if the user has elevated permissions

        • expires_at string(date-time)

          The time at which the user's elevated permissions expire

      • password string

        The user's password. Only used when modifying a user.

      • enabled boolean

        True if the user is enabled

      • The user's security realm

        Additional properties are allowed.

        Hide security_realm attributes Show security_realm attributes object
        • type string Required

          The type of the security realm

          Values are native, ldap, saml, or active_directory.

        • id string Required

          The identifier for the security realm

    • metadata object

      The users metadata

      Additional properties are allowed.

      Hide metadata attributes Show metadata attributes object
      • The Id of the user that created this user

      • created_at string(date-time)

        The date and time when the user was created

      • The Id of the user that last updated this user

      • updated_at string(date-time)

        The date and time when the user was last updated

      • first_login_at string(date-time)

        The date and time when the user first logged in

      • last_login_at string(date-time)

        The date and time when the user last logged in

    • The user's optional full name

    • email string

      The user's optional email address

    • builtin boolean

      True if the user is a built-in read-only user

    • The provided user name is invalid. Check that it is not empty and it does not contain special characters. (code: user.user_name.invalid)
    • Some of the provided roles are invalid. (code: user.roles.invalid)
    • Some of the provided roles are forbidden. (code: user.roles.forbidden)
    • Trying to set a restricted field. (code: user.restricted_field)
    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Values are user.user_name.invalid, user.roles.invalid, user.roles.forbidden, or user.restricted_field.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • The username is already in use. (code: user.user_name.conflict)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is user.user_name.conflict.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

POST /users
curl \
 -X POST https://{{hostname}}/api/v1/users \
 -d '{"user_name":"string","security":{"roles":["string"],"permissions":["string"],"elevated_permissions":{"enabled":true,"expires_at":"2024-05-04T09:42:00+00:00"},"password":"string","enabled":true,"security_realm":{"type":"native","id":"string"}},"metadata":{"created_by":"string","created_at":"2024-05-04T09:42:00+00:00","updated_by":"string","updated_at":"2024-05-04T09:42:00+00:00","first_login_at":"2024-05-04T09:42:00+00:00","last_login_at":"2024-05-04T09:42:00+00:00"},"full_name":"string","email":"string","builtin":true}'
Request examples
{
  "user_name": "string",
  "security": {
    "roles": [
      "string"
    ],
    "permissions": [
      "string"
    ],
    "elevated_permissions": {
      "enabled": true,
      "expires_at": "2024-05-04T09:42:00+00:00"
    },
    "password": "string",
    "enabled": true,
    "security_realm": {
      "type": "native",
      "id": "string"
    }
  },
  "metadata": {
    "created_by": "string",
    "created_at": "2024-05-04T09:42:00+00:00",
    "updated_by": "string",
    "updated_at": "2024-05-04T09:42:00+00:00",
    "first_login_at": "2024-05-04T09:42:00+00:00",
    "last_login_at": "2024-05-04T09:42:00+00:00"
  },
  "full_name": "string",
  "email": "string",
  "builtin": true
}
Response examples (200)
{
  "user_name": "string",
  "security": {
    "roles": [
      "string"
    ],
    "permissions": [
      "string"
    ],
    "elevated_permissions": {
      "enabled": true,
      "expires_at": "2024-05-04T09:42:00+00:00"
    },
    "password": "string",
    "enabled": true,
    "security_realm": {
      "type": "native",
      "id": "string"
    }
  },
  "metadata": {
    "created_by": "string",
    "created_at": "2024-05-04T09:42:00+00:00",
    "updated_by": "string",
    "updated_at": "2024-05-04T09:42:00+00:00",
    "first_login_at": "2024-05-04T09:42:00+00:00",
    "last_login_at": "2024-05-04T09:42:00+00:00"
  },
  "full_name": "string",
  "email": "string",
  "builtin": true
}
Response examples (400)
# Headers
x-cloud-error-codes: user.user_name.invalid

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (409)
# Headers
x-cloud-error-codes: user.user_name.conflict

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}