JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const activityDetail = await client.threads.activity('agent_abc123', 'thread_abc123');
console.log(activityDetail);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
activity_detail = client.threads.activity(
agent_id="agent_abc123",
thread_id="thread_abc123",
)
print(activity_detail)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
activityDetail, err := client.Threads.Activity(
context.TODO(),
"agent_abc123",
"thread_abc123",
cercago.ThreadActivityParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", activityDetail)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
activity_detail = cerca.threads.activity("agent_abc123", "thread_abc123")
puts(activity_detail)cerca threads activity \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--thread-id thread_abc123curl --request GET \
--url https://api.cerca.dev/agents/{agentId}/threads/{threadId}/activity \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/threads/{threadId}/activity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.cerca.dev/agents/{agentId}/threads/{threadId}/activity")
.header("Authorization", "Bearer <token>")
.asString();{
"completedAt": "<string>",
"createdAt": "<string>",
"goal": "<string>",
"id": "<string>",
"latestActivity": "<string>",
"messageCount": 123,
"model": "<string>",
"nextStep": "<string>",
"parentThreadId": "<string>",
"result": "<string>",
"scheduleId": "<string>",
"status": "idle",
"stepCount": 123,
"updatedAt": "<string>",
"error": "<string>",
"recentTurns": [
{
"activity": "<string>",
"completedAt": "<string>",
"messageCount": 123,
"nextStep": "<string>",
"status": "completed",
"turnSeq": 123
}
]
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Threads
Get thread activity
Fetch compact current and recent activity for a thread without returning transcript content or runtime debug state.
GET
/
agents
/
{agentId}
/
threads
/
{threadId}
/
activity
JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
const activityDetail = await client.threads.activity('agent_abc123', 'thread_abc123');
console.log(activityDetail);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
activity_detail = client.threads.activity(
agent_id="agent_abc123",
thread_id="thread_abc123",
)
print(activity_detail)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
activityDetail, err := client.Threads.Activity(
context.TODO(),
"agent_abc123",
"thread_abc123",
cercago.ThreadActivityParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", activityDetail)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
activity_detail = cerca.threads.activity("agent_abc123", "thread_abc123")
puts(activity_detail)cerca threads activity \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--thread-id thread_abc123curl --request GET \
--url https://api.cerca.dev/agents/{agentId}/threads/{threadId}/activity \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/threads/{threadId}/activity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.cerca.dev/agents/{agentId}/threads/{threadId}/activity")
.header("Authorization", "Bearer <token>")
.asString();{
"completedAt": "<string>",
"createdAt": "<string>",
"goal": "<string>",
"id": "<string>",
"latestActivity": "<string>",
"messageCount": 123,
"model": "<string>",
"nextStep": "<string>",
"parentThreadId": "<string>",
"result": "<string>",
"scheduleId": "<string>",
"status": "idle",
"stepCount": 123,
"updatedAt": "<string>",
"error": "<string>",
"recentTurns": [
{
"activity": "<string>",
"completedAt": "<string>",
"messageCount": 123,
"nextStep": "<string>",
"status": "completed",
"turnSeq": 123
}
]
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Example:
"agent_abc123"
Minimum string length:
1Example:
"thread_abc123"
Query Parameters
Optional fleet id for index-backed authorization.
Response
Thread activity detail.
idle threads can accept a new turn or be closed. running threads have an active turn. awaiting threads are paused on external input such as approvals. closed threads are terminal.
Available options:
idle, running, awaiting, closed Show child attributes
Show child attributes