Skip to content
Try Free →

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.

Terminal window
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"}}'
FieldRequiredNotes
messageYesThe question, 1 to 8,000 characters.
session_idNoYour key for this end user, so each person has their own thread.
conversation_idNoA conversation id from an earlier response.
userNoAn object with external_id, email, name and plan. AskVault keeps a contact record for the person.
top_kNoHow 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/csat takes conversation_id, a score from 1 to 5 and an optional comment. It returns the stored score. A rating the customer already gave is not overwritten (HTTP 409).
  • POST /v1/agent/resolve takes conversation_id and resolved. With true, the conversation counts as confirmed resolved by the AI. With false, it is handed to a person. It returns the new resolution_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.

EndpointWhat it does
GET /v1/healthLiveness check. No key needed.
POST /v1/queryAsk a question and get a grounded answer. See Ask a question with the API.
POST /v1/query/streamThe same answer, streamed. See Stream answers with the API.
POST /v1/agent/askAsk, identify the user and get handoff signals back.
POST /v1/agent/escalateHand a conversation to your team.
POST /v1/agent/csatRecord a 1 to 5 rating.
POST /v1/agent/resolveRecord whether the customer says the issue is solved.
GET /v1/agent/capabilitiesList 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.