Get a session's runs

GET /api/v1/projects/{id}/sessions/{session_id}/runs

Returns the session's runs oldest-first, each with its steps in order. A step carries its kind, start offset within the run, duration, token count, status, and step_number.

Path parameters

  • id string Required

    Project ID

  • session_id string Required

    Session ID

Query parameters

  • workspace_id string

    Workspace ID for workspace resolution

Responses

  • Unsupported or malformed API version, an operation unavailable in the selected published contract, or an unacceptable representation (including unsupported media-type parameters or excluded SSE). Existing authentication, authorization, and rate-limit failures take precedence.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Optional validation details defined by the standard error schema; API negotiation errors do not emit this field.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Fields with validation failures.

        Hide fields attributes Show fields attributes object

        A field and its validation failure.

        • description string Required

          Human-readable validation failure.

        • field string Required

          Name or path of the invalid request field.

    • detail string Required

      Human-readable error details.

    • error integer Required

      HTTP status code.

    • errorCode string Required

      Machine-readable error code.

    • parameters array[string]

      Request parameter names associated with the error; omitted when none apply.

    • reason string Required

      HTTP status reason phrase.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Optional validation details defined by the standard error schema; API negotiation errors do not emit this field.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Fields with validation failures.

        Hide fields attributes Show fields attributes object

        A field and its validation failure.

        • description string Required

          Human-readable validation failure.

        • field string Required

          Name or path of the invalid request field.

    • detail string Required

      Human-readable error details.

    • error integer Required

      HTTP status code.

    • errorCode string Required

      Machine-readable error code.

    • parameters array[string]

      Request parameter names associated with the error; omitted when none apply.

    • reason string Required

      HTTP status reason phrase.

  • 200

    OK

    Hide response attributes Show response attributes object
    • count integer
    • runs array[object]
      Hide runs attributes Show runs attributes object
      • active_duration_ms integer
      • completion_tokens integer
      • duration_ms integer

        DurationMS is wall-clock time from the run's start to its last update.

      • error string
      • error_code string
      • execution_id string
      • invoker_user_id string
      • memory_recalls integer

        MemoryRecalls and MemorySaves count settled memory steps, a lower bound on a truncated read.

      • memory_saves integer
      • prompt_tokens integer

        PromptTokens and CompletionTokens split TotalTokens. Both absent when the run has no settled llm step.

      • run_number integer

        RunNumber is the run's 1-based position in the session, oldest first. When truncated is true it is relative to the returned window instead: the oldest runs are the ones dropped at the cap, so run 1 is not the session's first.

      • session_id string
      • slowest_step object

        SlowestStep is absent when the run has no settled step.

        Hide slowest_step attributes Show slowest_step attributes object
        • duration_ms number
        • kind string
        • name string
        • step_number integer
      • started_at string
      • startup_failure object
        Hide startup_failure attributes Show startup_failure attributes object
        • boot_id string
        • code string
        • component string
        • phase string
        • source string
      • status string
      • steps array[object]
        Hide steps attributes Show steps attributes object
        • completion_tokens integer
        • duration_ms number

          DurationMS is absent for a step that has not settled yet.

        • error string
        • kind string

          Kind is the step's category: llm, tool, memory, guardrail, policy, a2a, or agent_step.

        • memory_op string

          MemoryOp is "recall" or "save" on a settled memory step, absent otherwise.

        • name string
        • presented string
        • presented_truncated boolean
        • prompt_tokens integer

          PromptTokens and CompletionTokens split TotalTokens, both present only on a settled llm step.

        • review_outcome string

          ReviewOutcome, WaitMS and ReviewTrigger are present only on human_review steps: the wait's state ("pending", then "approved"/"rejected"), its settled length in ms (absent while pending), and the guardrail that routed the call to review.

        • review_trigger string
        • reviewer string

          Reviewer/ReviewerNotes/Presented mirror the OE review record: deciding human, their note, and a capped excerpt of what they reviewed.

        • reviewer_notes string
        • run_id string

          RunID is the graph node invocation's identifier, present only on agent_step. It is the only key that ties a node step to its node_executions row.

        • span_id string

          SpanID joins this step to its full trace detail in the spans collection.

        • start_offset_ms integer

          StartOffsetMS is milliseconds from the run's start to this step's start.

        • started_at string
        • status string
        • step_number integer

          StepNumber is the value the interrupt endpoint targets. Absent on agent_step, which records graph structure and has no interruptible step.

        • tool_call_id string
        • total_tokens integer

          TotalTokens is present only on settled llm steps.

        • wait_ms integer
      • summary string

        Summary is the run's invoking message, truncated server-side.

      • time_to_first_event_ms integer

        TimeToFirstEventMS is the first step's offset, absent when the run has no steps yet.

      • total_tokens integer

        TotalTokens sums the run's settled llm steps, so it is a lower bound on what the run actually spent.

      • user_id string

        UserID and InvokerUserID mirror the run's execution identity: the delegation target the run executed as and the gateway-authenticated caller who started it. Either may be absent — see the OE's SessionRun. Both are omitted from the support-safe view.

      • wait_ms integer

        WaitMS is the run's settled human-review wait, absent when the run never suspended. ActiveDurationMS excludes that wait; both absent from an orchestration engine that predates them.

      • workspace_id string
    • truncated boolean

      Truncated reports that the session had more rows than the OE returns in one read, so this is a partial view. Mirrored from the OE response.

    Hide response attributes Show response attributes object
    • count integer
    • runs array[object]
      Hide runs attributes Show runs attributes object
      • active_duration_ms integer
      • completion_tokens integer
      • duration_ms integer

        DurationMS is wall-clock time from the run's start to its last update.

      • error string
      • error_code string
      • execution_id string
      • invoker_user_id string
      • memory_recalls integer

        MemoryRecalls and MemorySaves count settled memory steps, a lower bound on a truncated read.

      • memory_saves integer
      • prompt_tokens integer

        PromptTokens and CompletionTokens split TotalTokens. Both absent when the run has no settled llm step.

      • run_number integer

        RunNumber is the run's 1-based position in the session, oldest first. When truncated is true it is relative to the returned window instead: the oldest runs are the ones dropped at the cap, so run 1 is not the session's first.

      • session_id string
      • slowest_step object

        SlowestStep is absent when the run has no settled step.

        Hide slowest_step attributes Show slowest_step attributes object
        • duration_ms number
        • kind string
        • name string
        • step_number integer
      • started_at string
      • startup_failure object
        Hide startup_failure attributes Show startup_failure attributes object
        • boot_id string
        • code string
        • component string
        • phase string
        • source string
      • status string
      • steps array[object]
        Hide steps attributes Show steps attributes object
        • completion_tokens integer
        • duration_ms number

          DurationMS is absent for a step that has not settled yet.

        • error string
        • kind string

          Kind is the step's category: llm, tool, memory, guardrail, policy, a2a, or agent_step.

        • memory_op string

          MemoryOp is "recall" or "save" on a settled memory step, absent otherwise.

        • name string
        • presented string
        • presented_truncated boolean
        • prompt_tokens integer

          PromptTokens and CompletionTokens split TotalTokens, both present only on a settled llm step.

        • review_outcome string

          ReviewOutcome, WaitMS and ReviewTrigger are present only on human_review steps: the wait's state ("pending", then "approved"/"rejected"), its settled length in ms (absent while pending), and the guardrail that routed the call to review.

        • review_trigger string
        • reviewer string

          Reviewer/ReviewerNotes/Presented mirror the OE review record: deciding human, their note, and a capped excerpt of what they reviewed.

        • reviewer_notes string
        • run_id string

          RunID is the graph node invocation's identifier, present only on agent_step. It is the only key that ties a node step to its node_executions row.

        • span_id string

          SpanID joins this step to its full trace detail in the spans collection.

        • start_offset_ms integer

          StartOffsetMS is milliseconds from the run's start to this step's start.

        • started_at string
        • status string
        • step_number integer

          StepNumber is the value the interrupt endpoint targets. Absent on agent_step, which records graph structure and has no interruptible step.

        • tool_call_id string
        • total_tokens integer

          TotalTokens is present only on settled llm steps.

        • wait_ms integer
      • summary string

        Summary is the run's invoking message, truncated server-side.

      • time_to_first_event_ms integer

        TimeToFirstEventMS is the first step's offset, absent when the run has no steps yet.

      • total_tokens integer

        TotalTokens sums the run's settled llm steps, so it is a lower bound on what the run actually spent.

      • user_id string

        UserID and InvokerUserID mirror the run's execution identity: the delegation target the run executed as and the gateway-authenticated caller who started it. Either may be absent — see the OE's SessionRun. Both are omitted from the support-safe view.

      • wait_ms integer

        WaitMS is the run's settled human-review wait, absent when the run never suspended. ActiveDurationMS excludes that wait; both absent from an orchestration engine that predates them.

      • workspace_id string
    • truncated boolean

      Truncated reports that the session had more rows than the OE returns in one read, so this is a partial view. Mirrored from the OE response.

  • Bad Request

    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
  • Unauthorized

    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
  • Internal Server Error

    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
  • Bad Gateway

    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
