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:
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Sign up on Hyperliquid โ
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".
| Role | Documented response | Data 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 |
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.