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

# Get Devbox logs.

> Get all logs from a running or completed Devbox.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json get /v1/devboxes/{id}/logs
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/devboxes/{id}/logs:
    get:
      tags:
        - Devbox
        - Devbox-ObservabilityTools
      summary: Get Devbox logs.
      description: Get all logs from a running or completed Devbox.
      operationId: listDevboxLogs
      parameters:
        - name: id
          in: path
          description: The Devbox ID.
          required: true
          schema:
            type: string
        - name: execution_id
          in: query
          description: ID of execution to filter logs by.
          allowEmptyValue: true
          schema:
            type: string
        - name: shell_name
          in: query
          description: Shell Name to filter logs by.
          allowEmptyValue: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevboxLogsListView'
        '404':
          description: Devbox not found.
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Runloop from '@runloop/api-client';

            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });

            const devboxLogsListView = await client.devboxes.logs.list('id');

            console.log(devboxLogsListView.logs);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            devbox_logs_list_view = client.devboxes.logs.list(
                id="id",
            )
            print(devbox_logs_list_view.logs)
components:
  schemas:
    DevboxLogsListView:
      type: object
      properties:
        logs:
          type: array
          items:
            $ref: '#/components/schemas/DevboxLog'
          description: List of logs for the given devbox.
      required:
        - logs
    DevboxLog:
      type: object
      properties:
        cmd_id:
          description: Identifier of the associated command the log is sourced from.
          type:
            - string
            - 'null'
        level:
          type: string
          description: Log line severity level.
        timestamp_ms:
          type: integer
          format: int64
          description: Time of log (Unix timestamp milliseconds).
        shell_name:
          description: The Shell name the cmd executed in.
          type:
            - string
            - 'null'
        cmd:
          description: The Command Executed
          type:
            - string
            - 'null'
        message:
          description: Log line message.
          type:
            - string
            - 'null'
        exit_code:
          format: int32
          description: The Exit Code of the command
          type:
            - integer
            - 'null'
        source:
          $ref: '#/components/schemas/DevboxLogSource'
          description: The source of the log.
      required:
        - level
        - timestamp_ms
        - source
    DevboxLogSource:
      type: string
      enum:
        - setup_commands
        - entrypoint
        - exec
        - files
        - stats
        - kmsg
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````