> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monochrome.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoints

> User center API: endpoints.

## Query account list（applicable to  master and sub account）

`GET` `/v4/user/account`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| accountId | string | false | | account id | |
| accountName | string | false | | account name | |
| level | integer | false | | account level | 1:master account; 2:sub account |

```json Response theme={null}
{
  "rc": 0,
  "mc": "SUCCESS",
  "ma": [
    {}
  ],
  "result": [
    {
        "id": "1352123154436",                     //account id
        "accountName": "master1",                  //account name
        "userId": 1352123154435,                   //user id
        "level": 1,                                //account level: 1-master account; 2-sub account
        "createTime": "2022-04-19 02:02:42",       //account creation time
        "updateTime": "2022-04-19 02:02:42"        //account update time
    }, 
    {
        "id": "1626456841938669570",               //account id
        "accountName": "first1",                   //account name
        "userId": 1352123154436,                   //user id
        "level": 2,                                //account level: 1-master account; 2-sub account
        "createTime": "2023-02-17 05:41:43",       //account creation time
        "updateTime": "2023-02-17 05:41:43"        //account update time
    }
  ]
}
```

## create a sub-account

`POST` `/v4/user/account`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| accountName | string | true | | sub-account name | |

```json Response theme={null}
{
  "rc": 0,
  "mc": "SUCCESS",
  "ma": [
    {}
  ],
  "result": true  //true: success; false/null: unsuccess
}
```

## Query user's apiKey (applicable to  master and sub account)

`GET` `/v4/user/account/api-key`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| userAccountId | string | false | | account id | |
| keyName | string | false | | apiKey name | |
| isLock | integer | false | | apiKey is locked or not | 0：apiKey is not locked；1：apiKey is locked |

```json Response theme={null}
{
  "rc": 0,
  "mc": "SUCCESS",
  "ma": [
    {}
  ],
  "result": [
    {
        "id": 1,                     
        "userAccountId": "1352123154435",                         //account id
        "userAccountLevel": 1,                                    //account level: 1-master account; 2-sub account
        "userId": 1352123154435,                                  //user id
        "keyName": "abc",                                         //apiKey name
        "bindIps": "",                                            //bind ip list
        "accessKey": "b5e58714-2382-4e2f-8762-81b5ec9d363a",      //encryption key
        "secretKey": "17aef63c0cba308089fae03e2b13a4794bd2d411",  //encryption string
        "isLock": 0,                                              //isLock: 0-apiKey is not locked；1-apiKey is locked
        "roleScopes": "QUERY_TRADE",                              //permissions code: QUERY_TRADE: trade is enabled; QUERY_NO_TRADE: trade is not enabled
        "tags": null,                                             //tags
        "createTime": "2023-02-17 05:41:43",                      //apiKey create time
        "updateTime": "2023-02-17 05:41:43"                       //apiKey update time
    }, 
    {
        "id": 2,                     
        "userAccountId": "13523123154435",                        //account id
        "userAccountLevel": 1,                                    //account level: 1-master account; 2-sub account
        "userId": 1352123154435,                                  //user id
        "keyName": "bcd",                                         //apiKey name
        "bindIps": "",                                            //bind ip list
        "accessKey": "b5e58714-2382-4e2f-8762-81b5ec9d363a",      //encryption key
        "secretKey": "17aef63c0cba308089fae03e2b13a4794bd2d411",  //encryption string
        "isLock": 0,                                              //isLock: 0-apiKey is not locked；1-apiKey is locked
        "roleScopes": "QUERY_TRADE",                              //permissions code: QUERY_TRADE: trade is enabled; QUERY_NO_TRADE: trade is not enabled
        "tags": null,                                             //tags
        "createTime": "2023-02-17 05:41:43",                      //apiKey create time
        "updateTime": "2023-02-17 05:41:43"                       //apiKey update time
    }
  ]
}
```

## Create user account apiKey

`POST` `/v4/user/account/api-key`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| userAccountId | string | true | | account id | |
| keyName | string | true | | apiKey name | |
| bindIps | string | false | | bind ip list, multiple can be separated by commas | |
| roleScopes | string | true | | permissions code | QUERY：query is enabled; TRADE：spot and margin trade is enabled; WITHDRAW：withdraw is enabled; LEVER\_LOAN：margin pledged is enabled; FUTURE：future trade is enabled; TRANSFER：transfer is enabled |
| tags | string | false | | tags | |

