v2 Auto
Validate Query
Validate EQL syntax and get a cost estimate without creating a query. Returns simulation-based cost details when the query is valid.
Required Sequence (Enforced)
POST /v2/auto/queries/validate must be called before POST /v2/auto/queries.
Lifecycle sequencing after create:
- POST /v2/auto/queries/{queryId}/cancel while status is active.
- DELETE /v2/auto/queries/{queryId} only after status is terminal (triggered, expired, cancelled, failed).
Cost
Free.
Auth
Required header:
x-elfa-api-key: <api_key>
Request Example
{
"query": {
"conditions": {
"AND": [
{
"source": "price",
"method": "current",
"args": { "symbol": "BTC" },
"operator": ">",
"value": 100000
}
]
},
"actions": [
{
"stepId": "step_1",
"type": "notify",
"params": { "message": "BTC crossed target" }
}
],
"expiresIn": "24h"
},
"title": "BTC breakout alert",
"description": "Notify when BTC is above 100k so I can review the breakout setup."
}
Response Example (200)
{
"valid": true,
"errors": [],
"warnings": [],
"simulationLlmCallsEstimate": {
"conditionCallsUpperBound": 1,
"actionCallsUpperBound": 0,
"conditionCallsBySpeed": { "fast": 1, "expert": 0, "adaptive": 0 },
"actionCallsBySpeed": { "fast": 0, "expert": 0, "adaptive": 0 },
"autoActionCallsBySpeed": { "fast": 0, "expert": 0, "adaptive": 0 }
},
"estimatedCost": {
"credits": 30,
"price": "$0.270"
}
}
Best practice: always validate before create to catch schema issues and preview estimated cost.
post/v2/auto/queries/validate
Request
- Base URL: https://api.elfa.ai
- URL: https://api.elfa.ai/v2/auto/queries/validate
- Auth: API key in header x-elfa-api-key
Request body
Example request
{
"title": "BTC breakout alert",
"description": "Notify when BTC is above 100k so I can review the breakout setup."
}Response
Ok
Changes
No recorded changes to this operation across all 1 revision of this API.