# User

{% hint style="warning" %}
**All parameters  of type INTEGER listed in the Bybit API docs need to be passed in as a string.**
{% endhint %}

## Create Sub UID

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/create-subuid>
{% endhint %}

#### Function name:

```javascript
createSubUid(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function createSubUid(exchange, options) {
    try {
        let result = await exchange.createSubUid(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createSubUid(myByBitAccount, 
    {
        username: "bill",
        memberType: "1"
    });
```

## Create Sub UID API Key

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey>
{% endhint %}

#### Function name:

```javascript
createSubUidApiKey(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function createSubUidApiKey(exchange, options) {
    try {
        let result = await exchange.createSubUidApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createSubUidApiKey(myByBitAccount, 
    {
       subuid: "62874117",
       readOnly: "0",
       permissions: {
           Spot: ["SpotTrade"]
       }
   });
```

## Get Sub UID List

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/subuid-list>
{% endhint %}

#### Function name:

```javascript
getSubUidList(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getSubUidList(exchange, options) {
    try {
        let result = await exchange.getSubUidList(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSubUidList(myByBitAccount);
```

## Freeze Sub UID

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline>
{% endhint %}

#### Function name:

```javascript
freezeSubUid(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function freezeSubUid(exchange, options) {
    try {
        let result = await exchange.freezeSubUid(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await freezeSubUid(myByBitAccount, 
    {
       subuid: "62874117",
       frozen: "1"
     });
```

## Get API Key Information

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/apikey-info>
{% endhint %}

#### Function name:

```javascript
getApiKeyInfo(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getApiKeyInfo(exchange, options) {
    try {
        let result = await exchange.getApiKeyInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getApiKeyInfo(myByBitAccount);
```

## Modify Master API Key

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/modify-master-apikey>
{% endhint %}

#### Function name:

```javascript
modifyMasterApiKey(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function modifyMasterApiKey(exchange, options) {
    try {
        let result = await exchange.modifyMasterApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await modifyMasterApiKey(myByBitAccount, 
    {
        permissions:{
            NFT:[
                "NFTQueryProductList"
            ]
        }
    });
```

## Modify Sub API Key

{% hint style="warning" %}
This function is under construction and may not behave as expected
{% endhint %}

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/modify-sub-apikey>
{% endhint %}

#### Function name:

```javascript
modifySubApiKey(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitSubAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function modifySubApiKey(exchange, options) {
    try {
        let result = await exchange.modifySubApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await modifySubApiKey(myByBitSubAccount , 
    {
        permissions:{
            NFT:[
                "NFTQueryProductList"
            ]
        }
    });
```

## Delete Master API Key

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/rm-master-apikey>
{% endhint %}

#### Function name:

```javascript
deleteMasterApiKey(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function deleteMasterApiKey(exchange, options) {
    try {
        let result = await exchange.deleteMasterApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await deleteMasterApiKey(myByBitAccount);
```

## Delete Sub API Key

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/user/rm-sub-apikey>
{% endhint %}

#### Function name:

```javascript
deleteSubApiKey(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function deleteSubApiKey(exchange, options) {
    try {
        let result = await exchange.deleteSubApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await deleteSubApiKey(myByBitAccount);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/bybit-functions/user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
