CreateUser
Creates a user in a specified workspace. The username must be unique within the workspace, can contain only lowercase letters, digits, and hyphens, and cannot be a reserved name such as manager, admin, or any name starting with worker-. If the password is not specified, the server generates an initial password and returns it in the initialPassword field of the response.
Operation description
Creates a user in a workspace for member collaboration and application access, which can be used to configure team members and user logons.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
agentcore:CreateUser |
create |
*User
|
None | None |
Request syntax
POST /workspaces/{workspaceId}/users HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| workspaceId |
string |
Yes |
The workspace ID. |
ws-123456 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body for creating a user. |
|
| name |
string |
Yes |
The username. The name must be unique within the workspace, can contain only lowercase letters, digits, and hyphens, must start and end with a lowercase letter or a digit, and must be 1 to 32 characters in length. Reserved names such as manager, admin, or any name starting with worker- are not allowed. |
user-01 |
| displayName |
string |
Yes |
The display name of the user. The name must be 1 to 32 characters in length. |
John Doe |
|
string |
No |
The email address of the user. The address can be up to 256 characters in length. |
user-01@example.com |
|
| note |
string |
No |
The remarks for the user. The remarks can be up to 1,024 characters in length. |
Agent operations team member |
| password |
string |
No |
The initial password of the user. The password must be 8 to 32 characters in length and must contain uppercase letters, lowercase letters, digits, and special characters. It cannot contain the username. If this parameter is not specified, the server generates a random password and returns it in the initialPassword field of the response. |
Example@2026 |
| clientToken |
string |
No |
Not supported. |
Not supported |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| requestId |
string |
The request ID. |
request-123456 |
| message |
string |
The response message. An error description is returned if the request fails. |
success |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| code |
string |
The business status code. |
SUCCESS |
| success |
boolean |
Indicates whether the request is successful. |
|
| data |
object |
The information about the created user. |
|
| workspaceId |
string |
The workspace ID. |
ws-123456 |
| agentCoreUserId |
string |
The user ID. |
usr-123456 |
| name |
string |
The username. The name must be unique within the workspace, can contain only lowercase letters, digits, and hyphens, must start and end with a lowercase letter or a digit, and must be 1 to 32 characters in length. |
user-01 |
| displayName |
string |
The display name of the user. The name must be 1 to 32 characters in length. |
John Doe |
|
string |
The email address of the user. The address can be up to 256 characters in length. |
user-01@example.com |
|
| authMethod |
string |
The authentication method of the user. A value of password indicates that the local password authentication of the workspace is used. A value of dingtalk or feishu indicates that the user is synchronized and authenticated by the corresponding external identity provider. |
password |
| note |
string |
The remarks for the user. The remarks can be up to 1,024 characters in length. |
Agent operations team member |
| status |
string |
The status of the user. Valid values: Creating, Active, Updating, Deleting, Failed, and DeleteFailed. Valid values:
|
Active |
| createdAt |
string |
The time when the user was created, in UTC format compliant with RFC 3339. |
2026-08-12T03:04:05Z |
| updatedAt |
string |
The time when the user was last updated, in UTC format compliant with RFC 3339. |
2026-08-12T03:04:05Z |
| regionId |
string |
The region ID of the resource. |
cn-hangzhou |
| initialPassword |
string |
The initial password of the user. If a password was specified during creation, that password is returned. Otherwise, a random password generated by the server is returned. |
Example@2026 |
Examples
Success response
JSON format
{
"requestId": "request-123456",
"message": "success",
"httpStatusCode": 200,
"code": "SUCCESS",
"success": false,
"data": {
"workspaceId": "ws-123456",
"agentCoreUserId": "usr-123456",
"name": "user-01",
"displayName": "Zhang San",
"email": "user-01@example.com",
"authMethod": "password",
"note": "Agent operation team member",
"status": "Active",
"createdAt": "2026-08-12T03:04:05Z",
"updatedAt": "2026-08-12T03:04:05Z",
"regionId": "cn-hangzhou",
"initialPassword": "Example@2026"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.