Get agent runtime logs

GET /api/v1/projects/{id}/agent-logs

Retrieve gzipped JSONL log batches written by the agent runtime to S3 for a workspace. The project scope is carried by the route id path parameter and the org is derived from that project.

Path parameters

  • id string Required

    Project ID

Query parameters

  • workspace_id string Required

    Workspace identifier

  • start_time string

    RFC3339 start time (default: 1 hour ago; range must not exceed 6 hours)

  • end_time string

    RFC3339 end time (default: now; range must not exceed 6 hours)

  • limit integer

    Max entries (default 500, max 5000)

  • cursor string

    Opaque pagination cursor from a previous response

  • level string

    Log levels to match exactly, comma- or space-separated (DEBUG, INFO, WARNING, ERROR; warn/err aliases also accepted). Breaking change from the prior minimum-severity filter: level=INFO now returns INFO only, not INFO+WARNING+ERROR.

  • execution_id string

    Filter by execution ID (exact match)

  • session_id string

    Filter by session ID (exact match)

  • source string

    Source(s) to match exactly, comma- or space-separated (stdout, stderr, python-logging, node-logging)

  • service string

    Service(s) to match exactly, comma- or space-separated (agent-execution-runtime, tool-executor; agent/tool aliases also accepted)

  • order string

    Sort order: asc (default, oldest-first) or desc (newest-first)

  • tail boolean

    Return only the latest entries as a single page (mutually exclusive with 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
    • hasMore boolean
    • logs array[object]
      Hide logs attributes Show logs attributes object
      • bootId string
      • executionId string
      • fields object

        Additional properties are allowed.

      • level string
      • logger string
      • message string
      • podName string
      • service string
      • sessionId string
      • source string
      • tenantId string
      • timestamp string
      • traceId string
      • workspaceId string
    • nextCursor string
    Hide response attributes Show response attributes object
    • hasMore boolean
    • logs array[object]
      Hide logs attributes Show logs attributes object
      • bootId string
      • executionId string
      • fields object

        Additional properties are allowed.

      • level string
      • logger string
      • message string
      • podName string
      • service string
      • sessionId string
      • source string
      • tenantId string
      • timestamp string
      • traceId string
      • workspaceId string
    • nextCursor string
  • 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
  • Forbidden

    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
  • Not Found

    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
  • 429

    Too Many Requests

    Hide headers attribute Show headers attribute
    • Retry-After string

      Seconds before retrying

    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
  • 503

    Service Unavailable

    Hide headers attribute Show headers attribute
    • Retry-After string

      Seconds before retrying

    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}/agent-logs
curl \
 --request GET 'https://agentengine.mongodb.com/api/v1/projects/{id}/agent-logs?workspace_id=string' \
 --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)
{
  "hasMore": true,
  "logs": [
    {
      "bootId": "string",
      "executionId": "string",
      "fields": {},
      "level": "string",
      "logger": "string",
      "message": "string",
      "podName": "string",
      "service": "string",
      "sessionId": "string",
      "source": "string",
      "tenantId": "string",
      "timestamp": "string",
      "traceId": "string",
      "workspaceId": "string"
    }
  ],
  "nextCursor": "string"
}
Response examples (200)
{
  "hasMore": true,
  "logs": [
    {
      "bootId": "string",
      "executionId": "string",
      "fields": {},
      "level": "string",
      "logger": "string",
      "message": "string",
      "podName": "string",
      "service": "string",
      "sessionId": "string",
      "source": "string",
      "tenantId": "string",
      "timestamp": "string",
      "traceId": "string",
      "workspaceId": "string"
    }
  ],
  "nextCursor": "string"
}
Response examples (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (403)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (403)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (404)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (404)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (429)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (429)
# Headers
Retry-After: string

# Payload
{
  "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 (503)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (503)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}