API ReferenceExecution
Build one bounded batch-cancel intent for 1-20 owned executions
const url = 'https://exec.predictefy.com/v1/exec/hyperliquid/orders/batch-cancel';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"executionIds":["5f0c2a9e-0f0e-4b4f-9a57-0a0d8b2c1d11","2b7d4c10-6a3e-4f0e-8e8b-1c2d3e4f5a6b"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://exec.predictefy.com/v1/exec/hyperliquid/orders/batch-cancel \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "executionIds": [ "5f0c2a9e-0f0e-4b4f-9a57-0a0d8b2c1d11", "2b7d4c10-6a3e-4f0e-8e8b-1c2d3e4f5a6b" ] }'Requires Authorization: Bearer <api-key> with the trade scope and a unique
Idempotency-Key. The body is a set of 1-20 executionIds owned by the calling account at
this venue. Every target is loaded under the caller's account and venue with the SAME
tenancy and terminal-state checks as the single cancel route: unknown or another tenant's
id answers 404, a failed, canceled or expired target answers 409 EXECUTION_TERMINAL, and a duplicate id answers 400. Nothing is canceled by this call.
The response is a new cancel build with its own executionId. Submit it through
POST /v1/exec/{venue}/orders/submit with the caller's own transient venue credential,
exactly like a single cancel.
- Gemini, while the hosted API has order types enabled, maps the targets' stored venue
order ids into the documented
orderIdsarray and submits onePOST /v1/prediction-markets/order/batch/cancel. On submit, the execution iscanceledonly when every entry returnedresult: "ok". A partial or refused batch isfailedwith a bounded actionable summary, andsubmittedArtifact.resultscarries exactly one outcome per request entry, in request order. Batch PLACE is not exposed. - Limitless, while the hosted API has Limitless order types enabled, sends ONE
POST /orders/batch-cancelwith the targets' stored venue order ids and the bound wallet's server-verified numeric profile id asonBehalfOf. It never calls the wallet-wideDELETE /orders/all/{slug}, so another account using the same wallet and orders placed outside Predictefy are untouched. Every target must belong to one wallet and one Limitless profile. On submit, the execution iscanceledonly when every entry is confirmed; a partial or refused batch isfailed, andsubmittedArtifact.resultscarries one closed-code outcome per requested id, in request order. A batch refused before any venue cancel (mixed wallets or profiles, a wallet that is not a Core partner sub-account, or a target with no venue order id yet) answers400 BATCH_CANCEL_REFUSEDand its metered cancel debit is refunded. - Polymarket, while the deployment enables batch cancel, builds ONE
DELETE /orderscarrying exactly the targets' stored venue order ids. It never calls the venue's market-wide or account-wide cancel endpoints. Only orders the server itself relayed and the venue acknowledged on the submit path are eligible: an execution acknowledged through the client-direct route is refused. All targets must share one stored owner. On submit,submittedArtifact.resultscarries one entry per order id in request order, and the row iscanceledonly when every entry confirmed; entry failures use the closedCANCEL_ACTION_*codes. - Every other venue answers
501 NOT_IMPLEMENTED, as do Gemini or Limitless while their order types are not enabled, and Polymarket while batch cancel is not enabled.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Execution venue slug. Discover available execution venues with GET /v1/exec/venues. Settlement-only venues may appear but report order verbs false.
Header Parameters
Section titled “Header Parameters”Caller-generated non-empty key. Build/cancel/modify keys identify newly persisted intents; a submit key identifies that relay attempt and cannot be rebound to another ID. The literal strings undefined and null are rejected with 400 VALIDATION_ERROR, so a client that stringified a missing key cannot bind or replay one. Two prefixes are RESERVED by the execution service for keys it mints itself and are rejected with 400 RESERVED_IDEMPOTENCY_KEY before anything is written: cond: (a hosted conditional order's own fire key) and dry-run: (the preview key handed to a venue integration). The match is case-sensitive.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Owned execution ids to cancel. Each target keeps the caller's order: the venue receives their stored order ids in this order, and the submit response's per-entry results line up with it. Unknown or another tenant's ids answer 404; terminal targets answer 409.
Examples
Cancel two of the caller's own Gemini orders
{ "executionIds": [ "5f0c2a9e-0f0e-4b4f-9a57-0a0d8b2c1d11", "2b7d4c10-6a3e-4f0e-8e8b-1c2d3e4f5a6b" ]}Cancel two of the caller's own Limitless orders
{ "executionIds": [ "7c1e5b30-4a2d-4f8e-9b6c-1d2e3f4a5b6c", "8d2f6c41-5b3e-4a9f-8c7d-2e3f4a5b6c7d" ]}Cancel two of the caller's own Polymarket orders
{ "executionIds": [ "5f0c2a9e-0f0e-4b4f-9a57-0a0d8b2c1d11", "2b7d4c10-6a3e-4f0e-8e8b-1c2d3e4f5a6b" ]}Responses
Section titled “Responses”New unsigned batch-cancel execution. A duplicate key returns the original build.
object
object
acked means the venue accepted/relayed the artifact; it does not by itself prove the order is resting. Use the status/refresh operations for confirmation.
object
Fixed-point whole-contract count, for example 5.00.
Fixed-point whole-cent probability strictly between zero and one.
Present only when the build requested reduceOnly; never false.
object
object
Validated client-signed or authless relayed artifact, or null before submission. Polymarket US submitted artifacts exclude keyId, secretKey, timestamp, and auth headers.
Venue fee estimate or null when no verified model is available. Polymarket estimates carry fee, unit: "usd" and takerOnly; fee is a taker fee estimate in USD. Both sides settle it in pUSD collateral on the V2 exchange, and Polymarket charges makers no fee.
The platform end-user reference supplied on build, or null when the order was not attributed. Present while the platform-accounts feature is enabled; omitted otherwise.
Present on Hyperliquid HIP-4 order builds and their persisted responses.
object
First-party HIP-4 outcome assets have no perp-DEX component.
Present only on a member of a Hyperliquid multi-order action. Every order of that action shares this id and its own groupIndex.
Zero-based position of this order in the group action. It aligns this row with the venue's positional statuses[] ack.
Optional pre-signing advisories. Polymarket and Opinion order builds currently warn that venue regional restrictions reject hosted submission from Predictefy. Rain warns when a pool's official origin cannot be verified. Hyperliquid warns when spendable spot USDC (total minus hold) is below order notional. It names the shortfall and points to POST /v1/funding/hyperliquid/steps. A failed balance read omits this advisory and does not block the build. PRED build currently returns 404, so no advisory is returned. If PRED execution becomes available, its advisory warns that venue key binding rejects platform-key submission for a caller-owned Safe maker. Builds and client signing remain available for supported venues. Callers may use their own submit path or, for PRED, credentials from their own venue arrangement.
Example
{ "success": true, "data": { "intent": "order", "status": "built", "unsigned": { "side": "bid", "time_in_force": "good_till_canceled", "self_trade_prevention_type": "taker_at_cross", "reduce_only": true }, "collateral": { "ledger": "spot" } }}Headers
Section titled “Headers”Present with value true when stored state satisfied an idempotent retry.
Invalid route query, body, or lifecycle state.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Missing, invalid, unknown, or revoked Predictefy API key.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The request breaches a spend cap or the account lacks endpoint credits.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The API key lacks trade scope, or the venue does not allow trading from your country. Where the venue allows closing only, GEO_BLOCKED is returned when the stored order is neither a sell nor a redemption. Cancelling an existing order is always allowed.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The venue integration is absent or the execution is missing/not owned by the caller.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The submit key is already bound to a different execution, or the persisted server-built artifact uses incompatible construction semantics, or Gemini rejected a key whose nonce or heartbeat setting is unsafe for a stateless relay, or a conditional order on this execution is still live or was closed as not_submitted, or the target execution named by a cancel has already finished. An outstanding marker bound to another client attempt returns CONDITIONAL_ATTEMPT_CONFLICT before submission is recorded or relayed.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The authenticated execution token bucket is exhausted.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Unexpected failure or an unsigned artifact escaped its registered bounds.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}The runtime venue integration does not implement this lifecycle verb.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}