POST /api/v202609/workbench/query/fix

Repairs a Workbench Data Explorer KQL query that has errors, using the AI query assistant

FixWorkbenchQueryV202609
Use this endpoint when a query is rejected by POST workbench/query or POST workbench/validate: send the query with its error messages and the assistant rewrites it, checking the result until it is valid. The fixed query is not run. To write a new query from a question instead, use POST workbench/query/generate. Restricted to ENC staff.

Request Headers

Header Value Required Description
ECI-ApiKey string Yes Your API key. See Authentication.
Content-Type application/json Yes All requests must specify JSON content type, including the request body.

Request Body

EdxAiFixRequestV202606
Property Description Type
errors string[]
kql string
Example Request Body application/json
{  "errors": [
    "string"
  ],  "kql": "string"
}

Responses

200 OK The request succeeded and the response body contains the requested data.

Response Body Parameters

EdxAiGenerateResponseV202606
Property Description Type
attempts integer (int32)
clarificationOptions string[]
clarificationQuestion string
error string
errors string[]
explanation string
kql string
requiresClarification True when the model needs the user to disambiguate a referenced entity (no KQL yet). The UI presents EnergyCap.DTO.V202606.EdxAiGenerateResponse.ClarificationOptions and re-asks with the chosen value. boolean
resolutionSteps Human-readable trace of the entity-resolution lookups the model ran behind the scenes, surfaced for transparency. Empty for a straightforward single-shot generation. string[]
success boolean
valid boolean
Example Response application/json
{  "attempts": 1,  "clarificationOptions": [
    "string"
  ],  "clarificationQuestion": "string",  "error": "string",  "errors": [
    "string"
  ],  "explanation": "string",  "kql": "string",  "requiresClarification": false,  "resolutionSteps": [
    "string"
  ],  "success": false,  "valid": false
}