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 approvalRequest = await client.approvalRequests.resolve(
'agent_abc123',
'thread_abc123',
'approval_abc123',
{ decision: 'approve' },
);
console.log(approvalRequest.id);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
approval_request = client.approval_requests.resolve(
agent_id="agent_abc123",
thread_id="thread_abc123",
approval_id="approval_abc123",
decision="approve",
)
print(approval_request.id)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"),
)
approvalRequest, err := client.ApprovalRequests.Resolve(
context.TODO(),
"agent_abc123",
"thread_abc123",
"approval_abc123",
cercago.ApprovalRequestResolveParams{
Decision: cercago.F(cercago.ApprovalRequestResolveParamsDecisionApprove),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", approvalRequest.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
approval_request = cerca.approval_requests.resolve("agent_abc123", "thread_abc123", "approval_abc123", decision: :approve)
puts(approval_request)cerca approval-requests resolve \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--thread-id thread_abc123 \
--approval-id approval_abc123 \
--decision approvecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/threads/{threadId}/approvals/{approvalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/threads/{threadId}/approvals/{approvalId}",
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([
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cerca.dev/agents/{agentId}/threads/{threadId}/approvals/{approvalId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();{
"createdAt": "<string>",
"id": "<string>",
"input": "<unknown>",
"resolvedAt": "<string>",
"runtimeToolName": "get_time",
"status": "pending",
"threadId": "<string>",
"timeoutAt": "<string>",
"timeoutMs": 123,
"toolIndex": 123,
"toolName": "<string>",
"toolUseId": "<string>",
"turnId": "<string>",
"toolSourceId": "<string>",
"toolSourceVersion": 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"
}Approvals
Create approval
POST
/
agents
/
{agentId}
/
threads
/
{threadId}
/
approvals
/
{approvalId}
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 approvalRequest = await client.approvalRequests.resolve(
'agent_abc123',
'thread_abc123',
'approval_abc123',
{ decision: 'approve' },
);
console.log(approvalRequest.id);import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
approval_request = client.approval_requests.resolve(
agent_id="agent_abc123",
thread_id="thread_abc123",
approval_id="approval_abc123",
decision="approve",
)
print(approval_request.id)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"),
)
approvalRequest, err := client.ApprovalRequests.Resolve(
context.TODO(),
"agent_abc123",
"thread_abc123",
"approval_abc123",
cercago.ApprovalRequestResolveParams{
Decision: cercago.F(cercago.ApprovalRequestResolveParamsDecisionApprove),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", approvalRequest.ID)
}
require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
approval_request = cerca.approval_requests.resolve("agent_abc123", "thread_abc123", "approval_abc123", decision: :approve)
puts(approval_request)cerca approval-requests resolve \
--api-key 'My API Key' \
--agent-id agent_abc123 \
--thread-id thread_abc123 \
--approval-id approval_abc123 \
--decision approvecurl --request POST \
--url https://api.cerca.dev/agents/{agentId}/threads/{threadId}/approvals/{approvalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/agents/{agentId}/threads/{threadId}/approvals/{approvalId}",
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([
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cerca.dev/agents/{agentId}/threads/{threadId}/approvals/{approvalId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();{
"createdAt": "<string>",
"id": "<string>",
"input": "<unknown>",
"resolvedAt": "<string>",
"runtimeToolName": "get_time",
"status": "pending",
"threadId": "<string>",
"timeoutAt": "<string>",
"timeoutMs": 123,
"toolIndex": 123,
"toolName": "<string>",
"toolUseId": "<string>",
"turnId": "<string>",
"toolSourceId": "<string>",
"toolSourceVersion": 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"
}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"
Minimum string length:
1Example:
"approval_abc123"
Body
application/json
Response
Resolved approval request.
Parsed JSON tool input from the original tool call. Generated SDKs may expose this as unknown or Any.
Available options:
get_time, sub_thread, wait, tool.call, tool.discover, artifact.read, agent.threads.list, agent.threads.get, agent.approvals.cancel, agent.approvals.grant_thread, agent.approvals.grant_agent, agent.create, agent.approvals.update, tool.connect, sandbox.exec, sandbox.read, sandbox.write_file, sandbox.read_file, sandbox.spawn, sandbox.stdin, sandbox.session_read, sandbox.kill, sandbox.list_sessions, sandbox.sync_artifact, memory.read, memory.list, memory.search, memory.write, memory.delete, db.query, web.search, web.fetch, agent.schedule.list, agent.schedule.create, agent.schedule.update, agent.schedule.delete, agent.schedule.trigger Available options:
pending, approved, denied, cancelled, timed_out