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.
Query parameters
-
Workspace identifier
-
RFC3339 start time (default: 1 hour ago; range must not exceed 6 hours)
-
RFC3339 end time (default: now; range must not exceed 6 hours)
-
Max entries (default 500, max 5000)
-
Opaque pagination cursor from a previous response
-
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.
-
Filter by execution ID (exact match)
-
Filter by session ID (exact match)
-
Source(s) to match exactly, comma- or space-separated (stdout, stderr, python-logging, node-logging)
-
Service(s) to match exactly, comma- or space-separated (agent-execution-runtime, tool-executor; agent/tool aliases also accepted)
-
Case-insensitive substring match on message or boot ID
-
Sort order: asc (default, oldest-first) or desc (newest-first)
-
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.
-
OK
-
Bad Request
-
Forbidden
-
Not Found
-
Too Many Requests
-
Internal Server Error
-
Service Unavailable
curl \
--request GET 'https://agentengine.mongodb.com/api/v1/projects/{id}/agent-logs?workspace_id=string' \
--header "Authorization: $API_KEY"
{
"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"
}
{
"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"
}
{
"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"
}
{
"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"
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
# Headers
Retry-After: string
# Payload
{
"code": "string",
"error": "string",
"success": true
}
# Headers
Retry-After: string
# Payload
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
# Headers
Retry-After: string
# Payload
{
"code": "string",
"error": "string",
"success": true
}
# Headers
Retry-After: string
# Payload
{
"code": "string",
"error": "string",
"success": true
}