Skip to main content
Hyperliquid
POST/exchange

Request Headers

string
required
Must be application/json

Request Body

object
required
Signed margin-update action. The account must have isolated mode selected for the market and an active isolated assignment there. Removing margin is limited to posted cash and Hyperliquid’s margin requirement.
number
required
Replay-protection nonce in Unix milliseconds. Resend the identical signed request for retries.
object
required
Account owner or approved API wallet; use the exchange signing format.
string
Optional account-owner address. Rejects the request if the verified signer currently maps to another account. This unsigned check does not select an account or grant access.
number
Optional signed deadline in Unix milliseconds; requests after it are rejected

Response

Response Fields

string
"ok" when an update result is returned; "err" for a rejected numeric-asset request. Hexadecimal-asset requests report failures in response.data.status.
object | string
Object when status is "ok", or a rejection message when status is "err". An HTTP timeout or disconnect does not establish failure; HTTP 503 can also leave the outcome uncertain.
string
Numeric-asset requests return "default" when completed or "pending" when unresolved after waiting up to three seconds. Hexadecimal-asset requests return "updateIsolatedMargin". Completion confirms the margin change. Removed margin stays unavailable in cross collateral until its return transfer completes.
string
Present for pending numeric-asset responses and every hexadecimal-asset result. Save this ID to track completion on User Transactions: match transaction.transactionId and read transaction.accountUpdateResponse. Retry the original signed request to recover its recorded result without submitting another update.
string
Hexadecimal-asset requests only: "completed", "pending", or "failed". Pending return transfers are reported in isolated.scope.pendingReleaseUsdc on activeAssetData.
string
Failure message for a "failed" hexadecimal-asset result.
string
Error code for a "failed" hexadecimal-asset result; see Errors.
string
Optional structured reason for a "failed" hexadecimal-asset result: "margin_required" when Hyperliquid requires the margin to remain in the position.

Errors

Numeric-asset requests return these messages in response with status: "err"; hexadecimal-asset requests return them in response.data. User Transactions reports the code in transaction.accountUpdate.code.