Add¶
POST /api/v1/account/add
Overview¶
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| brandKey | string | Brand key Example: guance Nullable: False |
|
| username | string | Y | Login account name (unique when exterId is not present) Example: test_wang Nullable: True Allow empty string: True |
| password | string | Y | Login password (when the password is an empty string, third-party login accounts should set the password to an empty string) Example: I am password Allow empty string: True Nullable: True |
| name | string | Y | Nickname Example: test_wang Nullable: False Allow empty string: False |
| string | Y | User email Example: xxx@guance.com Nullable: False Allow empty string: True $isEmail: True |
|
| mobile | string | Local mobile number; legacy 11-digit domestic mobile numbers will be handled as countryCode=86 Example: 1762xxx9836 Nullable: False Allow empty string: False |
|
| countryCode | string | Mobile country/region code Example: 86 Nullable: False Allow empty string: True |
|
| exterId | string | Unique identifier ID in the third-party account system. When this field is present, its value is unique (the username field allows duplicates) Example: 29ab8d31-ac52-4485-a572-f4cf25d355d9 Nullable: False Allow empty string: False |
|
| extend | json | Additional information Nullable: True |
|
| language | string | Language information Example: zh Nullable: True Allow empty string: True Allowed values: ['zh', 'en', 'zh-hant', 'id', 'ja', 'ko'] |
|
| isDisable | boolean | Whether to disable Example: True Nullable: False Allowed values: [True, False] |
|
| attributes | json | Account attribute information (JSON structure, KV structure; use strings for the V part where possible, applicable for automatic updates during SSO login) Example: {'部门': 'A部门'} Nullable: False |
|
| customAttributes | json | Account custom attribute information (JSON structure, KV structure; use strings for the V part where possible, only applicable for business-side updates) Example: {'部门': 'A部门'} Nullable: False |
Parameter Notes¶
Request Example¶
curl 'http://127.0.0.1:5000/api/v1/account/add' \
-H 'Content-Type: application/json' \
-H 'X-Df-Access-Key: abcd' \
-H 'X-Df-Nonce: 4' \
-H 'X-Df-Signature: test123' \
-H 'X-Df-Timestamp: 1715321116' \
--data-raw $'{ "username": "xxx@guance.com", "password": "xxx", "name": "lwc_xxxx_002", "email": "xxx@guance.com"}'
Response¶
{
"code": 200,
"content": {
"attributes": {},
"canaryPublic": false,
"createAt": 1715322612,
"creator": "SYS",
"deleteAt": -1,
"email": "xxx@guance.com",
"enableMFA": false,
"extend": null,
"exterId": "",
"id": 3026,
"isUsed": 0,
"language": "zh",
"mfaSecret": "*********************",
"mobile": "",
"name": "xxxx",
"nameSpace": "",
"status": 0,
"statusPageSubs": 0,
"timezone": "",
"tokenHoldTime": 604800,
"tokenMaxValidDuration": 2592000,
"updateAt": 1715322612,
"updator": "SYS",
"username": "xxx@guance.com",
"uuid": "acnt_67792938b21148ff8f2b17afdbd92c27"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-9833FF30-E419-42E1-B999-047E609D4EE3"
}