---
title: "GET /projects/{project_id}/agents/runs/{run_id}"
method: GET
path: "/projects/{project_id}/agents/runs/{run_id}"
tags: ["Agents"]
---

# GET /projects/{project_id}/agents/runs/{run_id}

`GET /projects/{project_id}/agents/runs/{run_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/agents/runs/{run_id}`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `run_id` integer, required

## Response `200`

Run with logs

- AgentRunWithLogsResponse
  - `logs` AgentRunLogResponse[], required
    - `created_at` string, required
    - `id` integer, required
    - `level` string, required
    - `message` string, required
    - `metadata` unknown
    - `run_id` integer, required
  - `run` AgentRunResponse, required
    - `agent_name` string, nullable: Name of the agent that created this run, if available.
    - `agent_slug` string, nullable: Slug of the agent that created this run, if available.
    - `ai_model` string, nullable
    - `ai_output` string, nullable
    - `ai_provider` string, nullable: AI provider slug that executed this run (e.g. claude_cli, codex_cli, opencode).
    - `ai_reasoning` string, nullable
    - `ai_session_id` string, nullable: Claude CLI session UUID for resuming conversations via `--resume`.
    - `analysis` string, nullable: Report / analysis text produced by the agent (used for report/notification deliverables).
    - `branch_name` string, nullable
    - `commit_sha` string, nullable
    - `completed_at` string, nullable
    - `config_id` integer, nullable: Optional. NULL for ephemeral CLI runs (`source = "cli_ephemeral"`) and historical autofixer runs that pre-date the agent_id column.
    - `created_at` string, required
    - `ephemeral_yaml` string, nullable: Full WorkflowYamlConfig as YAML text. Populated only when `source = "cli_ephemeral"`. Used by the web UI to show a "View YAML" modal so the user can see exactly what the executor ran.
    - `error_message` string, nullable
    - `estimated_cost_cents` integer, required
    - `files_changed` integer, required
    - `id` integer, required
    - `phase` string, nullable: Autofixer phase: "analyzing", "analyzed", "fixing", "fix_ready", "no_fix", "pr_created", or NULL for non-autofixer runs.
    - `pr_number` integer, nullable
    - `pr_url` string, nullable
    - `preview_url` string, nullable
    - `project_id` integer, required
    - `prompt_text` string, nullable: Final assembled prompt the AI CLI actually saw (trigger context block + YAML prompt, with error-group fields interpolated). Captured once per run. `None` for pre-migration rows.
    - `run_config` AutofixRunConfig, nullable: User-chosen per-run options, persisted as JSON in `agent_runs.run_config`. Every field is optional — unset fields fall back to the provider defaults in settings, then to built-in defaults.
      - `branch` string, nullable: Branch to clone instead of the project's main branch.
      - `max_turns` integer, nullable: Per-run turn cap applied to every phase of this run. Only enforced for CLIs with a turn flag (Claude Code); Codex/OpenCode run to completion. `None` uses the provider's per-phase defaults.
      - `model` string, nullable: Model id for the chosen provider. `None` uses the provider's saved default model, or the CLI's own default.
      - `provider` string, nullable: AI provider id ("claude_cli", "codex_cli", "opencode"). `None` uses the platform default provider from agent sandbox settings.
    - `sandbox_enabled` boolean, required: Legacy field — all runs now execute in a sandbox. Kept for backwards-compatible JSON shape; always `true`.
    - `source` string, required: `committed` (the run's config lives in `project_agents`) or `cli_ephemeral` (the config was uploaded via the CLI for a one-off dry run; see `ephemeral_yaml`).
    - `started_at` string, nullable
    - `status` string, required
    - `tokens_input` integer, required
    - `tokens_output` integer, required
    - `trigger_source_id` integer, nullable
    - `trigger_source_type` string, nullable
    - `trigger_type` string, required
    - `user_context` string, nullable: User-provided context for this run (e.g. webhook payload, manual instructions).

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Run not found
- `500`: Internal server error

## Changes

- **2026-07-27** `1b060c0a4ba3`: 1 info
  - added the optional property `run/run_config` to the response with the `200` status
- **2026-04-25** `774be20905f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/agents/runs/:run_id/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
