Skip to content

Create



POST /api/v1/account/add

Overview

Body Request Parameters

Parameter Name Type Required Description
brandKey string Brand identifier
Example: guance
Allow empty: False
Optional values: ['guance', 'truewatch']
username string Y Login account name (this field value is unique when exterId does not exist)
Example: test_wang
Allow empty: True
Allow empty string: True
password string Y Login password (password is an empty string for third-party login accounts)
Example: I am password
Allow empty string: True
Allow empty: True
name string Y Nickname
Example: test_wang
Allow empty: False
Allow empty string: False
email string Y User email
Example: [email protected]
Allow empty: False
Allow empty string: True
$isEmail: True
mobile string Phone number
Example: 1762xxx9836
Allow empty: False
Allow empty string: False
exterId string Unique ID of the third-party account system, this field value is unique when it exists (the username field can be repeated)
Example: 29ab8d31-ac52-4485-a572-f4cf25d355d9
Allow empty: False
Allow empty string: False
extend json Additional information
Allow empty: True
language string Language information
Example: en
Allow empty: True
Allow empty string: True
Optional values: ['zh', 'en']
isDisable boolean Whether disabled
Example: True
Allow empty: False
Optional values: [True, False]
attributes json Account attribute information (JSON structure, KV structure, V part should use strings whenever possible, applicable for automatic updates during SSO login)
Example: {'Department': 'A Department'}
Allow empty: False
customAttributes json Custom attribute information of the account (JSON structure, KV structure, V part should use strings whenever possible, only applicable for business-side updates)
Example: {'Department': 'A Department'}
Allow empty: False

Supplementary Parameter Explanation

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": "[email protected]", "password": "xxx", "name": "lwc_xxxx_002", "email": "[email protected]"}'

Response

{
    "code": 200,
    "content": {
        "attributes": {},
        "canaryPublic": false,
        "createAt": 1715322612,
        "creator": "SYS",
        "deleteAt": -1,
        "email": "[email protected]",
        "enableMFA": false,
        "extend": null,
        "exterId": "",
        "id": 3026,
        "isUsed": 0,
        "language": "en",
        "mfaSecret": "*********************",
        "mobile": "",
        "name": "xxxx",
        "nameSpace": "",
        "status": 0,
        "statusPageSubs": 0,
        "timezone": "",
        "tokenHoldTime": 604800,
        "tokenMaxValidDuration": 2592000,
        "updateAt": 1715322612,
        "updator": "SYS",
        "username": "[email protected]",
        "uuid": "acnt_67792938b21148ff8f2b17afdbd92c27"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-9833FF30-E419-42E1-B999-047E609D4EE3"
}