All Products
Search
Document Center

Drive and Photo Service:CreateUser

Last Updated:Aug 04, 2025

Creates a user.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/user/create HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

user_idstringYes

The user ID. The ID can be up to 64 characters in length and cannot contain number signs (#).

pdsuserid1
nick_namestringNo

The nickname of the user. The nickname can be up to 128 characters in length.

pdsuer
statusstringNo

The state of the user. Default value: enabled. Valid values:

  • enabled: The user is in a normal state.
  • disabled: The user is prohibited from logon.
enabled
rolestringNo

The role of the user. Default value: user. Valid values:

  • superadmin
  • admin
  • user

If the domain can be divided into subdomains, the subdomain_super_admin and subdomain_admin roles are also supported.

Valid values:

  • subdomain_super_admin

  • subdomain_admin

  • superadmin

  • admin

  • user

user
avatarstringNo

The URL of the profile picture.

If you specify the parameter in the HTTP URL format, the URL must start with http:// or https:// and can be up to 4 KB in size.

If you specify the parameter in the data URL format, the URL must start with data:// and be encoded in Base64. The URL can be up to 300 KB in size.

http://a.b.c/pds.jpg
phonestringNo

The phone number.

13900001111
emailstringNo

The email address.

123@pds.com
user_datastringNo

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

md
group_info_listarray<object>No

The information about the group.

objectNo
group_idstringNo

The group ID.

g123
user_namestringNo

The username. The username can be up to 128 characters in length.

pdsusername
descriptionstringNo

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

The VIP user

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

domain_idstring

The domain ID.

bj1
user_idstring

The user ID.

dingding_abc001
avatarstring

The URL of the profile picture.

http://aa.com/1.jpg
created_atlong

The time when the user was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1639762579768
updated_atlong

The time when the user was modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1639762579768
nick_namestring

The nickname of the user.

001
user_namestring

The username.

pds
phonestring

The phone number.

13900001111
emailstring

The email address.

a@a.com
rolestring

The role of the user. Valid values:

  • superadmin
  • admin
  • user
admin
statusstring

The state of the user. Valid values:

  • disabled: The user is prohibited from logon.
  • enabled: The user is in a normal state.
enabled
descriptionstring

The description of the user.

vipuser
default_drive_idstring

The ID of the default drive.

1
user_dataobject

The custom data.

string

The custom item.

dog
creatorstring

The user who created the user.

user1

Examples

Sample success responses

JSONformat

{
  "domain_id": "bj1",
  "user_id": "dingding_abc001",
  "avatar": "http://aa.com/1.jpg",
  "created_at": 1639762579768,
  "updated_at": 1639762579768,
  "nick_name": "001",
  "user_name": "pds",
  "phone": 13900001111,
  "email": "a@a.com",
  "role": "admin",
  "status": "enabled",
  "description": "vipuser",
  "default_drive_id": 1,
  "user_data": {
    "key": "dog"
  },
  "creator": "user1"
}

Error codes

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