Poll & Results
GET /v1/ask/:id polls a natural-language ask: processing, completed with a cited markdown answer, structured citations, a verdict and usage, or an error.
GET /v1/ask/:id polls an ask started with POST /v1/ask and, once it settles, returns the cited answer. Poll roughly every 2 seconds: turns settle in 10 to 60 seconds, so a 2-second interval finds the answer promptly without wasted requests. Polling counts against the general read namespace, not the ask namespace, so a polling loop never consumes your daily ask budget. An ask_id created by another workspace returns 404, exactly as if it never existed. To watch the turn as it runs instead, GET /v1/ask/:id/stream delivers the same turn as server-sent events; both read the same turn.
The response is one of three shapes, discriminated by status. While the turn runs you get the minimal processing body: ask_id, status, poll_url and conversation_id. When the turn completes, status is completed and the body carries the answer, the structured citations, any cards and artifacts the turn produced, the lookup count, the verification verdict and usage. When the turn fails, status is error with a stable error code and a human-readable message.
Endpoint
/v1/ask/:idPath parameters
Polling loop (bash)
ASK_ID=$(curl -s -X POST https://api.talonic.com/v1/ask \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "What is the total value of the Acme master services agreement?"}' \
| jq -r '.ask_id')
while true; do
RESULT=$(curl -s https://api.talonic.com/v1/ask/$ASK_ID \
-H "Authorization: Bearer $TALONIC_API_KEY")
STATUS=$(echo "$RESULT" | jq -r '.status')
[ "$STATUS" != "processing" ] && break
sleep 2
done
echo "$RESULT" | jq '{status, answer, verdict: .verification.verdict}'The completed payload
Response fields (completed)
Response (completed)
{
"ask_id": "7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07",
"status": "completed",
"poll_url": "/v1/ask/7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07",
"conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
"answer": "The Acme master services agreement has a total contract value of [EUR 96,000](https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=contract_value) over a [24-month term](https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=contract_term).",
"citations": [
{
"quote": "EUR 96,000",
"document_id": "1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"kind": "field",
"reference": "contract_value",
"filename": "acme-msa-2025.pdf",
"app_url": "https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=contract_value"
},
{
"quote": "24-month term",
"document_id": "1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"kind": "field",
"reference": "contract_term",
"filename": "acme-msa-2025.pdf",
"app_url": "https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=contract_term"
}
],
"cards": [],
"artifacts": [],
"tool_calls": 4,
"verification": {
"verdict": "supported",
"checks_total": 3,
"checks_unsupported": 0
},
"usage": {
"tokens": 18432,
"credits_charged": 100
}
}The answer field renders as-is in any markdown surface: chat UIs, Slack, a support console. The inline citation links and the structured citations array describe the same evidence, because the array is parsed from the answer itself, so you can also strip the links and build your own citation display from the array.
A typed client
TypeScript polling helper
const BASE = 'https://api.talonic.com';
const headers = {
Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
'Content-Type': 'application/json',
};
interface AskResult {
ask_id: string;
status: 'processing' | 'completed' | 'error';
poll_url: string;
conversation_id: string | null;
answer?: string;
citations?: { quote: string; document_id: string; kind: 'field' | 'quote'; reference: string; filename: string | null; app_url: string }[];
cards?: unknown[];
artifacts?: { type: string; id: string; label: string; link: string }[];
tool_calls?: number;
verification?: { verdict: 'supported' | 'issues' | 'unverifiable'; checks_total: number; checks_unsupported: number; correction?: string } | null;
usage?: { tokens: number | null; credits_charged: number };
error?: string;
message?: string;
}
async function ask(question: string): Promise<AskResult> {
const submit = await fetch(`${BASE}/v1/ask`, {
method: 'POST',
headers,
body: JSON.stringify({ question }),
});
if (submit.status === 402) throw new Error('Out of credits: top up and retry.');
const { ask_id } = await submit.json();
while (true) {
await new Promise((r) => setTimeout(r, 2000));
const res = await fetch(`${BASE}/v1/ask/${ask_id}`, { headers });
const turn: AskResult = await res.json();
if (turn.status !== 'processing') return turn;
}
}
const result = await ask('Which invoices are overdue as of today?');
if (result.status === 'completed') {
console.log(result.answer);
console.log(`Verification: ${result.verification?.verdict ?? 'none'}`);
}Error turns and error responses
A turn that fails settles to an error turn, delivered with HTTP 200 and status: "error" in the body, because the poll itself succeeded. The body carries error: "ask_failed" and a message. Submit the question again as a fresh ask: turns are independent, and a failed turn affects nothing else. HTTP-level errors on the poll request itself are different: they mean the request never reached a turn.
Response (error turn)
{
"ask_id": "7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07",
"status": "error",
"poll_url": "/v1/ask/7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07",
"conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
"error": "ask_failed",
"message": "The agent turn failed. Ask again; the question was not charged twice."
}HTTP error responses