import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.chats.getAll({
body: {
createdAfter: new Date("2023-01-15T01:30:15.01Z"),
createdBefore: new Date("2023-01-15T01:30:15.01Z"),
},
});
console.log(result);
}
run();import os
from textql_sdk import Textql
from textql_sdk.utils import parse_datetime
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.chats.get_all(created_after=parse_datetime("2023-01-15T01:30:15.01Z"), created_before=parse_datetime("2023-01-15T01:30:15.01Z"))
# Handle response
print(res)curl --request POST \
--url https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '
{
"memberOnly": true,
"searchTerm": "<string>",
"limit": 123,
"offset": 123,
"creatorMemberId": "<string>",
"bookmarkedOnly": true,
"createdAfter": "2023-01-15T01:30:15.01Z",
"createdBefore": "2023-01-15T01:30:15.01Z",
"excludeBatchRuns": true,
"excludeUnusedPlaybooks": true,
"hasThreadWarning": true,
"creatorMemberIds": [
"<string>"
],
"sharedWithMe": true,
"excludeFeed": true,
"sources": [],
"threadWarningTypes": [],
"topicIds": [
"<string>"
],
"connectorIds": [
123
]
}
'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
memberOnly: true,
searchTerm: '<string>',
limit: 123,
offset: 123,
creatorMemberId: '<string>',
bookmarkedOnly: true,
createdAfter: '2023-01-15T01:30:15.01Z',
createdBefore: '2023-01-15T01:30:15.01Z',
excludeBatchRuns: true,
excludeUnusedPlaybooks: true,
hasThreadWarning: true,
creatorMemberIds: ['<string>'],
sharedWithMe: true,
excludeFeed: true,
sources: [],
threadWarningTypes: [],
topicIds: ['<string>'],
connectorIds: [123]
})
};
fetch('https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'memberOnly' => true,
'searchTerm' => '<string>',
'limit' => 123,
'offset' => 123,
'creatorMemberId' => '<string>',
'bookmarkedOnly' => true,
'createdAfter' => '2023-01-15T01:30:15.01Z',
'createdBefore' => '2023-01-15T01:30:15.01Z',
'excludeBatchRuns' => true,
'excludeUnusedPlaybooks' => true,
'hasThreadWarning' => true,
'creatorMemberIds' => [
'<string>'
],
'sharedWithMe' => true,
'excludeFeed' => true,
'sources' => [
],
'threadWarningTypes' => [
],
'topicIds' => [
'<string>'
],
'connectorIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats"
payload := strings.NewReader("{\n \"memberOnly\": true,\n \"searchTerm\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123,\n \"creatorMemberId\": \"<string>\",\n \"bookmarkedOnly\": true,\n \"createdAfter\": \"2023-01-15T01:30:15.01Z\",\n \"createdBefore\": \"2023-01-15T01:30:15.01Z\",\n \"excludeBatchRuns\": true,\n \"excludeUnusedPlaybooks\": true,\n \"hasThreadWarning\": true,\n \"creatorMemberIds\": [\n \"<string>\"\n ],\n \"sharedWithMe\": true,\n \"excludeFeed\": true,\n \"sources\": [],\n \"threadWarningTypes\": [],\n \"topicIds\": [\n \"<string>\"\n ],\n \"connectorIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"memberOnly\": true,\n \"searchTerm\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123,\n \"creatorMemberId\": \"<string>\",\n \"bookmarkedOnly\": true,\n \"createdAfter\": \"2023-01-15T01:30:15.01Z\",\n \"createdBefore\": \"2023-01-15T01:30:15.01Z\",\n \"excludeBatchRuns\": true,\n \"excludeUnusedPlaybooks\": true,\n \"hasThreadWarning\": true,\n \"creatorMemberIds\": [\n \"<string>\"\n ],\n \"sharedWithMe\": true,\n \"excludeFeed\": true,\n \"sources\": [],\n \"threadWarningTypes\": [],\n \"topicIds\": [\n \"<string>\"\n ],\n \"connectorIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memberOnly\": true,\n \"searchTerm\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123,\n \"creatorMemberId\": \"<string>\",\n \"bookmarkedOnly\": true,\n \"createdAfter\": \"2023-01-15T01:30:15.01Z\",\n \"createdBefore\": \"2023-01-15T01:30:15.01Z\",\n \"excludeBatchRuns\": true,\n \"excludeUnusedPlaybooks\": true,\n \"hasThreadWarning\": true,\n \"creatorMemberIds\": [\n \"<string>\"\n ],\n \"sharedWithMe\": true,\n \"excludeFeed\": true,\n \"sources\": [],\n \"threadWarningTypes\": [],\n \"topicIds\": [\n \"<string>\"\n ],\n \"connectorIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"chats": [
{
"id": "<string>",
"paradigm": {
"type": "TYPE_UNKNOWN",
"version": 123,
"options": {
"universal": {
"connectorIds": [
123
],
"datasetId": "<string>",
"webSearchEnabled": true,
"sqlEnabled": true,
"ontologyEnabled": true,
"ontologyEditingEnabled": true,
"pythonEnabled": true,
"autoApproveEnabled": true,
"googleDriveEnabled": true,
"powerbiEnabled": true,
"contextEditingEnabled": true,
"formEditorEnabled": true,
"playbookToolsEnabled": true,
"microsoft365Enabled": true,
"feedExplorerEnabled": true,
"bashEnabled": true,
"javascriptEnabled": true,
"feedPostEnabled": true,
"feedCommentEnabled": true,
"feedEngageEnabled": true,
"streamlitEnabled": true,
"compactionDisabled": true,
"gmailEnabled": true,
"chatHistorySearchEnabled": true,
"googleCalendarEnabled": true,
"emailOutputEnabled": true,
"powerbiSelections": [
{
"workspaceId": "<string>",
"reportIds": [
"<string>"
],
"datasetIds": [
"<string>"
],
"workspaceName": "<string>",
"connectorId": 123
}
],
"smsMode": true,
"apiAccessKeyIds": [
"<string>"
],
"feedEnabled": true,
"fileGenerationDisabled": true,
"readFileEnabled": true,
"ontologyActionsEnabled": true,
"ontologyActionsAutoApproveEnabled": true
}
}
},
"model": "MODEL_UNKNOWN",
"timestamp": "2023-01-15T01:30:15.01Z",
"orgId": "<string>",
"memberId": "<string>",
"summary": "<string>",
"playbookId": "<string>",
"research": true,
"creatorEmail": "<string>",
"apiKeyClientId": "<string>",
"updatedAt": "2023-01-15T01:30:15.01Z",
"isBookmarked": true,
"preferredProvider": "<string>",
"templateDataId": "<string>",
"batchRunId": "<string>",
"preview": "<string>",
"dashboardMode": true,
"source": "CHAT_SOURCE_UNKNOWN",
"methodology": "METHODOLOGY_UNKNOWN",
"isRunning": true,
"isUnread": true,
"vllmModelId": "<string>",
"fastMode": true,
"agentId": "<string>",
"agentName": "<string>",
"agentProfileImageUrl": "<string>",
"maxThinking": true
}
],
"totalCount": 123
}{
"code": "not_found",
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Get Chats
import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.chats.getAll({
body: {
createdAfter: new Date("2023-01-15T01:30:15.01Z"),
createdBefore: new Date("2023-01-15T01:30:15.01Z"),
},
});
console.log(result);
}
run();import os
from textql_sdk import Textql
from textql_sdk.utils import parse_datetime
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.chats.get_all(created_after=parse_datetime("2023-01-15T01:30:15.01Z"), created_before=parse_datetime("2023-01-15T01:30:15.01Z"))
# Handle response
print(res)curl --request POST \
--url https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '
{
"memberOnly": true,
"searchTerm": "<string>",
"limit": 123,
"offset": 123,
"creatorMemberId": "<string>",
"bookmarkedOnly": true,
"createdAfter": "2023-01-15T01:30:15.01Z",
"createdBefore": "2023-01-15T01:30:15.01Z",
"excludeBatchRuns": true,
"excludeUnusedPlaybooks": true,
"hasThreadWarning": true,
"creatorMemberIds": [
"<string>"
],
"sharedWithMe": true,
"excludeFeed": true,
"sources": [],
"threadWarningTypes": [],
"topicIds": [
"<string>"
],
"connectorIds": [
123
]
}
'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
memberOnly: true,
searchTerm: '<string>',
limit: 123,
offset: 123,
creatorMemberId: '<string>',
bookmarkedOnly: true,
createdAfter: '2023-01-15T01:30:15.01Z',
createdBefore: '2023-01-15T01:30:15.01Z',
excludeBatchRuns: true,
excludeUnusedPlaybooks: true,
hasThreadWarning: true,
creatorMemberIds: ['<string>'],
sharedWithMe: true,
excludeFeed: true,
sources: [],
threadWarningTypes: [],
topicIds: ['<string>'],
connectorIds: [123]
})
};
fetch('https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'memberOnly' => true,
'searchTerm' => '<string>',
'limit' => 123,
'offset' => 123,
'creatorMemberId' => '<string>',
'bookmarkedOnly' => true,
'createdAfter' => '2023-01-15T01:30:15.01Z',
'createdBefore' => '2023-01-15T01:30:15.01Z',
'excludeBatchRuns' => true,
'excludeUnusedPlaybooks' => true,
'hasThreadWarning' => true,
'creatorMemberIds' => [
'<string>'
],
'sharedWithMe' => true,
'excludeFeed' => true,
'sources' => [
],
'threadWarningTypes' => [
],
'topicIds' => [
'<string>'
],
'connectorIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats"
payload := strings.NewReader("{\n \"memberOnly\": true,\n \"searchTerm\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123,\n \"creatorMemberId\": \"<string>\",\n \"bookmarkedOnly\": true,\n \"createdAfter\": \"2023-01-15T01:30:15.01Z\",\n \"createdBefore\": \"2023-01-15T01:30:15.01Z\",\n \"excludeBatchRuns\": true,\n \"excludeUnusedPlaybooks\": true,\n \"hasThreadWarning\": true,\n \"creatorMemberIds\": [\n \"<string>\"\n ],\n \"sharedWithMe\": true,\n \"excludeFeed\": true,\n \"sources\": [],\n \"threadWarningTypes\": [],\n \"topicIds\": [\n \"<string>\"\n ],\n \"connectorIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"memberOnly\": true,\n \"searchTerm\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123,\n \"creatorMemberId\": \"<string>\",\n \"bookmarkedOnly\": true,\n \"createdAfter\": \"2023-01-15T01:30:15.01Z\",\n \"createdBefore\": \"2023-01-15T01:30:15.01Z\",\n \"excludeBatchRuns\": true,\n \"excludeUnusedPlaybooks\": true,\n \"hasThreadWarning\": true,\n \"creatorMemberIds\": [\n \"<string>\"\n ],\n \"sharedWithMe\": true,\n \"excludeFeed\": true,\n \"sources\": [],\n \"threadWarningTypes\": [],\n \"topicIds\": [\n \"<string>\"\n ],\n \"connectorIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/rpc/public/textql.rpc.public.chat.ChatService/GetChats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memberOnly\": true,\n \"searchTerm\": \"<string>\",\n \"limit\": 123,\n \"offset\": 123,\n \"creatorMemberId\": \"<string>\",\n \"bookmarkedOnly\": true,\n \"createdAfter\": \"2023-01-15T01:30:15.01Z\",\n \"createdBefore\": \"2023-01-15T01:30:15.01Z\",\n \"excludeBatchRuns\": true,\n \"excludeUnusedPlaybooks\": true,\n \"hasThreadWarning\": true,\n \"creatorMemberIds\": [\n \"<string>\"\n ],\n \"sharedWithMe\": true,\n \"excludeFeed\": true,\n \"sources\": [],\n \"threadWarningTypes\": [],\n \"topicIds\": [\n \"<string>\"\n ],\n \"connectorIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"chats": [
{
"id": "<string>",
"paradigm": {
"type": "TYPE_UNKNOWN",
"version": 123,
"options": {
"universal": {
"connectorIds": [
123
],
"datasetId": "<string>",
"webSearchEnabled": true,
"sqlEnabled": true,
"ontologyEnabled": true,
"ontologyEditingEnabled": true,
"pythonEnabled": true,
"autoApproveEnabled": true,
"googleDriveEnabled": true,
"powerbiEnabled": true,
"contextEditingEnabled": true,
"formEditorEnabled": true,
"playbookToolsEnabled": true,
"microsoft365Enabled": true,
"feedExplorerEnabled": true,
"bashEnabled": true,
"javascriptEnabled": true,
"feedPostEnabled": true,
"feedCommentEnabled": true,
"feedEngageEnabled": true,
"streamlitEnabled": true,
"compactionDisabled": true,
"gmailEnabled": true,
"chatHistorySearchEnabled": true,
"googleCalendarEnabled": true,
"emailOutputEnabled": true,
"powerbiSelections": [
{
"workspaceId": "<string>",
"reportIds": [
"<string>"
],
"datasetIds": [
"<string>"
],
"workspaceName": "<string>",
"connectorId": 123
}
],
"smsMode": true,
"apiAccessKeyIds": [
"<string>"
],
"feedEnabled": true,
"fileGenerationDisabled": true,
"readFileEnabled": true,
"ontologyActionsEnabled": true,
"ontologyActionsAutoApproveEnabled": true
}
}
},
"model": "MODEL_UNKNOWN",
"timestamp": "2023-01-15T01:30:15.01Z",
"orgId": "<string>",
"memberId": "<string>",
"summary": "<string>",
"playbookId": "<string>",
"research": true,
"creatorEmail": "<string>",
"apiKeyClientId": "<string>",
"updatedAt": "2023-01-15T01:30:15.01Z",
"isBookmarked": true,
"preferredProvider": "<string>",
"templateDataId": "<string>",
"batchRunId": "<string>",
"preview": "<string>",
"dashboardMode": true,
"source": "CHAT_SOURCE_UNKNOWN",
"methodology": "METHODOLOGY_UNKNOWN",
"isRunning": true,
"isUnread": true,
"vllmModelId": "<string>",
"fastMode": true,
"agentId": "<string>",
"agentName": "<string>",
"agentProfileImageUrl": "<string>",
"maxThinking": true
}
],
"totalCount": 123
}{
"code": "not_found",
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Authorizations
Headers
Define the version of the Connect protocol
1 Define the timeout, in ms
Body
whether to return only the user's chats or all of the org's chats
CHAT_SORT_FIELD_UNKNOWN, CHAT_SORT_FIELD_NAME, CHAT_SORT_FIELD_CREATED_AT, CHAT_SORT_FIELD_UPDATED_AT CHAT_SORT_DIRECTION_UNKNOWN, CHAT_SORT_DIRECTION_ASC, CHAT_SORT_DIRECTION_DESC filter to only bookmarked chats
filter chats created after this time
"2023-01-15T01:30:15.01Z"
"2024-12-25T12:00:00Z"
filter chats created before this time
"2023-01-15T01:30:15.01Z"
"2024-12-25T12:00:00Z"
exclude chats created from template batch runs
exclude chats created from playbooks that have no user messages beyond the initial prompt
filter chats by source (single-select; superseded by sources when that is non-empty)
CHAT_SOURCE_UNKNOWN, CHAT_SOURCE_THREAD, CHAT_SOURCE_PLAYBOOK, CHAT_SOURCE_SLACK, CHAT_SOURCE_FEED, CHAT_SOURCE_TEAMS, CHAT_SOURCE_SMS, CHAT_SOURCE_MCP, CHAT_SOURCE_SYSTEM, CHAT_SOURCE_DATA_APP When true (and thread_warning_types empty), only chats that have at least one thread_warning row of any type.
Filter org chats to these creator member IDs (union). Ignored when empty. Supersedes creator_member_id when non-empty.
Filter chats by source (union). Ignored when empty. Supersedes the single source when non-empty.
CHAT_SOURCE_UNKNOWN, CHAT_SOURCE_THREAD, CHAT_SOURCE_PLAYBOOK, CHAT_SOURCE_SLACK, CHAT_SOURCE_FEED, CHAT_SOURCE_TEAMS, CHAT_SOURCE_SMS, CHAT_SOURCE_MCP, CHAT_SOURCE_SYSTEM, CHAT_SOURCE_DATA_APP Filter to chats with at least one thread_warning of any of these types (union).
ThreadWarningType is the canonical set of thread warning types
THREAD_WARNING_TYPE_UNSPECIFIED, THREAD_WARNING_TYPE_MISSING_CONTEXT, THREAD_WARNING_TYPE_ERROR_LOOP, THREAD_WARNING_TYPE_EXCESSIVE_TOOL_CALLS, THREAD_WARNING_TYPE_SLOW_QUERY, THREAD_WARNING_TYPE_NO_RESULTS, THREAD_WARNING_TYPE_USER_FRUSTRATION, THREAD_WARNING_TYPE_POTENTIAL_HALLUCINATION, THREAD_WARNING_TYPE_IGNORED_INSTRUCTION, THREAD_WARNING_TYPE_USER_THUMBS_DOWN, THREAD_WARNING_TYPE_NO_CONCLUSION, THREAD_WARNING_TYPE_USER_THUMBS_UP, THREAD_WARNING_TYPE_GOAL_ACHIEVED, THREAD_WARNING_TYPE_USER_SATISFACTION Only chats tagged with at least one of these custom topics (verdict='tagged'). Ignored when empty.
Filter chats that have any of these connector IDs in their paradigm options (union). Ignored when empty.