# API: Governance

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/governance/agents` | Every agent: who answers for it, its autonomy, tools granted, data sources it's kept from, and its last 30 days (owner) | `audit:read` |
| GET | `/v1/governance/agents/:id/decisions` | An agent's decision history: approvals by people and policy decisions, oldest first (owner; JSON, JSONL or CSV) | `audit:read` |
| GET | `/v1/governance/incidents` | Incident reports: runs that failed, were cancelled or were refused by policy, each with its timeline (owner) | `audit:read` |
| GET | `/v1/source-access` | Each connected data source with who may see what came from it and which AI surfaces may read it (owner) | `security:write` |
| PUT | `/v1/source-access/:connection_id` | Limit a data source to roles and teams, and choose whether Ask, MCP clients and agents (all or named) may read it; null clears the rule (owner) (web app only) | `security:write` |

## Examples

### GET /v1/governance/agents

Every agent: who answers for it, its autonomy, tools granted, data sources it's kept from, and its last 30 days (owner)

```bash
curl -s "https://api.closefinch.com/v1/governance/agents" \
  -H "Authorization: Bearer $RA_API_KEY"
```

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

### GET /v1/governance/agents/$ID/decisions

An agent's decision history: approvals by people and policy decisions, oldest first (owner; JSON, JSONL or CSV)

```bash
curl -s "https://api.closefinch.com/v1/governance/agents/$ID/decisions" \
  -H "Authorization: Bearer $RA_API_KEY"
```

```js
const res = await fetch(`https://api.closefinch.com/v1/governance/agents/${id}/decisions`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/governance/incidents

Incident reports: runs that failed, were cancelled or were refused by policy, each with its timeline (owner)

```bash
curl -s "https://api.closefinch.com/v1/governance/incidents" \
  -H "Authorization: Bearer $RA_API_KEY"
```

```js
const res = await fetch(`https://api.closefinch.com/v1/governance/incidents`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/source-access

Each connected data source with who may see what came from it and which AI surfaces may read it (owner)

```bash
curl -s "https://api.closefinch.com/v1/source-access" \
  -H "Authorization: Bearer $RA_API_KEY"
```

```js
const res = await fetch(`https://api.closefinch.com/v1/source-access`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();
```

Request and response schemas: [https://www.closefinch.com/openapi.json](https://www.closefinch.com/openapi.json). All resources: [API reference](https://www.closefinch.com/docs/api).