```json Response theme={null}
{
  "rc": 0,
  "mc": "SUCCESS",
  "ma": [
    {}
  ],
  "result": {
     "id": 4564,                                             //apiKey id
     "userAccountId": "1626456841938669570",                 //account id
     "userAccountLevel": 2,                                  //account level: 1-master account; 2-sub account
     "userId": 1352123154435,                                //user id
     "keyName": "123aaa",                                    //apiKey name
     "bindIps": null,                                        //bind ip list
     "accessKey": "99258227-f053-46a2-9b10-66c155eb705c",    //encryption key
     "secretKey": "4b1839e11bf7a1c6de5f078bd9f4b6e0850da3cf",//encryption string
     "isLock": 0,                                            //isLock: 0-apiKey is not locked；1-apiKey is locked
     "roleScopes": "QUERY_TRADE",                            //permissions code: QUERY_TRADE: trade is enabled; QUERY_NO_TRADE: trade is not enabled
     "tags": null,                                           //tags
     "createTime": "2023-02-20 07:39:56.768",                //apiKey create time
     "updateTime": "2023-02-20 07:39:56.768"                 //apiKey update time
  }
}
```

## Modify user account apiKey

`PUT` `/v4/user/account/api-key`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| id | string | true | | apiKey id | |
| accessKey | string | true | | access key | |
| keyName | string | false | | apiKey name | |
| bindIps | string | false | | bind ip list, multiple can be separated by commas | |
| roleScopes | string | true | | permissions code | QUERY：query is enabled; TRADE：spot and margin trade is enabled; WITHDRAW：withdraw is enabled; LEVER\_LOAN：margin pledged is enabled; FUTURE：future trade is enabled; TRANSFER：transfer is enabled |
| tags | string | false | | tags | |

```json Response theme={null}
{
  "rc": 0,
  "mc": "SUCCESS",
  "ma": [
    {}
  ],
  "result": {
     "id": 4564,                                             //apiKey id
     "userAccountId": "1626456841938669570",                 //account id
     "userAccountLevel": 2,                                  //account level: 1-master account; 2-sub account
     "userId": 1352123154435,                                //user id
     "keyName": "123aaa",                                    //apiKey name
     "bindIps": null,                                        //bind ip list
     "accessKey": "99258227-f053-46a2-9b10-66c155eb705c",    //encryption key
     "secretKey": "4b1839e11bf7a1c6de5f078bd9f4b6e0850da3cf",//encryption string
     "isLock": 0,                                            //isLock: 0-apiKey is not locked；1-apiKey is locked
     "roleScopes": "QUERY_TRADE",                            //permissions code: QUERY_TRADE: trade is enabled; QUERY_NO_TRADE: trade is not enabled
     "tags": null,                                           //tags
     "createTime": "2023-02-20 07:39:56.768",                //apiKey create time
     "updateTime": "2023-02-20 07:39:56.768"                 //apiKey update time
  }
}
```

## Delete user account apiKey

`DELETE` `/v4/user/account/api-key/{apikeyId}`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| apikeyId | string | true | | apiKey id | |

```json Response theme={null}
{
  "rc": 0,
  "mc": "SUCCESS",
  "ma": [
    {}
  ],
  "result": true    //true: success; false/null: unsuccess
}
```

## Get All Users of Affiliate

`GET` `/v4/referal/invite/users`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| startTime | number | false | | start time | |
| endTime | number | false | | end time | |
| fromId | number | false | | Starting ID | |
| direction | string | false | NEXT | query direction | PREV, NEXT |
| limit | int | false | 10 | Limit number, max 100 | 1\<=limit\<=100 |

```json Response theme={null}
{
  "ma": [],
  "mc": "SUCCESS",
  "rc": 0,
  "result": {
    "hasNext": true,
    "hasPrev": true,
    "items": [
        {
        "id": 123,
        "regTime": 1721962593000, //Registration time
        "role": "PARTNER",        //User roles: CHANNEL/PARTNER/DIRECTOR
        "userId": 123456789       //User ID
        }
    ]
  }
}
```

## Get Deposit &  Trading Data of Users

`GET` `/v4/referal/invite/user/data`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| startTime | number | false | | start time | |
| endTime | number | false | | end time | |
| uid | number | true | | Queried user ID | |

