Skip to main content
POST
Set TP/SL

Path Parameters

string
required
The public key of the margin position.

Body Parameters

string
Take-profit trigger price.
string
Stop-loss trigger price.
The server decides which fields to update from which JSON keys appear in the body, not only non-null values. Include take_profit_price and/or stop_loss_price keys to write those columns; you may set a value to null to clear that side. Omitting both keys returns a validation error.
Take-profit and stop-loss are not supported for Hyperliquid margin positions on this API. Those positions return 501 Not Implemented with error code 9201 and a message explaining the limitation. TP/SL applies to Polymarket-routed margin positions when the market supports it.

Response

object
TP/SL state payload.
object
Empty object on success for this endpoint.
object | null
null on success. Error object on failed requests.