List tasks
curl --request GET \
--url https://api.example.com/v1/tasksimport requests
url = "https://api.example.com/v1/tasks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/tasks', 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/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/tasks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"sessions": [
{}
],
"sessionId": "<string>",
"firstTask": {},
"turnCount": 123,
"latestStatus": "<string>",
"latestCreatedAt": {},
"latestUpdatedAt": {}
}Tasks
List tasks
List the caller’s sessions, grouped. Each session is summarized; the full per-task detail is available via GET /v1/sessions/.
GET
/
v1
/
tasks
List tasks
curl --request GET \
--url https://api.example.com/v1/tasksimport requests
url = "https://api.example.com/v1/tasks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/tasks', 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/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/tasks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"sessions": [
{}
],
"sessionId": "<string>",
"firstTask": {},
"turnCount": 123,
"latestStatus": "<string>",
"latestCreatedAt": {},
"latestUpdatedAt": {}
}Query parameters
number
default:"50"
How many sessions to return. Capped at 100.
Response — 200 OK
SessionSummary[]
Array of session summaries, most-recent-first.
SessionSummary contains:
string
Task
The first task in the session — useful for displaying the session’s “title” in a UI.
number
Total tasks in the session.
string
Status of the most recent task in the session.
string (ISO 8601)
string (ISO 8601)
Example
curl "$API_BASE/tasks?limit=20" \
-H "Authorization: Bearer $API_KEY"
sessions = client.tasks.list()
for s in sessions:
print(f"{s['sessionId']} turns={s['turnCount']} status={s['latestStatus']}")
const sessions = await client.tasks.list({ limit: 20 });
for (const s of sessions) {
console.log(`${s.sessionId} turns=${s.turnCount} status=${s.latestStatus}`);
}
Notes
- Grouping is server-side. The response gives you one row per conversation, not one row per task. That’s usually what you want for building a “chat history” sidebar in your UI.
- Pagination. v1 doesn’t support cursor-based paging. If you need more than 100 sessions, filter by
endUserId(coming soon as a dedicated endpoint) or query DynamoDB directly if you have that access. - No cross-tenant data. You only see sessions belonging to your own business.
Errors
| Code | Meaning |
|---|---|
401 | Missing Authorization header |
