Conversations API
The agent endpoints let your own app start and continue conversations with your agent, identify who is asking, and pass a chat to a person in your Inbox. Every conversation started this way appears in your dashboard Inbox like a chat from any other channel.
Before you start
Starter+- Use an API key from API keys. The key identifies the workspace.
- Calls count against the key's rate limits and use message credits when an answer is written. See API errors and rate limits.
Ask and identify the user
POST /v1/agent/ask works like the plain question endpoint, with two additions: you can tell AskVault who the end user is, and the response carries signals your app can act on.
curl -X POST https://api.askvault.co/v1/agent/ask \-H "Authorization: Bearer ak_xxx" \-H "Content-Type: application/json" \-d '{"message": "Where is my order?", "session_id": "user_123", "user": {"email": "[email protected]", "name": "Jane"}}'import os, requestsr = requests.post( "https://api.askvault.co/v1/agent/ask", headers={"Authorization": f"Bearer {os.environ['ASKVAULT_API_KEY']}"}, json={"message": "Where is my order?", "session_id": "user_123"}, timeout=60,)print(r.json())const r = await fetch("https://api.askvault.co/v1/agent/ask", {method: "POST",headers: { "Authorization": `Bearer ${process.env.ASKVAULT_API_KEY}`, "Content-Type": "application/json",},body: JSON.stringify({ message: "Where is my order?", session_id: "user_123" }),});console.log(await r.json());| Field | Required | Notes |
|---|---|---|
message | Yes | The question, 1 to 8,000 characters. |
session_id | No | Your key for this end user, so each person has their own thread. |
conversation_id | No | A conversation id from an earlier response. |
user | No | An object with external_id, email, name and plan. AskVault keeps a contact record for the person. |
top_k | No | How many passages to read, 1 to 20. |
This endpoint takes the question as message, where /v1/query takes query.
The response holds answer, sources (document name, URL and relevance score), confidence, answered, escalated, conversation_id, message_id and tokens_used. Use answered and escalated to decide when to route the person to a human. confidence can be null.
Hand a conversation to your team
POST /v1/agent/escalate with conversation_id (and an optional reason up to 500 characters) moves the conversation to your Inbox as an open handoff. It returns the conversation id, its status and escalated: true.
Record a rating or a resolution
POST /v1/agent/csattakesconversation_id, ascorefrom 1 to 5 and an optionalcomment. It returns the stored score. A rating the customer already gave is not overwritten (HTTP 409).POST /v1/agent/resolvetakesconversation_idandresolved. Withtrue, the conversation counts as confirmed resolved by the AI. Withfalse, it is handed to a person. It returns the newresolution_state.
An unknown conversation id, or one that belongs to another workspace, returns 404.
See what your agent can do
GET /v1/agent/capabilities returns the workspace name, the enabled skills, the channels that are connected and switched on, and whether escalation and streaming are available. Your website widget, hosted page and API keys are set up separately, so they usually do not appear in channels. Responses can gain new fields over time, so ignore fields you do not recognise.
All the endpoints
Every endpoint is under https://api.askvault.co/v1 and, except the first, needs Authorization: Bearer ak_xxx.
| Endpoint | What it does |
|---|---|
GET /v1/health | Liveness check. No key needed. |
POST /v1/query | Ask a question and get a grounded answer. See Ask a question with the API. |
POST /v1/query/stream | The same answer, streamed. See Stream answers with the API. |
POST /v1/agent/ask | Ask, identify the user and get handoff signals back. |
POST /v1/agent/escalate | Hand a conversation to your team. |
POST /v1/agent/csat | Record a 1 to 5 rating. |
POST /v1/agent/resolve | Record whether the customer says the issue is solved. |
GET /v1/agent/capabilities | List enabled skills and connected channels. |
What the API does not do
There is no endpoint to list, read, search, edit or delete conversations, and none to create or configure channels. To get history out, use the export in the Inbox. Connect and manage channels in the dashboard under Channels, or ask Setup Copilot to do it for you. To be told about new chats as they happen, subscribe to webhooks.
Check it worked
Call ask with a session_id, then open the Inbox: the conversation is listed there. Call capabilities to confirm your key and workspace.
If it doesn't work
404 "Conversation not found". The id is wrong or belongs to another workspace.
An ak_ key is refused on a dashboard address. It only works on /v1 routes.
I need to know whether a channel is healthy. capabilities only says a channel is switched on. Channel health is shown on the Channels page.