Skip to content

Create



POST /api/v1/account/add

Overview

Body Parameters

Parameter Type Required Description
brandKey string Brand Key
Example: truewatch
Allow Empty: False
username string Y Login Username (Must be unique when exterId does not exist)
Example: test_wang
Allow Empty: True
Allow Empty String: True
password string Y Login Password (When 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
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 Identifier ID from a third-party account system. When this field exists, its value must be unique (username field can be duplicated)
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: zh
Allow Empty: True
Allow Empty String: True
Options: ['zh', 'en']
isDisable boolean Whether Disabled
Example: True
Allow Empty: False
Options: [True, False]
attributes json Account Attribute Information (JSON structure, KV structure, V part should preferably use strings, 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 preferably use strings, only applicable for updates from the business side)
Example: {'Department': 'A Department'}
Allow Empty: False

Parameter Additional 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": "[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": "zh",
        "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"
}