Writes the plain-language Watts Reports prompt that makes Watts Reports write a given KQL query, checked by running it
Use this endpoint when a query was written by hand and the same report should be built from a prompt in Watts
Reports. The AI query assistant writes the prompt, then runs it through the same query generation Watts Reports
uses for the first message of a report chat and compares the query that comes back with the original, ignoring
layout. A prompt that doesn’t reproduce the query, or that makes Watts Reports ask a question or refuse, is
revised with what came back, up to three times. Generation can vary between runs, so a match shows the prompt
worked when it was checked. Nothing is saved: no report chat or report is created. To explain a query instead,
use POST workbench/query/explain. 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
WorkbenchQueryPromptRequestV202609
| Property | Description | Type |
|---|---|---|
| kql | The KQL query the prompt should make Watts Reports write. Maximum length: 100,000 characters. Max length of 100000 | string |
Example Request Body
{ "kql": "string"
}
Responses
200
OK
The request succeeded and the response body contains the requested data.
Response Body Parameters
WorkbenchQueryPromptResponseV202609
| Property | Description | Type |
|---|---|---|
| attempts | How many prompts were written and checked; each one that didn’t reproduce the query was revised | integer (int32) |
| clarificationQuestion | The question Watts Reports asked instead of writing a query, if it did | string |
| generatedKql | The KQL Watts Reports wrote from the prompt when it was checked; null when it wrote none | string |
| matches | True when the query Watts Reports wrote is the original query (ignoring layout). Generation can vary between runs, so a match shows the prompt worked when it was checked, not that it always will | boolean |
| prompt | The request to type into Watts Reports, in plain English | string |
| refusal | Why Watts Reports wouldn’t write a query from the prompt, if it refused | string |
Example Response
{ "attempts": 1, "clarificationQuestion": "string", "generatedKql": "string", "matches": false, "prompt": "string", "refusal": "string"
}