Skip to main content
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);
{
  "createdAt": "<string>",
  "id": "<string>",
  "input": "<unknown>",
  "resolvedAt": "<string>",
  "threadId": "<string>",
  "timeoutAt": "<string>",
  "timeoutMs": 123,
  "toolIndex": 123,
  "toolName": "<string>",
  "toolUseId": "<string>",
  "turnId": "<string>",
  "toolSourceId": "<string>",
  "toolSourceVersion": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.cerca.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required
Minimum string length: 1
Example:

"agent_abc123"

threadId
string
required
Minimum string length: 1
Example:

"thread_abc123"

approvalId
string
required
Minimum string length: 1
Example:

"approval_abc123"

Body

application/json
decision
enum<string>
required
Available options:
approve,
deny,
cancel
grant
enum<string>
Available options:
thread,
agent
{key}
any

Response

Resolved approval request.

createdAt
string
required
id
string
required
input
any
required

Parsed JSON tool input from the original tool call. Generated SDKs may expose this as unknown or Any.

resolvedAt
string | null
required
runtimeToolName
enum<string>
required
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
status
enum<string>
required
Available options:
pending,
approved,
denied,
cancelled,
timed_out
threadId
string
required
timeoutAt
string | null
required
timeoutMs
number | null
required
toolIndex
number
required
toolName
string
required
toolUseId
string
required
turnId
string
required
toolSourceId
string
toolSourceVersion
number