# API: Agents

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/policy-decisions` | Policy engine decisions on agent actions, newest first | `agents:read` |
| GET | `/v1/runs` | List runs, newest first | `agents:read` |
| 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` |

## Examples

### GET /v1/policy-decisions

Policy engine decisions on agent actions, newest first

```bash
curl -s "https://api.ferryseal.com/v1/policy-decisions" \
  -H "Authorization: Bearer $FT_API_KEY"
```

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

### GET /v1/runs

List runs, newest first

```bash
curl -s "https://api.ferryseal.com/v1/runs" \
  -H "Authorization: Bearer $FT_API_KEY"
```

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

### GET /v1/runs/$ID

Get a run with its effect-tagged step trace

```bash
curl -s "https://api.ferryseal.com/v1/runs/$ID" \
  -H "Authorization: Bearer $FT_API_KEY"
```

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

### POST /v1/runs/$ID/cancel

Cancel a run that hasn't finished

```bash
curl -s -X POST "https://api.ferryseal.com/v1/runs/$ID/cancel" \
  -H "Authorization: Bearer $FT_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/runs/${id}/cancel`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.FT_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.ferryseal.com/openapi.json](https://www.ferryseal.com/openapi.json). All resources: [API reference](https://www.ferryseal.com/docs/api).
