curl --request POST \
--url https://api.example.com/threads/search \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"status": "<string>",
"limit": 20,
"offset": 0,
"order_by": "created_at DESC"
}
'import requests
url = "https://api.example.com/threads/search"
payload = {
"metadata": {},
"status": "<string>",
"limit": 20,
"offset": 0,
"order_by": "created_at DESC"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {},
status: '<string>',
limit: 20,
offset: 0,
order_by: 'created_at DESC'
})
};
fetch('https://api.example.com/threads/search', 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.example.com/threads/search",
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([
'metadata' => [
],
'status' => '<string>',
'limit' => 20,
'offset' => 0,
'order_by' => 'created_at DESC'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/threads/search"
payload := strings.NewReader("{\n \"metadata\": {},\n \"status\": \"<string>\",\n \"limit\": 20,\n \"offset\": 0,\n \"order_by\": \"created_at DESC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/threads/search")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {},\n \"status\": \"<string>\",\n \"limit\": 20,\n \"offset\": 0,\n \"order_by\": \"created_at DESC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/threads/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {},\n \"status\": \"<string>\",\n \"limit\": 20,\n \"offset\": 0,\n \"order_by\": \"created_at DESC\"\n}"
response = http.request(request)
puts response.read_body[
{
"thread_id": "<string>",
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "idle",
"metadata": {}
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Search Threads
Search threads with filters.
Filter by status or metadata key-value pairs. Results are paginated via
limit and offset and ordered by creation time (newest first).
curl --request POST \
--url https://api.example.com/threads/search \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"status": "<string>",
"limit": 20,
"offset": 0,
"order_by": "created_at DESC"
}
'import requests
url = "https://api.example.com/threads/search"
payload = {
"metadata": {},
"status": "<string>",
"limit": 20,
"offset": 0,
"order_by": "created_at DESC"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {},
status: '<string>',
limit: 20,
offset: 0,
order_by: 'created_at DESC'
})
};
fetch('https://api.example.com/threads/search', 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.example.com/threads/search",
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([
'metadata' => [
],
'status' => '<string>',
'limit' => 20,
'offset' => 0,
'order_by' => 'created_at DESC'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/threads/search"
payload := strings.NewReader("{\n \"metadata\": {},\n \"status\": \"<string>\",\n \"limit\": 20,\n \"offset\": 0,\n \"order_by\": \"created_at DESC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/threads/search")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {},\n \"status\": \"<string>\",\n \"limit\": 20,\n \"offset\": 0,\n \"order_by\": \"created_at DESC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/threads/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {},\n \"status\": \"<string>\",\n \"limit\": 20,\n \"offset\": 0,\n \"order_by\": \"created_at DESC\"\n}"
response = http.request(request)
puts response.read_body[
{
"thread_id": "<string>",
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "idle",
"metadata": {}
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Request model for thread search
Metadata filters
Thread status filter (idle, busy, interrupted, error)
Maximum results
1 <= x <= 1000Results offset
x >= 0DEPRECATED: use sort_by + sort_order. Legacy single-field form, e.g. 'updated_at ASC'.
Field to sort by (SDK-compatible). Takes precedence over order_by.
thread_id, status, created_at, updated_at Sort direction (SDK-compatible). Defaults to 'desc' when sort_by is set.
asc, desc Response
Successful Response
Unique identifier for the thread.
Identifier of the user who owns this thread.
Timestamp when the thread was created.
Timestamp when the thread was last updated.
Current thread status: idle, busy, interrupted, or error.
Arbitrary metadata attached to the thread.