All Products
Search
Document Center

CloudSSO:CreateUser

Last Updated:Jun 14, 2024

Creates a user.

Operation description

This topic provides an example on how to create a user named Alice.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cloudsso:CreateUserWrite
  • User
    acs:cloudsso:{#regionId}:{#accountId}:directory/{#DirectoryId}/user/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DirectoryIdstringYes

The ID of the directory.

d-00fc2p61****
UserNamestringYes

The name of the user. The name must be unique within the directory. The name cannot be changed.

The name can contain numbers, letters, and the following special characters: @_-.

The name can be up to 64 characters in length.

Alice
FirstNamestringNo

The first name of the user.

The name can be up to 64 characters in length.

Alice
LastNamestringNo

The last name of the user.

The name can be up to 64 characters in length.

Lee
DisplayNamestringNo

The display name of the user.

The name can be up to 256 characters in length.

Alice
DescriptionstringNo

The description of the user.

The description can be up to 1,024 characters in length.

This is a user.
EmailstringNo

The email address of the user. The email address must be unique within the directory.

The email address can be up to 128 characters in length.

Alice@example.com
StatusstringNo

The status of the user. Valid values:

  • Enabled: The logon of the user is enabled. This is the default value.
  • Disabled: The logon of the user is disabled.
Enabled

Response parameters

ParameterTypeDescriptionExample
object
Userobject

The information about the user.

Statusstring

The status of the user. Valid values:

  • Enabled: The logon of the user is enabled.
  • Disabled: The logon of the user is disabled.
Enabled
UserNamestring

The name of the user.

Alice
Emailstring

The email address of the user.

Alice@example.com
Descriptionstring

The description of the user.

This is a user.
UserIdstring

The ID of the user.

u-00q8wbq42wiltcrk****
FirstNamestring

The first name of the user.

Alice
CreateTimestring

The time when the user was created.

2021-10-26T03:03:42Z
ProvisionTypestring

The type of the user. Valid values:

  • Manual: The user is manually created.
  • Synchronized: The user is synchronized from an external identity provider (IdP).
Manual
DisplayNamestring

The display name of the user.

Alice
UpdateTimestring

The time when the user was modified.

2021-10-26T03:03:42Z
LastNamestring

The last name of the user.

Lee
RequestIdstring

The ID of the request.

F6F90F3D-4502-5877-B80B-97476F6AE2CC

Examples

Sample success responses

JSONformat

{
  "User": {
    "Status": "Enabled",
    "UserName": "Alice",
    "Email": "Alice@example.com",
    "Description": "This is a user.",
    "UserId": "u-00q8wbq42wiltcrk****",
    "FirstName": "Alice",
    "CreateTime": "2021-10-26T03:03:42Z",
    "ProvisionType": "Manual",
    "DisplayName": "Alice",
    "UpdateTime": "2021-10-26T03:03:42Z",
    "LastName": "Lee"
  },
  "RequestId": "F6F90F3D-4502-5877-B80B-97476F6AE2CC"
}

Error codes

For a list of error codes, visit the Service error codes.