# PATCH /agent-ops/runs/:run_id

**Resource:** [Agent Ops](./agent-ops.md)  
**MCP tool:** `update_agent_run`  
**Scopes:** `agent-ops:write`  
**Write operation:** yes

Update an agent run.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `run_id` | path | string | yes | UUID of the run log entry to update. |
| `eve_id` | body | string | no | Identifier of the host that executed the run. |
| `agent_name` | body | string | no | Machine name of the agent that ran. Matches agent_registry.name. |
| `task_type` | body | string | no | What kind of work the run performed. |
| `status` | body | string | no | Outcome of the run, e.g. running, complete or failed. |
| `model` | body | string | no | Model identifier the run used. |
| `started_at` | body | string | no | ISO 8601 timestamp the run started. |
| `completed_at` | body | string | no | ISO 8601 timestamp the run finished. Null while still running. |
| `duration_ms` | body | number | no | Wall-clock duration of the run in milliseconds. |
| `output_summary` | body | string | no | Short summary of what the run produced. |
| `notepad_id` | body | string | no | UUID of the notepad the run wrote its output to. |
| `slack_sent` | body | boolean | no | Whether the run posted its summary to the team chat room. |
| `prompt_chars` | body | number | no | Characters of prompt sent, for cost tracking. |
| `output_chars` | body | number | no | Characters of output produced, for cost tracking. |
| `exit_code` | body | number | no | Process exit code. 0 means success. |
| `error_message` | body | string | no | One-line failure reason when the run failed. |
| `error_detail` | body | string | no | Full error text or stack trace for debugging. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/agent-ops/runs/:run_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"eve_id":"...","agent_name":"...","task_type":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`