Skip to main content
POST
/
v2
/
chats
Create Chat
curl --request POST \
  --url https://app.textql.com/v2/chats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "question": "<string>",
  "chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "model": "gemini_3_5_flash",
  "tools": {
    "connector_ids": [
      123
    ],
    "sql_enabled": true,
    "python_enabled": true,
    "web_search_enabled": true,
    "ontology_enabled": true,
    "tableau_enabled": true,
    "powerbi_enabled": true,
    "google_drive_enabled": true
  },
  "connector_ids": [
    123
  ]
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "model": "<string>",
  "response": "<string>",
  "chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "assets": [
    {
      "name": "<string>",
      "type": "<string>",
      "url": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

API key or JWT token

Body

question
string
required

The question to ask

chat_id
string<uuid>

Existing chat ID to continue a conversation

model
string

Optional model to run this chat on, as an id from GET /v2/models (e.g. gemini_3_5_flash). Omit to use the organization's default model. Only valid on new chats — supplying it together with chat_id returns 400, and a model the caller's org/role does not permit returns 403.

Example:

"gemini_3_5_flash"

tools
object

Tool configuration. Enable specific tools for this chat session.

connector_ids
integer<int32>[]

Connector IDs to query (shorthand for tools.connector_ids)

Response

Chat response

id
string<uuid>

Message ID

created_at
string<date-time>
model
string

LLM model name (e.g. default, sonnet_4, opus_4)

response
string

Markdown-formatted answer

chat_id
string<uuid>

Chat session ID

assets
object[]