Skip to content
Docs
Open Legend

About

AboutGetting startedWhat is Legend?Why are we building this?Who is this for?

Platform

Web appiOSAndroidTelegram

Trading

TradingOrder typesDeposits and withdrawalsRanks

Capital

Legend CapitalCapital Affiliate Rewards

Autocopy

Copy tradingAutocopyLimits and safeguards

Social

SocialActivityFeedClansChat

Rewards

Referrals and rewards

API reference

Trading APIAuthentication and API keysAPI key actionsOrdersAccount, positions, and fillsLeverage, margin, and TWAPsRate limitsErrors and idempotency

Legend Research

Connect Legend to an AI assistantConnector permissionsMCP tools and order review

Fees

Fees

Support

FAQ
Trade onLEGEND

Trade where legends are made.

Download on theApp StoreGet it onGoogle Play
Product
TradeMobile app
Resources
BlogLearnFAQDocsCareers
© 2026 Legend. All rights reserved.
Privacy policyTerms of service
Ctrl K

Legend documentation

API key actions

Request parameters and responses for api key actions.

View Markdown ↗
Authentication and API keysPreviousOrdersNext

All paths are relative to the base URL. See authentication and errors and idempotency.

Register a wallet-signed API grant

POST /v1/api-keys

Requires the main account owner’s EIP-712 signature. Copy-wallet key creation is rejected with main_account_required; non-mainnet grants are rejected with mainnet_required.

Request body

FieldTypeRequiredDetails
consentobjectYes
consent.accountstringYesFormat: uuid
consent.networkstringYeshyperliquid_mainnet
consent.key_hashstringYes
consent.policyobjectYes
consent.policy.scopesarrayYes
consent.issued_atintegerYesMaximum: 8640000000000000
consent.expires_atnullNoDefault: null
signaturestringYes

Example request

curl -X POST "$LEGEND_API_BASE/v1/api-keys" \
  -H "Content-Type: application/json" \
  --data @signed-request.json

Response

FieldTypeRequiredDetails
objectstringYesapi_key
accountstringYes
networkstringYes
key_hashstringYes
scopesarrayYes
expires_atstring or nullYes

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "object": "api_key",
  "account": "00000000-0000-4000-8000-000000000001",
  "network": "hyperliquid_mainnet",
  "key_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "scopes": ["trading:read", "trading:write"],
  "expires_at": null
}

Revoke a key with the account owner signature, including before registration

POST /v1/api-keys/revoke

Requires the account owner’s EIP-712 signature.

Request body

FieldTypeRequiredDetails
accountstringYesFormat: uuid
key_hashstringYes
signaturestringYes

Example request

curl -X POST "$LEGEND_API_BASE/v1/api-keys/revoke" \
  -H "Content-Type: application/json" \
  --data @signed-request.json

Response

FieldTypeRequiredDetails
objectstringYesapi_key
key_hashstringYes
revokedbooleanYesTrue

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "object": "api_key",
  "key_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "revoked": true
}