Add a Colleague for an Account

Adds a colleague account for a specified primary account. The operator must be the parent account of the specified primary account.

Request URL

POST {base_url}/uc-user/api/v1/accounts/{id}/colleagues

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code No String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Path parameters
Parameter Required Type Description
id Yes String The ID of the primary account. You can obtain the ID using the Search Resellers interface.
Body parameters
Parameter Required Type Description
firstName No String The first name of the user. This parameter and lastName cannot both be empty.
lastName No String The last name of the user. This parameter and firstName cannot both be empty.
email Yes String The email address of the account, which is used as the login username and must be globally unique.
phone No String The phone number. Only digits, letters, spaces, and the characters ().-+*# are allowed.
address No String The address.
remark No String The remark of the account.
profileImageResourceId No Integer The resource ID of the avatar. Upload the avatar file to the resource service first and pass in the returned resource ID. null or 0 indicates that no avatar is set, and a non-zero value sets the avatar.
permissionIds No Array<Integer> The list of permission IDs. A null value uses the default colleague role permissions, a non-empty list assigns the specified permissions which must be a subset of the operator permissions, and an empty list is not allowed.
sendActivationEmail No Boolean Whether to send an activation email. true (default) saves the account and sends the activation email, and false saves the account only.
systemLanguage No String

The initial system language, which is used to initialize the preference settings.

Valid value:

  • en
  • zh

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Colleague> The details of the created colleague account.
Colleague
Parameter Type Description
id String The ID of the account.
ucId String The UC ID of the company that the account belongs to.
firstName String The first name of the user.
lastName String The last name of the user.
status String The status of the account.
email String The email address of the account, which is used as the login username.
company String The company name, which is inherited from the primary account.
phone String The phone number.
address String The address.
profileImage String The URL of the avatar.
twoFactorEnabled Boolean Whether two-factor authentication is enabled.
remark String The remark of the account.
createTime Integer The time when the account was created, in Unix timestamp format (milliseconds).

Example

Request example

POST /uc-user/api/v1/accounts/2085315948849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yhGPjIdCHSK7hill2VbzVAGuVzj3b1AplQz2cAVmVhXqWqOfpfjM1tY9A
Content-Type: application/json
{
  "firstName": "Doc2",
  "lastName": "Test",
  "email": "aitdoc-c2-51280@mailstar.top",
  "remark": "ait-doc-test-2",
  "sendActivationEmail": false
}

Response example

HTTP/1.1 200 OK
{
  "result": {
    "id": "2110642172532178945",
    "ucId": "2085315948287791106",
    "firstName": "Doc2",
    "lastName": "Test",
    "status": "INACTIVE",
    "email": "aitdoc-c2-51280@mailstar.top",
    "twoFactorEnabled": false,
    "remark": "ait-doc-test-2",
    "createTime": 1792051282530
  },
  "requestId": "79fd9734a4474b55b5b7c7909e23da6e",
  "code": "200",
  "message": "SUCCESS"
}