Skip to main content

Cancel Query

POST 

/v2/auto/queries/:queryId/cancel

Plan Access
All plans, billed per query in credits
Data Recency
Continuous evaluation against live data
Rate Limit
60 to 120 RPM by plan

Cancel an active query.

Only queries in active status can be cancelled. Queries already in a terminal state return 409 Conflict. This endpoint does not delete query records; use DELETE /v2/auto/queries/{queryId} after a terminal status when you need soft-delete behavior.

Cost

Free.

Auth

Required header (always):

x-elfa-api-key: <api_key>

HMAC is conditional — required when the stored query has a trade-flavoured action (market_order, limit_order, or llm callback to those). NOT required when the stored query is notification-only. If the stored query cannot be looked up, HMAC is enforced (fail-safe).

When HMAC is required, also send:

x-elfa-timestamp: <unix_seconds>
x-elfa-signature: <hex_hmac_sha256>

Signing payload: timestamp + method + path + body. For this route, sign with path = "/queries/{queryId}/cancel" and body = "".

Request Example

Path parameter:

  • queryId (string)

Response Example (200)

{
"id": "a12d20ff-6cb2-433e-afed-cc2e6a0380b6",
"status": "cancelled",
"cancelledAt": "2026-04-01T12:00:00.000Z"
}

Best practice: keep cancellation idempotent in your client workflow; treat repeated cancel attempts as safe no-op behavior.

Request

Responses

Ok