GET /api/v1/projects/{id}/sessions/{session_id}/runs
curl \
 --request GET 'https://agentengine.mongodb.com/api/v1/projects/{id}/sessions/{session_id}/runs' \
 --header "Authorization: $API_KEY"
Response examples (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
Response examples (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
Response examples (200)
{
  "count": 42,
  "runs": [
    {
      "active_duration_ms": 42,
      "completion_tokens": 42,
      "duration_ms": 42,
      "error": "string",
      "error_code": "string",
      "execution_id": "string",
      "invoker_user_id": "string",
      "memory_recalls": 42,
      "memory_saves": 42,
      "prompt_tokens": 42,
      "run_number": 42,
      "session_id": "string",
      "slowest_step": {
        "duration_ms": 42.0,
        "kind": "string",
        "name": "string",
        "step_number": 42
      },
      "started_at": "string",
      "startup_failure": {
        "boot_id": "string",
        "code": "string",
        "component": "string",
        "phase": "string",
        "source": "string"
      },
      "status": "string",
      "steps": [
        {
          "completion_tokens": 42,
          "duration_ms": 42.0,
          "error": "string",
          "kind": "string",
          "memory_op": "string",
          "name": "string",
          "presented": "string",
          "presented_truncated": true,
          "prompt_tokens": 42,
          "review_outcome": "string",
          "review_trigger": "string",
          "reviewer": "string",
          "reviewer_notes": "string",
          "run_id": "string",
          "span_id": "string",
          "start_offset_ms": 42,
          "started_at": "string",
          "status": "string",
          "step_number": 42,
          "tool_call_id": "string",
          "total_tokens": 42,
          "wait_ms": 42
        }
      ],
      "summary": "string",
      "time_to_first_event_ms": 42,
      "total_tokens": 42,
      "user_id": "string",
      "wait_ms": 42,
      "workspace_id": "string"
    }
  ],
  "truncated": true
}
Response examples (200)
{
  "count": 42,
  "runs": [
    {
      "active_duration_ms": 42,
      "completion_tokens": 42,
      "duration_ms": 42,
      "error": "string",
      "error_code": "string",
      "execution_id": "string",
      "invoker_user_id": "string",
      "memory_recalls": 42,
      "memory_saves": 42,
      "prompt_tokens": 42,
      "run_number": 42,
      "session_id": "string",
      "slowest_step": {
        "duration_ms": 42.0,
        "kind": "string",
        "name": "string",
        "step_number": 42
      },
      "started_at": "string",
      "startup_failure": {
        "boot_id": "string",
        "code": "string",
        "component": "string",
        "phase": "string",
        "source": "string"
      },
      "status": "string",
      "steps": [
        {
          "completion_tokens": 42,
          "duration_ms": 42.0,
          "error": "string",
          "kind": "string",
          "memory_op": "string",
          "name": "string",
          "presented": "string",
          "presented_truncated": true,
          "prompt_tokens": 42,
          "review_outcome": "string",
          "review_trigger": "string",
          "reviewer": "string",
          "reviewer_notes": "string",
          "run_id": "string",
          "span_id": "string",
          "start_offset_ms": 42,
          "started_at": "string",
          "status": "string",
          "step_number": 42,
          "tool_call_id": "string",
          "total_tokens": 42,
          "wait_ms": 42
        }
      ],
      "summary": "string",
      "time_to_first_event_ms": 42,
      "total_tokens": 42,
      "user_id": "string",
      "wait_ms": 42,
      "workspace_id": "string"
    }
  ],
  "truncated": true
}
Response examples (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (502)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (502)
{
  "code": "string",
  "error": "string",
  "success": true
}