> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyceum.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Execution Logs

> Get all logs for a specific execution.

This endpoint queries Loki for all logs with the specified execution_id label.
Access is gated on the execution belonging to the caller's active org, since
Loki labels carry no org/user context to filter on.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/external/logs/execution/{execution_id}
openapi: 3.1.0
info:
  title: Lyceum Cloud API
  version: 0.1.0
servers:
  - url: https://api.lyceum.technology
    description: Production
security:
  - bearerAuth: []
paths:
  /api/v2/external/logs/execution/{execution_id}:
    get:
      tags:
        - Logs
      summary: Get Execution Logs
      description: >-
        Get all logs for a specific execution.


        This endpoint queries Loki for all logs with the specified execution_id
        label.

        Access is gated on the execution belonging to the caller's active org,
        since

        Loki labels carry no org/user context to filter on.
      operationId: get_execution_logs_api_v2_external_logs_execution__execution_id__get
      parameters:
        - name: execution_id
          in: path
          required: true
          schema:
            type: string
            title: Execution Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            description: Maximum number of log entries to return
            default: 1000
            title: Limit
          description: Maximum number of log entries to return
        - name: hours
          in: query
          required: false
          schema:
            type: integer
            maximum: 168
            minimum: 1
            description: Number of hours to look back
            default: 24
            title: Hours
          description: Number of hours to look back
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LogsResponse:
      properties:
        logs:
          items:
            $ref: '#/components/schemas/LogEntry'
          type: array
          title: Logs
        total:
          type: integer
          title: Total
      type: object
      required:
        - logs
        - total
      title: LogsResponse
      description: Response model for log queries.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LogEntry:
      properties:
        timestamp:
          type: string
          title: Timestamp
        message:
          type: string
          title: Message
        level:
          anyOf:
            - type: string
            - type: 'null'
          title: Level
        execution_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Execution Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        hostname:
          anyOf:
            - type: string
            - type: 'null'
          title: Hostname
        labels:
          additionalProperties:
            type: string
          type: object
          title: Labels
          default: {}
      type: object
      required:
        - timestamp
        - message
      title: LogEntry
      description: Single log entry from Loki.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Pass an API key (prefixed `lk_`) or a JWT access token as a bearer
        token. Generate API keys in the dashboard at
        https://dashboard.lyceum.technology/api-keys.

````