Stream Ask AI REST API
const url = 'http://127.0.0.1:25737/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ask-ai/events';const options = { method: 'POST', headers: {cookie: 'hk_token=<hk_token>', 'Content-Type': 'application/json'}, body: '{"filters":[{"type":"example","value":"example"}],"from":"2026-04-15","history":[{"content":"example","role":"user"}],"query":"example","route":"example","to":"2026-04-15"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:25737/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ask-ai/events \ --header 'Content-Type: application/json' \ --cookie hk_token=<hk_token> \ --data '{ "filters": [ { "type": "example", "value": "example" } ], "from": "2026-04-15", "history": [ { "content": "example", "role": "user" } ], "query": "example", "route": "example", "to": "2026-04-15" }'Runs the same audited, session-only Ask AI workflow and streams safe Server-Sent Events for progress, answer deltas, and the final validated response. Requires a human dashboard session with site.view; API client bearer tokens and shared dashboard routes are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Responses
Section titled “Responses”Ask AI Server-Sent Events stream
object
Session-only markdown answer delta. Final charts, actions, and citations are returned only on final events.
Stable non-secret error label when an in-stream failure occurs.
Dashboard i18n key for safe progress or error copy.
object
object
object
object
object
object
Provider-assigned tool call identifier for progress events.
Safe HitKeep analytics tool identifier for progress events.
Invalid Ask AI request
object
Examplegenerated
{ "message": "example"}Dashboard session required or forbidden
object
Examplegenerated
{ "message": "example"}Ask AI unavailable
object
Example
{ "status": "disabled"}Ask AI budget exhausted
object
Example
{ "status": "disabled"}