Threads
List thread
POST
/
api
/
log_threads
/
List thread
curl --request POST \
--url https://api.keywordsai.co/api/log_threads/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {
"thread_identifier": "<string>",
"organization_key_id": "<string>",
"customer_identifier": "<string>"
}
}
'import requests
url = "https://api.keywordsai.co/api/log_threads/"
payload = { "filters": {
"thread_identifier": "<string>",
"organization_key_id": "<string>",
"customer_identifier": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
thread_identifier: '<string>',
organization_key_id: '<string>',
customer_identifier: '<string>'
}
})
};
fetch('https://api.keywordsai.co/api/log_threads/', 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://api.keywordsai.co/api/log_threads/",
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([
'filters' => [
'thread_identifier' => '<string>',
'organization_key_id' => '<string>',
'customer_identifier' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.keywordsai.co/api/log_threads/"
payload := strings.NewReader("{\n \"filters\": {\n \"thread_identifier\": \"<string>\",\n \"organization_key_id\": \"<string>\",\n \"customer_identifier\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.keywordsai.co/api/log_threads/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"thread_identifier\": \"<string>\",\n \"organization_key_id\": \"<string>\",\n \"customer_identifier\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keywordsai.co/api/log_threads/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"thread_identifier\": \"<string>\",\n \"organization_key_id\": \"<string>\",\n \"customer_identifier\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyThis endpoint retrieves log threads based on specified filters and pagination parameters.
Authentication
Requires API key authentication via Bearer token in the Authorization header.Query Params
integer
default:1
The page number to retrieve.
integer
default:100
The number of items per page. Maximum is 1000.
string
default:"prod"
This is controlled by the API key. A
prod API key creates prod threads, test key creates test threads.Post params
object
The filters to apply to the threads. For complete filter operators and examples, see the Filters API Reference.
Properties
Properties
string
string
Example
Python
import requests
import json
url = "https://api.keywordsai.co/api/log_threads/?page_size=100"
payload = json.dumps({
"filters": {
"thread_identifier": {
"operator": "in",
"value": [
"thread_identifier_1"
]
}
}
})
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Response
{
"results": [
{
"thread_identifier": "thread_id_1",
"environment": "prod",
"log_count": 21
}
],
"count": 1,
"previous": null,
"next": null,
"current_filters": {
"thread_identifier": {
"operator": "in",
"value": ["thread_id_1"]
}
},
"filters_data": {
"thread_identifier": {
"display_name": "Thread ID",
"metric": "thread_identifier",
"operator_choices": [
{"name": "is", "value": ""},
{"name": "in", "value": "in"}
],
"value_choices": [],
"value_field_type": "text",
"hidden": false
},
// Other available filters and their options...
}
}
Was this page helpful?
⌘I
List thread
curl --request POST \
--url https://api.keywordsai.co/api/log_threads/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {
"thread_identifier": "<string>",
"organization_key_id": "<string>",
"customer_identifier": "<string>"
}
}
'import requests
url = "https://api.keywordsai.co/api/log_threads/"
payload = { "filters": {
"thread_identifier": "<string>",
"organization_key_id": "<string>",
"customer_identifier": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
thread_identifier: '<string>',
organization_key_id: '<string>',
customer_identifier: '<string>'
}
})
};
fetch('https://api.keywordsai.co/api/log_threads/', 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://api.keywordsai.co/api/log_threads/",
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([
'filters' => [
'thread_identifier' => '<string>',
'organization_key_id' => '<string>',
'customer_identifier' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.keywordsai.co/api/log_threads/"
payload := strings.NewReader("{\n \"filters\": {\n \"thread_identifier\": \"<string>\",\n \"organization_key_id\": \"<string>\",\n \"customer_identifier\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.keywordsai.co/api/log_threads/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"thread_identifier\": \"<string>\",\n \"organization_key_id\": \"<string>\",\n \"customer_identifier\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keywordsai.co/api/log_threads/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"thread_identifier\": \"<string>\",\n \"organization_key_id\": \"<string>\",\n \"customer_identifier\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body