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

# userRole | Hyperliquid Info API

> Hyperliquid userRole: fetch a user's account role.

<CardGroup cols={2}>
  <Card title="Credit Cost"> 1 per call</Card>
  <Card title="Processing"> Realtime</Card>
</CardGroup>

The Hyperliquid info endpoint with `type: "userRole"` is used to fetch a user's account role.

<Tip>
  Estimate your monthly cost for this API using the [Pricing Calculator](/docs/pricing-calculator?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fuser-role).
</Tip>

<Info>
  * Wire-equal to `POST api.hyperliquid.xyz/info` with `{"type": "userRole", "user": "..."}`.
  * The `role` value is one of `missing`, `user`, `agent`, `vault`, or `subAccount`.
  * The `subAccount` and `agent` roles additionally carry a `data` object identifying the controlling master account.
</Info>

Returns the role a wallet plays on HyperCore. Most trading wallets are plain `user` accounts; this type also distinguishes API `agent` wallets, `vault` addresses, and `subAccount`s. For a `subAccount` (and for an `agent`), a nested `data` object carries the `master` account address that controls the wallet.

User-keyed.

## Endpoint

```
POST https://hypercore.goldrushdata.com/info
Authorization: Bearer <GOLDRUSH_API_KEY>
Content-Type: application/json
```

## Request

<ParamField body="type" type="string" required>
  Always `"userRole"`.
</ParamField>

<ParamField body="user" type="string" required>
  The wallet address (lowercase 0x-prefixed hex).
</ParamField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://hypercore.goldrushdata.com/info \
    -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "userRole",
      "user": "0x2b804617c6f63c040377e95bb276811747006f4b"
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://hypercore.goldrushdata.com/info", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.GOLDRUSH_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      type: "userRole",
      user: "0x2b804617c6f63c040377e95bb276811747006f4b",
    }),
  });

  const role = await response.json();
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.post(
      "https://hypercore.goldrushdata.com/info",
      headers={"Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"},
      json={
          "type": "userRole",
          "user": "0x2b804617c6f63c040377e95bb276811747006f4b",
      },
  )

  role = response.json()
  ```
</CodeGroup>

## Response

A single object with a `role` discriminator. A plain trading wallet returns `{"role": "user"}`; a sub-account additionally returns its controlling master under `data`.

```json theme={null}
{
  "role": "subAccount",
  "data": {
    "master": "0x399965e15d4e61ec3529cc98b7f7ebb93b733336"
  }
}
```

### Field descriptions

<ResponseField name="role" type="string">
  Account role. One of:

  * `missing` - the address has never interacted with HyperCore.
  * `user` - an ordinary trading account.
  * `agent` - an API agent (API wallet) that signs on behalf of a master.
  * `vault` - a vault address.
  * `subAccount` - a sub-account owned by a master account.
</ResponseField>

<ResponseField name="data" type="object">
  Present only for the `subAccount` and `agent` roles.

  <Expandable title="properties">
    <ResponseField name="master" type="string">Address of the master account that controls this sub-account / agent.</ResponseField>
  </Expandable>
</ResponseField>

*Last reviewed: 2026-07-24*
