POST /api/v202609/energymanager/reporting/chat/{chatId}/undo

Records that the most recent report change in a reporting chat was undone

CreateReportChatUndoV202609 Permissions: EnergyManagerModule (View)
Use this endpoint when the user undoes their last report prompt. It persists one assistant message marking the undo, holding the restored report version’s summary, but does not execute the query or create or update a dynamic report. Execute the restored KQL through the dynamic-report query endpoint and save explicitly through the dynamic-report endpoints using the returned assistant message identifier. The undo appears in GET /api/v202608/energymanager/reporting/chat/{chatId}/message as an Undo message whose content is the supplied summary.

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.

Path Parameters

Name Description Type Required
chatId Unique numeric identifier of an active reporting chat owned by the authenticated user integer (int32) Required

Request Body

WattsReportChatUndoCreateV202609
Property Description Type
explanation Plain-language summary of the restored report version, shown beneath the undo notice in chat history. Null or empty when the restored version has no summary; at most 4,000 characters. Max length of 4000 string
kql KQL of the report version being restored, i.e. the query that was displayed before the undone change. Required; at most 4,000 characters. Required Max length of 4000 string
Example Request Body application/json
{  "explanation": "string",  "kql": "string"
}

Responses

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

Response Body Parameters

WattsReportChatUndoResponseV202609
Property Description Type
wattsChatMessageId Unique numeric identifier of the persisted undo assistant message. Pass it as the Watts chat message identifier when saving the restored report so the saved version links to the undo. integer (int32)
Example Response application/json
{  "wattsChatMessageId": 1
}
400 Bad Request The request was malformed or contains invalid parameters. Check the request body and query parameters.
404 Not Found The requested resource was not found. Verify the ID or path is correct.