Skip to content

API reference

API: Agents

Markdown version

MethodPathWhat it doesScope
GET/v1/agentsAgents: built-in ones and your organization's, with state, version, triggers, integrations and run countersagents:read
GET/v1/policy-decisionsPolicy engine decisions on agent actions, newest firstagents:read
GET/v1/runsList runs, newest firstagents:read
POST/v1/runsStart an agent runagents:write
GET/v1/runs/:idGet a run with its effect-tagged step traceagents:read
POST/v1/runs/:id/approveApprove the run's pending action and resume itapprovals:write
POST/v1/runs/:id/cancelCancel a run that hasn't finishedagents:write
POST/v1/runs/:id/rejectReject the run's pending action; the run endsapprovals:write
POST/v1/runs/:id/replayStart a new run with the same agent and inputagents:write

Examples

GET /v1/agents

Agents: built-in ones and your organization's, with state, version, triggers, integrations and run counters

curl -s "https://api.closefinch.com/v1/agents" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/agents`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/policy-decisions

Policy engine decisions on agent actions, newest first

curl -s "https://api.closefinch.com/v1/policy-decisions" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/policy-decisions`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/runs

List runs, newest first

curl -s "https://api.closefinch.com/v1/runs" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/runs`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/runs

Start an agent run

curl -s -X POST "https://api.closefinch.com/v1/runs" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/runs`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/runs/$ID

Get a run with its effect-tagged step trace

curl -s "https://api.closefinch.com/v1/runs/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/runs/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/runs/$ID/cancel

Cancel a run that hasn't finished

curl -s -X POST "https://api.closefinch.com/v1/runs/$ID/cancel" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/runs/${id}/cancel`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/runs/$ID/replay

Start a new run with the same agent and input

curl -s -X POST "https://api.closefinch.com/v1/runs/$ID/replay" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/runs/${id}/replay`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

Request and response schemas: https://www.closefinch.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.

Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.