๐Ÿ”Œ API & Developers

Hyperliquid userRole Info Endpoint: Request, Response Objects, and Python Example

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you. I only review tools I actually use.
The Hyperliquid info endpoint can identify the role of an address with the userRole request type. Send a POST request to https://api.hyperliquid.xyz/info with a JSON body containing type: "userRole" and the address to inspect.

This reference is based on the Hyperliquid info endpoint documentation.

Request format

Use the Content-Type: application/json header and send:

{
  "type": "userRole",
  "user": "0x0000000000000000000000000000000000000000"
}

The user field should be the address you want to query. The documentation describes user addresses as hexadecimal addresses, for example 0x0000000000000000000000000000000000000000.

A plain HTTP example:

curl -X POST https://api.hyperliquid.xyz/info \
  -H 'Content-Type: application/json' \
  -d '{"type":"userRole","user":"0x0000000000000000000000000000000000000000"}'

Python request example

This is a plain HTTP example, not an official SDK method:

๐Ÿ’ก Hyperliquid

Like what you're reading? Try it yourself โ€” this link supports ChartedTrader at no cost to you.

Sign up on Hyperliquid โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

import requests

def get_user_role(address: str) -> dict:
    response = requests.post(
        "https://api.hyperliquid.xyz/info",
        json={"type": "userRole", "user": address},
        headers={"Content-Type": "application/json"},
        timeout=10,
    )
    response.raise_for_status()
    return response.json()

## Example:
## role = get_user_role("0x0000000000000000000000000000000000000000")

Documented response objects

The role field can be "missing", "user", "agent", "vault", or "subAccount".

RoleDocumented responseData fields shown
User{"role":"user"}None shown in the documented example
Agent{"role":"agent", "data": {"user": "0x..."}}data.user
Vault{"role":"vault"}None shown in the documented example
Sub-account{"role":"subAccount", "data": {"master": "0x..."}}data.master
Missing{"role":"missing"}None shown in the documented example
For agent and subAccount, the response includes a data object. The documented examples show data.user for agent responses and data.master for sub-account responses.

Address selection note

When querying account data for a master or sub-account, the documentation says to pass the actual address of that account. It also notes that using an agent wallet's address can lead to an empty result. If you are checking whether an agent address is related to a master account, use the address you want to inspect and interpret the returned role and data fields accordingly.

For related agent-wallet context, see Hyperliquid API Agent Wallet Setup & Permissions (2026) and Hyperliquid API Agent Wallet: Revoke & Fix (2026).

Affiliate disclosure

This article contains a Hyperliquid referral link. If you sign up through Sign up on Hyperliquid, we may receive a commission. The referral benefit is a 4% fee discount on the first $25M of volume per account; Vaults and sub-accounts are excluded.

Continue with Hyperliquid

Browse the Hyperliquid guide hub for the complete user journey.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support ChartedTrader at no cost to you.

Sign up on Hyperliquid โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Every tool reviewed here is something I've used with real capital. Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”Œ
API & Developers

Hyperliquid subAccounts Info Endpoint: List Subaccount Addresses (Python Example)

POST type subAccounts to Hyperliquid's info endpoint with a user address to get subaccount names, addresses, master address, clearinghouse, and spot state.

November 13, 2026 โฑ 3 min read
๐Ÿ”Œ
API & Developers

Hyperliquid HIP-3: user_fills dex Parameter Missing Fix (2026)

Fix HIP-3 fill tracking on Hyperliquid by parsing the dex prefix from coin, paging userFillsByTime, and using documented WebSocket userFills subscriptions.

July 11, 2026 โฑ 7 min read
๐Ÿ”Œ
API & Developers

Hyperliquid API Websocket Guide for Developers (2026)

Connect to Hyperliquid WebSocket endpoints, subscribe to basic feeds, send post requests, and keep the connection alive with ping/pong and reconnect handling.

July 29, 2026 โฑ 8 min read