Skip to content

Create



POST /api/v1/account/add

Overview

Body Parameters

Parameter Type Required Description
brandKey string Brand Key
Example: guance
Allow Null: False
username string Y Login Username (Must be unique when exterId is not present)
Example: test_wang
Allow Null: True
Allow Empty String: True
password string Y Login Password (Should be set to an empty string for third-party login accounts when password is empty)
Example: I am password
Allow Empty String: True
Allow Null: True
name string Y Nickname
Example: test_wang
Allow Null: False
Allow Empty String: False
email string Y User Email
Example: xxx@guance.com
Allow Null: False
Allow Empty String: True
$isEmail: True
mobile string Mobile Phone Number (local number); Legacy 11-digit Chinese mobile numbers will be compatible with countryCode=86
Example: 1762xxx9836
Allow Null: False
Allow Empty String: False
countryCode string Mobile Phone Country/Region Code
Example: 86
Allow Null: False
Allow Empty String: True
exterId string Unique identifier ID from a third-party account system. When this field exists, its value must be unique (username field can be duplicate).
Example: 29ab8d31-ac52-4485-a572-f4cf25d355d9
Allow Null: False
Allow Empty String: False
extend json Additional Information
Allow Null: True
language string Language Information
Example: zh
Allow Null: True
Allow Empty String: True
Options: ['zh', 'en', 'zh-hant', 'id']
isDisable boolean Whether Disabled
Example: True
Allow Null: False
Options: [True, False]
attributes json Account Attribute Information (JSON structure, KV pairs, V part should preferably be strings, applicable for automatic updates during SSO login)
Example: {'部门': 'A部门'}
Allow Null: False
customAttributes json Account Custom Attribute Information (JSON structure, KV pairs, V part should preferably be strings, only applicable for updates by the business side)
Example: {'部门': 'A部门'}
Allow Null: False

Parameter Supplementary 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"
} 

Feedback

Is this page helpful? ×