The Chat API lets you embed a fully conversational AI support experience anywhere in your product. Unlike the Query API, which handles single-shot questions, the Chat API maintains conversation context across multiple messages through the concept of a session. Each session has a uniqueDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/arainey2022/myaskai-docs/llms.txt
Use this file to discover all available pages before exploring further.
session_id that ties all messages together, allowing your agent to understand follow-up questions, refer back to earlier context, and give coherent multi-turn responses.
The typical flow is: create a session → send a message → receive a reply → send a follow-up → and so on, until the conversation is resolved.
You can pass
"insights": true in any message request to generate conversation insights in your My AskAI dashboard. When Insights is enabled, each response also returns a conversation_id that you can include in subsequent requests to group them into a single conversation record.Endpoint 1 — Create a Session
session_id. Pass this ID in all subsequent message requests for this conversation.
Request Parameters
The unique identifier of the My AskAI agent to use for this session. Find it in Settings → API.
An optional identifier for the end user. Used for analytics and personalisation via the User Data API.
Example Request
Response Fields
A unique identifier for the newly created session. Pass this in all subsequent
/messages calls.ISO 8601 timestamp of when the session was created.
Example Response
Endpoint 2 — Send a Message
messages array you include should contain the full conversation history for this session — the API is stateless and does not store messages server-side between calls.
Path Parameters
The
session_id returned when you created the session.Request Parameters
Set to
true to log this conversation in your My AskAI dashboard Insights view. When enabled, the response includes a conversation_id.Pass the
conversation_id returned by a previous message request to link all API calls to a single conversation record in Insights.Example Request — First Message
Example Request — Follow-up Message
Response Fields
Set to
"yes" if the agent couldn’t find a relevant answer. Also includes suggestedQuestions in this case.Returned alongside
unknown_answer: "yes". Contains up to 3 alternative questions the agent is highly likely to be able to answer.true when a Guidance rule recommended escalation to a human agent.Returned when
insights is true. Pass this back in subsequent requests to link them to the same Insights record.Example Response
Endpoint 3 — Retrieve Conversation History
Path Parameters
The session whose message history you want to retrieve.
Example Request
Response Fields
The session identifier.
Example Response
Error Codes
| HTTP status | Description |
|---|---|
400 Bad Request | Missing required field (agent_id, messages) or malformed request body. |
401 Unauthorized | Missing or invalid API key. |
404 Not Found | The session_id does not exist or has expired. |
429 Too Many Requests | Rate limit exceeded. |
500 Internal Server Error | Unexpected server error — retry with exponential back-off. |