Ask follow-up questions of your data

https://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_name/ask/session_id

Continue a conversation with your data. This endpoint lets you continue a question started via the /ask endpoint in order to dive deeper into your context or ask clarifying questions.

Expected Parameters

NameDescriptionInRequiredSchema
db_branch_nameThe DBBranchName matches the pattern `{db_name}:{branch_name}`. pathstring
table_nameThe Table namepathstring
session_idpathstring

Ask Follow-Up Questions of Your Data

POST
https://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/tables/table_name/ask/session_id

Ask a follow-up question. If the Accept header is set to text/event-stream, Xata will stream the results back as SSE's.

Request Body Type Definition

1
2
3
4
5
6
7
8
type ChatSessionMessage = {
    /*
     * The question you'd like to ask.
     *
     * @minLength 3
     */
    message?: string;
};
Status CodeDescriptionExample Response/Type Definition
200Response to the question
type ChatSessionMessage = {
    /*
     * The answer to the input question
     */
    answer?: string;
};
400Bad Request
type ChatSessionMessage = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
404Example response
type ChatSessionMessage = {
    id?: string;
    message: string;
};
429Rate limit exceeded
type ChatSessionMessage = {
    id?: string;
    message: string;
};
503ServiceUnavailable
type ChatSessionMessage = {
    id?: string;
    message: string;
};
5XXUnexpected Error