Create Sub UID
Create a new sub user id. Use master account's api key.
tip
The API key must have one of the below permissions in order to call this endpoint
- master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"
HTTP Request
POST /v5/user/create-sub-member
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
username | true | string | Give a username of the new sub user id.
|
password | false | string | Set the password for the new sub user id.
|
memberType | true | integer | 1 : normal sub account, 6 : custodial sub account |
switch | false | integer |
|
isUta | false | boolean | deprecated param, always UTA account |
note | false | string | Set a remark |
Response Parameters
Parameter | Type | Comments |
---|---|---|
uid | string | Sub user Id |
username | string | Give a username of the new sub user id.
|
memberType | integer | 1 : normal sub account, 6 : custodial sub account |
status | integer | The status of the user account
|
remark | string | The remark |
Request Example
- HTTP
- Python
- Node.js
POST /v5/user/create-sub-member HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXXXX
X-BAPI-API-KEY: XXXXXXX
X-BAPI-TIMESTAMP: 1676429344202
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"username": "xxxxx",
"memberType": 1,
"switch": 1,
"note": "test"
}
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.create_sub_uid(
username="xxxxx",
memberType=1,
switch=1,
note="test",
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.createSubMember({
username: 'xxxxx',
memberType: 1,
switch: 1,
note: 'test',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Response Example
{
"retCode": 0,
"retMsg": "",
"result": {
"uid": "53888000",
"username": "xxxxx",
"memberType": 1,
"status": 1,
"remark": "test"
},
"retExtInfo": {},
"time": 1676429344734
}