# Stream a Worker's container logs

`GET /workers/{workerId}/logs`



[Agents API guide](https://docs.contextual.io/tenants/tenant-apis/agents-api.md)

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Contextual Agents Api",
    "description": " "
  },
  "security": [
    {
      "jwt": []
    }
  ],
  "servers": [
    {
      "url": "https://agents.{tenantId}.my.contextual.io/api/v1",
      "variables": {
        "tenantId": {
          "default": "YOUR-TENANT-ID"
        }
      }
    }
  ],
  "paths": {
    "/workers/{workerId}/logs": {
      "get": {
        "tags": [
          "Workers"
        ],
        "summary": "Stream a Worker's container logs",
        "parameters": [
          {
            "name": "tail",
            "in": "query",
            "description": "only the last lines of each container"
          },
          {
            "name": "since",
            "in": "query",
            "description": "only lines newer than this duration, e.g. 10m"
          },
          {
            "name": "previous",
            "in": "query",
            "description": "each container's previous run"
          },
          {
            "name": "follow",
            "in": "query",
            "description": "keep streaming, including containers that start later"
          },
          {
            "name": "container",
            "in": "query",
            "description": "only these containers, repeated for more; by default every container except the network gate"
          },
          {
            "name": "workerId",
            "in": "path",
            "required": true
          }
        ],
        "deprecated": false,
        "responses": {
          "200": {
            "description": "Server-sent events: `line` { pod, container, time, line }, `notice` { pod, container, message }, then `end` { message? }",
            "content": {}
          },
          "400": {
            "description": "Invalid query, or a container the Worker's pods don't have",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid authorization header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Invalid permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Worker not found",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "$ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "number"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    }
  }
}
```