---
title: "Ask AI"
method: POST
path: "/api/sites/{id}/ask-ai"
tags: ["Sites"]
deprecated: true
---

# Ask AI

`POST /api/sites/{id}/ask-ai`

## Request

- Base URL: `https://demo.hitkeep.com`
- URL: `https://demo.hitkeep.com/api/sites/{id}/ask-ai`
- Auth: API key in cookie `hk_token`

> **Deprecated.**

Deprecated: use /api/sites/{id}/ask-ai/events, which runs the same audited workflow and streams the answer. This endpoint returns the finished answer of that workflow and will be removed in the next major version. Runs the session-only, site-scoped dashboard assistant over read-only aggregate analytics tools. Requires a human dashboard session with site.view; API client bearer tokens and shared dashboard routes are rejected.

## Path parameters

- `id` string, uuid, required

## Request body

- AskAIRequest
  - `filters` AskAIFilter[]
    - `type` string, required
    - `value` string, required
  - `from` string, date
  - `history` AskAIMessage[]
    - `content` string, required
    - `role` 'user' | 'assistant', required
  - `query` string, required
  - `route` string
  - `to` string, date

## Response `200`

Ask AI response

- AskAIResponse
  - `actions` AskAIAction[], required
    - `format` 'xlsx' | 'json' | 'csv' | 'ndjson'
    - `label` string, required
    - `target` string, required
    - `type` 'navigate' | 'download_export', required
  - `answer_markdown` string, required
  - `charts` AskAIChart[], required
    - `rows` object[], required
    - `series` AskAIChartSeries[]
      - `key` string, required
      - `label` string, required
    - `title` string, required
    - `type` 'line' | 'bar' | 'table', required
    - `x_key` string
  - `citations` AskAICitation[], required
    - `label` string, required
    - `tool_call_id` string, required
  - `run_id` string, uuid, required

## Other responses

- `400`: Invalid Ask AI request
- `403`: Dashboard session required or forbidden
- `409`: Ask AI unavailable
- `429`: Ask AI budget or daily allowance exhausted
- `502`: Ask AI provider or validation failure

---

[API](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api.md) · [All operations](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api/revisions/bb2df36ab2a4?raw)
