Nova API — /api/ask
The operations Nova tags public under /api/ask. Generated from reference-src/nova-openapi.json.
POST /api/ask
Operation id ask_answer: in Python client.call("ask_answer", …), on the command line stardelt api ask_answer.
POST /api/ask — a question in, checked SQL out.
A question in words, one Trino statement out. A follow-up may name the answered turn it refines in previous — that turn's question, statement and tables — so a second message like "only org domains" changes the first statement instead of starting over: the previous turn's tables are tried first and each is re-read as the caller, which drops the ones the caller may not read. In agent mode, thread (at most 10 turns, each its question and the answer in words) is the conversation so far and is sent to the model as earlier messages; with a thread, previous is not used in agent mode. Nova searches as the caller for at most five tables — a table the question names in full (catalog.namespace.table) first, then, in every catalog the caller may browse (bronze, silver, gold, then the rest alphabetically, at most ten; the one catalog names, when given), the tables whose name contains every word of the question, or, when none does, the tables sharing the most words with it — sends the question and the documentation of those tables — description, tags, owner, domain, column names and their descriptions, and the tables' metric definitions (name, description, expression, time column, dimensions) — and up to five of their verified queries (question and statement only, never the expected rows) to one ModelEndpoint whose purpose list contains ask and whose probe found it reachable with JSON output, and answers the statement the model writes. endpoint names the one that answers; absent or auto is auto mode, which asks the ready endpoint whose eval runs on this catalog passed most often in the last 30 days (three runs at least; ties and endpoints with fewer runs in name order) and, when it fails with no answer, an upstream 5xx or 429, or an answer that is not the JSON shape, once more to the next one — at most two endpoints per question, and a named endpoint never falls back. tried names the endpoints asked, in order. mode is agent or sql; absent is agent when the endpoint that answers can use tools (its probe found tool calling, and Nova's MCP endpoint is on) and sql otherwise. In agent mode the model works with the platform's read-only MCP tools as the caller, holding the stardelt:read scope only: at most 8 model calls and 6 tool calls per question, every tool result cut at 8 000 characters, and the endpoint's sendRows decides whether a sql_read or pipeline_task_log result reaches the model whole or without its rows and log text. The answer then carries text (the answer in words) and steps (the tool calls, with at most 50 rows of a sql_read for the panel); sql is the last statement it ran, and nothing is EXPLAIN-checked because the tools themselves are read-only. It may also call propose_data_change, in every stage: one INSERT, UPDATE, DELETE, MERGE or CREATE TABLE … AS, which runs nothing — the statement is EXPLAIN-checked as the caller, stored for 15 minutes and answered as pendingAction (id, statement, reason, expiresAt), for that person to approve or reject with /api/ask/actions/{id}/approve and /api/ask/actions/{id}/reject; the turn then ends. An explicit agent on a model that cannot use tools is a 400; so is an explicit agent while Nova's MCP endpoint is off; the answer names mcpEnabled. In sql mode the model receives table documentation only, never a row or a query result. In agent mode a sql_read result reaches the model with its rows, and a pipeline_task_log result with its text, only when an administrator set sendRows on that endpoint (off by default); otherwise the model gets the columns and the row count, or the log's line count. The endpoint's URL and key are never sent. The statement is checked with EXPLAIN as the caller and is not run: explain is passed or failed, and a failed check keeps the SQL in the answer with the engine's sentence in error (one correction is asked of the model first). No matching table is a 200 with sql: null and a sentence saying so; a model endpoint that is refused, unreachable or does not answer in the JSON shape is a 502. A spent budget is the 429 the model budget answers (see /api/admin/model-usage). Every answer carries Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
catalog | query | string | No | The catalog to search for tables; omitted, every catalog the caller may browse |
Request body
| Field | Type | Required | Default | Description | Constraints |
|---|---|---|---|---|---|
conversation | integer (nullable) | No | The conversation this question continues (GET /api/ask/conversations): absent starts a new one, and an id that is not one of the caller's is a 404. | format int64 | |
endpoint | string (nullable) | No | The ModelEndpoint that answers. Absent or auto uses auto mode: the ready endpoints ranked by this catalog's eval results, falling back once. A name asks that endpoint only, and is a 400 when it cannot answer Ask now. | ||
mode | string (nullable) | No | agent or sql. Absent means agent when the endpoint that answers can use tools and Nova's MCP endpoint is on, and today's one-statement answer otherwise. | ||
previous | object | No | The turn this question refines (the panel's last answered turn), or absent. | ||
previous.question | string | Yes | The earlier question, 1 to 2000 characters. | ||
previous.sql | string | Yes | The earlier statement, 1 to 8000 characters. | ||
previous.tables | array of object | Yes | The tables the earlier answer named, at most five. | ||
previous.tables[].catalog | string | Yes | |||
previous.tables[].namespace | string | Yes | |||
previous.tables[].table | string | Yes | |||
question | string | Yes | The question, in words, 1 to 2000 characters. | ||
thread | array of object | No | The conversation so far since New question, oldest first, without the question being asked now, at most 10 turns. In agent mode the model reads it as earlier messages, and previous is then not used. | ||
thread[].answer | string | Yes | The earlier answer in words, 1 to 8000 characters. | ||
thread[].question | string | Yes | The earlier question, 1 to 2000 characters. |
Responses
| Code | Description |
|---|---|
200 | The statement, its sentence, the tables it was written for and the EXPLAIN result |
400 | The question is empty or longer than 2000 characters, the previous turn's question, statement or table list breaks its limit, endpoint names a ModelEndpoint that cannot answer Ask now, mode is neither agent nor sql, or mode is agent and Nova's MCP endpoint is off, or the model cannot use tools |
401 | Not signed in |
429 | The person's or their group's model budget is spent |
502 | The catalog, the cluster or the model endpoint did not answer |
503 | No state store, no cluster connection, no HTTP client, or no ready ask endpoint |
POST /api/ask/actions/{id}/approve
Operation id ask_action_approve: in Python client.call("ask_action_approve", …), on the command line stardelt api ask_action_approve.
POST /api/ask/actions/{id}/approve: run the proposal's statement as the caller, store how it ended, and answer {status, result}.
Approve one data change the Agent proposed: the statement runs as the caller, exactly as the person's own SQL editor would, and the engine and the catalog decide whether they may write. Nova adds no right. A proposal that another person made, or that does not exist, is a 404; one older than 15 minutes is a 410; one already decided is a 409. The answer's status is approved with the engine's result, or failed with the engine's sentence — a refusal is a 200, because the decision itself was taken. The decision is recorded on the audit target.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The proposal's id, from the answer's pendingAction.id |
Responses
| Code | Description |
|---|---|
200 | The decision and how it ended |
401 | Not signed in |
404 | No such proposal for this person |
409 | The proposal was already decided |
410 | The proposal has expired |
503 | The state store is not configured |
POST /api/ask/actions/{id}/reject
Operation id ask_action_reject: in Python client.call("ask_action_reject", …), on the command line stardelt api ask_action_reject.
POST /api/ask/actions/{id}/reject: store rejected; nothing runs.
Reject one data change the Agent proposed: nothing runs, and the row is stored as rejected. A proposal that another person made, or that does not exist, is a 404; one older than 15 minutes is a 410; one already decided is a 409. The decision is recorded on the audit target.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The proposal's id, from the answer's pendingAction.id |
Responses
| Code | Description |
|---|---|
200 | The rejection was stored |
401 | Not signed in |
404 | No such proposal for this person |
409 | The proposal was already decided |
410 | The proposal has expired |
503 | The state store is not configured |
GET /api/ask/conversations
Operation id ask_conversations: in Python client.call("ask_conversations", …), on the command line stardelt api ask_conversations.
GET /api/ask/conversations — the caller's conversations.
The caller's own Ask conversations: the pinned ones first, then by their last turn, newest first. Each carries its id, its first question as title (cut at 120 characters), how many turns it holds, when its last turn came, and whether it is pinned. Nobody else's conversations are readable, and there is no way to ask for another person's. Every answer carries Cache-Control: no-store.
Responses
| Code | Description |
|---|---|
200 | The conversations, pinned first, then newest first |
401 | Not signed in |
500 | The conversations were not read |
503 | No state store |
GET /api/ask/conversations/{id}
Operation id ask_conversation: in Python client.call("ask_conversation", …), on the command line stardelt api ask_conversation.
GET /api/ask/conversations/{id} — one conversation with every turn.
One of the caller's own Ask conversations with every turn, oldest first. Each turn carries its question and the stored answer: the words (text), the steps (each with rows: null — History keeps no query result), the drafted statement, the statement and its EXPLAIN check. Only the caller's own conversations can be read: another person's id, or a missing one, is a 404 no such conversation, the same answer for both, so an id probe learns nothing. Every answer carries Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | The conversation's id, from History |
Responses
| Code | Description |
|---|---|
200 | The conversation, oldest turn first |
401 | Not signed in |
404 | No conversation with that id belongs to the caller |
500 | The conversation was not read |
503 | No state store |
DELETE /api/ask/conversations/{id}
Operation id ask_conversation_delete: in Python client.call("ask_conversation_delete", …), on the command line stardelt api ask_conversation_delete.
DELETE …/{id} — remove one of the caller's own conversations, every turn of it.
Removes one of the caller's own Ask conversations for good, every turn of it. Only the caller's own: another person's id, or a missing one, is a 404 no such conversation, the same answer for both, so an id probe learns nothing. Every answer carries Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | The conversation's id, from History |
Responses
| Code | Description |
|---|---|
204 | The conversation is gone |
401 | Not signed in |
404 | No conversation with that id belongs to the caller |
500 | The conversation was not deleted |
503 | No state store |
PUT /api/ask/conversations/{id}/pin
Operation id ask_conversation_pin: in Python client.call("ask_conversation_pin", …), on the command line stardelt api ask_conversation_pin.
PUT …/{id}/pin — keep a conversation, or let it go.
Keeps one of the caller's own conversations (pinned: true) or lets it fall off with the newest 20 unpinned (pinned: false), on every turn of it, and answers the conversation. A pinned conversation is never pruned. A person holds at most 20 pinned conversations; a 21st is a 409 at most 20 conversations can be pinned; unpin one first. Only the caller's own conversations can be pinned: another person's id, or a missing one, is a 404 no such conversation, the same answer for both, so an id probe learns nothing. Every answer carries Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | The conversation's id, from History |
Request body
| Field | Type | Required | Default | Description | Constraints |
|---|---|---|---|---|---|
pinned | boolean | Yes | true keeps the conversation for good; false lets it fall off with the other unpinned ones. |
Responses
| Code | Description |
|---|---|
200 | The conversation, with every turn |
401 | Not signed in |
404 | No conversation with that id belongs to the caller |
409 | The caller already holds 20 pinned conversations |
500 | The conversation was not pinned |
503 | No state store |
POST /api/ask/feedback
Operation id ask_feedback: in Python client.call("ask_feedback", …), on the command line stardelt api ask_feedback.
POST /api/ask/feedback — one 👍 or 👎 on the row an Ask answer wrote.
Writes the caller's own 👍 or 👎 on the model_call row that /api/ask returned as callId — the row the answer's model call wrote, and the input of the model check. A vote is up or down. A call id that belongs to somebody else is a 404, never a 403: an id probe learns nothing. The vote overwrites the row's earlier one; retention is the row's own. Every answer carries Cache-Control: no-store.
Request body
| Field | Type | Required | Default | Description | Constraints |
|---|---|---|---|---|---|
callId | integer | Yes | The model_call row POST /api/ask answered as callId. | format int64 | |
vote | string | Yes | up or down. |
Responses
| Code | Description |
|---|---|
204 | The vote is stored |
400 | vote is not up or down |
401 | Not signed in |
404 | No call with that id belongs to the caller |
500 | The vote was not stored |
503 | No state store |
GET /api/ask/history
Operation id ask_history: in Python client.call("ask_history", …), on the command line stardelt api ask_history.
GET /api/ask/history — the caller's last 20 conversations.
The caller's own last 20 Ask questions and answers, newest first. Nobody else's conversations are readable, and there is no way to ask for another person's. Every answer carries Cache-Control: no-store.
Responses
| Code | Description |
|---|---|
200 | The conversations, newest first |
401 | Not signed in |
503 | No state store |
DELETE /api/ask/history/{id}
Operation id ask_history_delete: in Python client.call("ask_history_delete", …), on the command line stardelt api ask_history_delete.
DELETE …/{id} — remove one of the caller's own conversations.
Removes one of the caller's own Ask conversations for good. Only the caller's own: another person's id, or a missing one, is a 404 no such conversation, the same answer for both, so an id probe learns nothing. Every answer carries Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | The conversation's id, from History |
Responses
| Code | Description |
|---|---|
204 | The conversation is gone |
401 | Not signed in |
404 | No conversation with that id belongs to the caller |
500 | The conversation was not deleted |
503 | No state store |
PUT /api/ask/history/{id}/pin
Operation id ask_history_pin: in Python client.call("ask_history_pin", …), on the command line stardelt api ask_history_pin.
PUT …/pin — keep one of the caller's conversations, or let it go.
Keeps one of the caller's own conversations (pinned: true) or lets it fall off with the newest 20 unpinned (pinned: false), and answers the row. A pinned conversation is never pruned. A person holds at most 20 pinned conversations; a 21st is a 409 at most 20 conversations can be pinned; unpin one first. Only the caller's own conversations can be pinned: another person's id, or a missing one, is a 404 no such conversation, the same answer for both, so an id probe learns nothing. Every answer carries Cache-Control: no-store.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | The conversation's id, from History |
Request body
| Field | Type | Required | Default | Description | Constraints |
|---|---|---|---|---|---|
pinned | boolean | Yes | true keeps the conversation for good; false lets it fall off with the other unpinned ones. |
Responses
| Code | Description |
|---|---|
200 | The conversation, as History lists it |
401 | Not signed in |
404 | No conversation with that id belongs to the caller |
409 | The caller already holds 20 pinned conversations |
500 | The conversation was not pinned |
503 | No state store |
POST /api/ask/stream
Operation id ask_stream: in Python client.call("ask_stream", …), on the command line stardelt api ask_stream.
The same question as /api/ask, answered as it happens: the body is /api/ask's, and the answer is text/event-stream:
The same question as /api/ask, with the same body and the same answer, as a text/event-stream: one step event — one AskStep, exactly as the answer's steps carries it — the moment a tool call of an agent answer returned; then one answer event with the AskAnswer that /api/ask would answer; or one error event, {"error": "<sentence>", "status": <code>}, in place of the answer when the question is refused or the model does not answer (the status is the one /api/ask would answer with). A keep-alive comment every 15 s. Every answer carries Cache-Control: no-store, and the rules of /api/ask — metadata only, the endpoint's URL and key never leaving the call — hold unchanged.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
catalog | query | string | No | The catalog to search for tables; omitted, every catalog the caller may browse |
Request body
| Field | Type | Required | Default | Description | Constraints |
|---|---|---|---|---|---|
conversation | integer (nullable) | No | The conversation this question continues (GET /api/ask/conversations): absent starts a new one, and an id that is not one of the caller's is a 404. | format int64 | |
endpoint | string (nullable) | No | The ModelEndpoint that answers. Absent or auto uses auto mode: the ready endpoints ranked by this catalog's eval results, falling back once. A name asks that endpoint only, and is a 400 when it cannot answer Ask now. | ||
mode | string (nullable) | No | agent or sql. Absent means agent when the endpoint that answers can use tools and Nova's MCP endpoint is on, and today's one-statement answer otherwise. | ||
previous | object | No | The turn this question refines (the panel's last answered turn), or absent. | ||
previous.question | string | Yes | The earlier question, 1 to 2000 characters. | ||
previous.sql | string | Yes | The earlier statement, 1 to 8000 characters. | ||
previous.tables | array of object | Yes | The tables the earlier answer named, at most five. | ||
previous.tables[].catalog | string | Yes | |||
previous.tables[].namespace | string | Yes | |||
previous.tables[].table | string | Yes | |||
question | string | Yes | The question, in words, 1 to 2000 characters. | ||
thread | array of object | No | The conversation so far since New question, oldest first, without the question being asked now, at most 10 turns. In agent mode the model reads it as earlier messages, and previous is then not used. | ||
thread[].answer | string | Yes | The earlier answer in words, 1 to 8000 characters. | ||
thread[].question | string | Yes | The earlier question, 1 to 2000 characters. |
Responses
| Code | Description |
|---|---|
200 | step events as the tools return, then one answer event or one error event |
401 | Not signed in |