```json Response theme={null}
{
  "ma": [],
  "mc": "SUCCESS",
  "rc": 0,
  "result": {
    "userId": 123456789,                //User ID
    "role": "PARTNER",                  //User role
    "deposit": true,                    //Deposit status
    "depositDetails": [
        {
            "amount": 100,              //Deposit amount
            "amountU": 100,             //Deposit amount (converted to USDT)
            "currency": "USDT",         //Deposit currency
            "timestamp": 1721962593000  //Deposit time
        }
    ],
    "trade": true,                      //Trade status
    "tradeAmount": 1000.1234            //Trading volume (converted to USDT)
  }
}
```

## Query user information

`GET` `/v4/referal/invite/single/user/info`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| uid | number | true | | User ID | |

```json Response theme={null}
{
  "ma": [],
  "mc": "SUCCESS",
  "rc": 0,
  "result": {
    "uid": 123456789,                //User ID
    "registerTime": 1737095389000,   //Registration Time
    "countryCode": "86",             //Country code
    "mobile": "123****4567",         //Phone number, desensitization
    "email": "639***3@gmail.com",    //Email address, desensitization
    "riskControlStatus": 0,          //Risk Control Status (0 - No Risk Control, 1 - Risk Controlled)
    "kycStatus": 2,                  //KYC Status (0 - Not Verified, 1 - Basic Verification, 2 - Advanced Verification, 3 - Corporate Verification)
    "registerInviteCode": 23456,     //Registration Invitation Code
  }
}
```

## Batch query user information

`GET` `/v4/referal/invite/multi/user/info`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| uidList | array | true | | User ID list | |
| fromId | number | false | | Starting ID | |
| direction | string | false | NEXT | query direction | PREV, NEXT |
| limit | int | false | 10 | Limit number, max 100 | 1\<=limit\<=100 |

```json Response theme={null}
{
  "ma": [],
  "mc": "SUCCESS",
  "rc": 0,
  "result": {
     "totalCount": 1,
     "pageCount": 20,
     "items": [
         {
            "uid": 123456789,                //User ID
            "registerTime": 1737095389000,   //Registration Time
            "countryCode": "86",             //Country code
            "mobile": "123****4567",         //Phone number, desensitization
            "email": "639***3@gmail.com",    //Email address, desensitization
            "riskControlStatus": 0,          //Risk Control Status (0 - No Risk Control, 1 - Risk Controlled)
            "kycStatus": 2,                  //KYC Status (0 - Not Verified, 1 - Basic Verification, 2 - Advanced Verification, 3 - Corporate Verification)
            "registerInviteCode": 23456,     //Registration Invitation Code
         }
     ]
   }
}
```

## Query user KYC status

`GET` `/v4/referal/invite/kyc/status`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| uid | number | true | | User ID | |

```json Response theme={null}
{
  "ma": [],
  "mc": "SUCCESS",
  "rc": 0,
  "result": {
    "userid": 123456789,                //User ID
    "status": 2,                     //KYC Status (0 - Not Verified, 1 - Basic Verification, 2 - Advanced Verification, 3 - Corporate Verification)
  }
}
```

## Query agent commission data

`GET` `/v4/referal/invite/agent/rebate/data`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| startTime | number | false | | Commission deposit start time | |
| endTime | number | false | | Commission deposit end time | |
| inviteCode | string | false | | Registration invitation code | |
| type | number | true | | Commission type | 1-spot 2-future |
| fromId | number | false | | Starting ID | |
| direction | string | false | NEXT | query direction | PREV, NEXT |
| limit | int | false | 10 | Limit number, max 100 | 1\<=limit\<=100 |

```json Response theme={null}
{
  "ma": [],
  "mc": "SUCCESS",
  "rc": 0,
  "result": {
     "totalCount": 1,
     "pageCount": 20,
     "items": [
        {
            "amountCurrency": 666,              //Currency amount
            "commission": 23,                   //Commission amount
            "currency": "usdt"                  //Commission currency
            "date": "2025-01-22T09:57:01.601Z", //Transaction date
            "makerAmount": 32,                  //Maker amount
            "rate": 2,                          //Commission rate
            "sourceType": 1,                    //Commission source type. 1 - Direct customer, 2 - Sub-agent
            "state": 1,                         //Commission state 0 - Normal, 1 - Abnormal
            "symbol": "btc_usdt",               //Symbol
            "takerAmount": 23,                  //Taker amount
            "totalCommissionUsdtAmount": 123,   //Total commission
            "totalTradeUsdtAmount": 2222,       //Total trading volume
            "type": 1,                          //Commission type. 1-spot 2-future
            "usdtAmount": 243253                //USDT amount
        }
     ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.