API reference
API: Agents
| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | /v1/agents | Agents: built-in ones and your organization's, with state, version, triggers, integrations and run counters | agents:read |
| GET | /v1/policy-decisions | Policy engine decisions on agent actions, newest first | agents:read |
| GET | /v1/runs | List runs, newest first | agents:read |
| POST | /v1/runs | Start an agent run | agents:write |
| GET | /v1/runs/:id | Get a run with its effect-tagged step trace | agents:read |
| POST | /v1/runs/:id/approve | Approve the run's pending action and resume it | approvals:write |
| POST | /v1/runs/:id/cancel | Cancel a run that hasn't finished | agents:write |
| POST | /v1/runs/:id/reject | Reject the run's pending action; the run ends | approvals:write |
| POST | /v1/runs/:id/replay | Start a new run with the same agent and input | agents: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.