# Agent Ops

Observability and management for AI agent infrastructure. Covers: registry, run log, signals, metrics, tool log, report runs, alert rules, fired alerts, and the aggregated dashboard. All routes require agent-ops:read (reads) or agent-ops:write (writes/actions).

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### GET /agent-ops/dashboard

Aggregated agent operations summary: all registered agents, today's runs, pending signals, and report status. Free (0 credits).

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-dashboard.md)

### GET /agent-ops/registry

List all registered AI agents. Filter by agent_type or status.

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-registry.md)

### POST /agent-ops/registry

Register a new AI agent.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-registry.md)

### GET /agent-ops/registry/:id

Get a single registered agent by UUID.

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-registry-id.md)

### PATCH /agent-ops/registry/:id

Update an agent registry entry.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/patch-agent-ops-registry-id.md)

### DELETE /agent-ops/registry/:id

Delete an agent registry entry. Requires agent-ops:delete scope.

**Scopes:** `agent-ops:delete` — [full detail](./agent-ops/delete-agent-ops-registry-id.md)

### POST /agent-ops/registry/:id/test-run

Trigger a manual test run for a managed agent. Verifies company ownership, confirms the agent is active and managed_agents runtime, then proxies to the dispatcher. Returns a run_id and session_id. Requires agent-ops:write scope.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-registry-id-test-run.md)

### POST /agent-ops/registry/:id/definition

Update the managed agent definition (bumps the version on the underlying AI platform). Verifies company ownership of both the registry row and the linked definition before proxying. Body must contain an "agent" key with the update payload. Requires agent-ops:write scope.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-registry-id-definition.md)

### GET /agent-ops/runs

List agent run log entries. Filter by agent_name, status, or since date.

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-runs.md)

### POST /agent-ops/runs

Log a new agent run. If eve_id is provided and already exists, upserts.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-runs.md)

### PATCH /agent-ops/runs/:id

Update an agent run by UUID or eve_id. Automatically updates agent registry stats on completion or failure.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/patch-agent-ops-runs-id.md)

### GET /agent-ops/signals

List inter-agent signals. Filter by for_agent, created_by, signal type, or pending.

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-signals.md)

### POST /agent-ops/signals

Send an inter-agent signal.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-signals.md)

### GET /agent-ops/alert-rules

List configured alert rules for agents.

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-alert-rules.md)

### POST /agent-ops/alert-rules

Create an alert rule. Types: consecutive_failures, duration_exceeded, no_run_since, error_rate.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-alert-rules.md)

### GET /agent-ops/alerts

List fired agent alerts. Filter by agent_name or unacknowledged.

**Scopes:** `agent-ops:read` — [full detail](./agent-ops/get-agent-ops-alerts.md)

### POST /agent-ops/alerts/:id/acknowledge

Acknowledge a fired alert.

**Scopes:** `agent-ops:write` — [full detail](./agent-ops/post-agent-ops-alerts-id-acknowledge.md)
