Stream Ask AI REST API
POST
/api/sites/{id}/ask-ai/events
const url = 'https://hitkeep.com/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 https://hitkeep.com/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”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
filters
Array<object>
object
type
required
string
value
required
string
from
string format: date
history
Array<object>
object
content
required
string
role
required
string
query
required
string
route
string
to
string format: date
Responses
Section titled “Responses”Ask AI Server-Sent Events stream
Media typetext/event-stream
object
delta_markdown
Session-only markdown answer delta. Final charts, actions, and citations are returned only on final events.
string
error
Stable non-secret error label when an in-stream failure occurs.
string
message_key
Dashboard i18n key for safe progress or error copy.
string
response
object
actions
required
Array<object>
object
format
string
label
required
string
target
required
string
type
required
string
answer_markdown
required
string
charts
required
Array<object>
object
rows
required
Array<object>
object
key
additional properties
string | number | boolean | null
series
Array<object>
object
key
required
string
label
required
string
title
required
string
type
required
string
x_key
string
citations
required
Array<object>
object
label
required
string
tool_call_id
required
string
run_id
required
string format: uuid
status
string
type
required
string
Invalid Ask AI request
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}Dashboard session required or forbidden
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}Ask AI unavailable
Media typeapplication/json
object
available
required
boolean
budget_exhausted
required
boolean
enabled
required
boolean
model
string
provider
string
status
required
string
Example
{ "status": "disabled"}Ask AI budget exhausted
Media typeapplication/json
object
available
required
boolean
budget_exhausted
required
boolean
enabled
required
boolean
model
string
provider
string
status
required
string
Example
{ "status": "disabled"}