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

Lists durable conversation sessions across every workspace in the project, with the most recently active first. These sessions contain messages and execution runs. They are separate from runtime sessions, which track reserved sandbox capacity. To get the next page, pass next_cursor from the response as cursor.

Path parameters

  • id string Required

    Project ID

Query parameters

  • limit integer

    Max results (default 50, max 200)

  • workspace_id string

    Restrict to a single workspace

  • status string

    Filter by the session's latest execution status

  • since string

    Only sessions with activity at or after this RFC3339 time

  • until string

    Only sessions with activity before this RFC3339 time

  • cursor string

    Opaque paging token from a previous response's next_cursor

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
    • has_more boolean
    • limit integer
    • next_cursor string

      NextCursor is an opaque token to pass back as the cursor query param, nil when this page is the last. Opaque so the paging position can change shape without breaking clients, matching the convention the other paged endpoints on this gateway already use.

    • sessions array[object]
      Hide sessions attributes Show sessions attributes object
      • active_duration_ms integer

        ActiveDurationMS sums each run's own elapsed time, so it agrees with the per-run durations the session's runs endpoint reports and excludes the gaps between turns. Zero from an orchestration engine that predates it.

      • created_at string
      • first_message_preview string
      • last_activity string
      • latest_status string

        LatestStatus is the status of the session's most recent execution.

      • project_id string
      • session_id string
      • total_duration_ms integer

        TotalDurationMS is wall-clock elapsed time from the session's first execution to its last activity, so it includes idle time between turns.

      • total_tokens integer

        TotalTokens is a lower bound: it sums the per-call counts recorded for LLM calls routed through the OE and excludes memory-extraction tokens.

      • turns integer
      • user_id string
      • visibility string
      • wait_ms integer

        WaitMS sums settled human-review wait across the session's runs, plus the open window so far on a currently suspended one. Zero from an orchestration engine that predates it.

      • workspace_id string
    • total_count integer

      TotalCount is the number of sessions matching the filter. Present only on the first page: counting it means fetching every match, which is what cursor paging exists to avoid, and it cannot change mid-walk.

    • truncated boolean
    Hide response attributes Show response attributes object
    • has_more boolean
    • limit integer
    • next_cursor string

      NextCursor is an opaque token to pass back as the cursor query param, nil when this page is the last. Opaque so the paging position can change shape without breaking clients, matching the convention the other paged endpoints on this gateway already use.

    • sessions array[object]
      Hide sessions attributes Show sessions attributes object
      • active_duration_ms integer

        ActiveDurationMS sums each run's own elapsed time, so it agrees with the per-run durations the session's runs endpoint reports and excludes the gaps between turns. Zero from an orchestration engine that predates it.

      • created_at string
      • first_message_preview string
      • last_activity string
      • latest_status string

        LatestStatus is the status of the session's most recent execution.

      • project_id string
      • session_id string
      • total_duration_ms integer

        TotalDurationMS is wall-clock elapsed time from the session's first execution to its last activity, so it includes idle time between turns.

      • total_tokens integer

        TotalTokens is a lower bound: it sums the per-call counts recorded for LLM calls routed through the OE and excludes memory-extraction tokens.

      • turns integer
      • user_id string
      • visibility string
      • wait_ms integer

        WaitMS sums settled human-review wait across the session's runs, plus the open window so far on a currently suspended one. Zero from an orchestration engine that predates it.

      • workspace_id string
    • total_count integer

      TotalCount is the number of sessions matching the filter. Present only on the first page: counting it means fetching every match, which is what cursor paging exists to avoid, and it cannot change mid-walk.

    • truncated boolean
  • 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
curl \
 --request GET 'https://agentengine.mongodb.com/api/v1/projects/{id}/sessions' \
 --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)
{
  "has_more": true,
  "limit": 42,
  "next_cursor": "string",
  "sessions": [
    {
      "active_duration_ms": 42,
      "created_at": "string",
      "first_message_preview": "string",
      "last_activity": "string",
      "latest_status": "string",
      "project_id": "string",
      "session_id": "string",
      "total_duration_ms": 42,
      "total_tokens": 42,
      "turns": 42,
      "user_id": "string",
      "visibility": "string",
      "wait_ms": 42,
      "workspace_id": "string"
    }
  ],
  "total_count": 42,
  "truncated": true
}
Response examples (200)
{
  "has_more": true,
  "limit": 42,
  "next_cursor": "string",
  "sessions": [
    {
      "active_duration_ms": 42,
      "created_at": "string",
      "first_message_preview": "string",
      "last_activity": "string",
      "latest_status": "string",
      "project_id": "string",
      "session_id": "string",
      "total_duration_ms": 42,
      "total_tokens": 42,
      "turns": 42,
      "user_id": "string",
      "visibility": "string",
      "wait_ms": 42,
      "workspace_id": "string"
    }
  ],
  "total_count": 42,
  "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
}