For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/gateway/prepare-modify-triggers.md.

Prepare moving resting DeFi TP/SL orders to new trigger prices

Organization tokenNo token

POST
/orders/modify/{id}/prepare

Prepares one Hyperliquid batch modify, under the client-chosen batch id, moving each listed order to its new trigger price, and returns the single unsigned payload the client signs and posts to POST /orders/modify/{id}/execute with the same id. Reusing an id that is already prepared returns 409. Every order must be the caller's active DeFi TP/SL trigger order on the same account; each keeps the slippage bound it was placed with, scaled to its new trigger. A trigger price on the wrong side of the current price returns 400; an order that is no longer open returns 422 with code order_not_open.

Rate limit: counts against the Orders limit, 10 a second and 120 a minute (user token, per user); 100 a second and 1,200 a minute (organization api key, per organization). See Rate limits.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

An access token from POST /v1/auth/api-key/token. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.

Path Parameters

id*string

Client-chosen batch id, reused for POST /orders/modify/{id}/execute

Formatuuid

Header Parameters

TM-On-Behalf-Of?string

Act as one of your organization's users. The value is the user_id returned when the user was created; the request then reads and writes that user's account. Requires an organization token and a user your organization created: 400 for a personal token, a repeated header or a non-UUID, 403 for a user outside your organization. Not accepted on organization-scoped routes.

Formatuuid

Request Body

application/json
  1. body
orders*array<>
Items1 <= items

Response Body

Unsigned batch payload to sign and execute

application/json
  1. response
payloads?array<>

The single payload to sign for the whole batch.

Example Request
curl -X POST 'https://api.truemarkets.co/v1/gateway/orders/modify/497f6eca-6276-4993-bfeb-53cbbbba6f08/prepare' \  -H 'TM-On-Behalf-Of: 3f6d2c0e-8a41-4c2b-9f1e-2b7d5c0a9e11' \  -H 'Content-Type: application/json' \  -d '{  "orders": [    {      "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe",      "trigger_price": "2300"    }  ]}'
Example Response
{  "payloads": [    {      "digest": "string",      "payload": "string"    }  ]}