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

# Get Sandbox Logs

> What happened to the sandbox and what was sent to it, newest first: lifecycle events, commands with their output, computer use actions and screen openings. `source` says where each one came from: `panel`, `api` or `system`.

Up to `limit` events a page. When `meta.more` is true, pass the `id` of the last event as `before` to read the next page.

Command output is kept up to 2000 characters per stream. The values of environment variables are never logged.



## OpenAPI

````yaml GET /sandboxes/{sandbox}/logs
openapi: 3.0.3
info:
  title: CloudBlast API
  description: >-
    The CloudBlast V2 API provides a modern RESTful interface for managing your
    cloud infrastructure programmatically. All responses follow a consistent `{
    "data": ... }` or `{ "error": ... }` format.
  version: 2.0.0
servers:
  - url: https://console.cloudblast.io/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /sandboxes/{sandbox}/logs:
    get:
      tags:
        - Sandboxes
      summary: Get sandbox logs
      description: >-
        What happened to the sandbox and what was sent to it, newest first:
        lifecycle events, commands with their output, computer use actions and
        screen openings. `source` says where each one came from: `panel`, `api`
        or `system`.


        Up to `limit` events a page. When `meta.more` is true, pass the `id` of
        the last event as `before` to read the next page.


        Command output is kept up to 2000 characters per stream. The values of
        environment variables are never logged.
      operationId: getSandboxLogs
      parameters:
        - $ref: '#/components/parameters/SandboxIdentifier'
        - name: type
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - lifecycle
              - commands
              - computer
              - screen
            default: all
          description: >-
            `commands`: commands only. `computer`: computer use actions only.
            `screen`: screen openings only. `lifecycle`: everything else
            (create, start, stop, destroy, auto-stop and the like).
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
          description: Events per page.
        - name: before
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: >-
            Only events older than this event `id`. Pass the last `id` of a page
            to read the next one.
      responses:
        '200':
          description: Events, newest first
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SandboxEvent'
                  meta:
                    type: object
                    properties:
                      more:
                        type: boolean
                        description: >-
                          True when there are older events. Pass the last `id`
                          as `before` to read them.
                        example: true
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/SandboxNotFound'
        '422':
          $ref: '#/components/responses/SandboxValidationError'
components:
  parameters:
    SandboxIdentifier:
      name: sandbox
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: >-
        Sandbox UUID, as returned in the `uuid` field. Only the full UUID works
        here.
      example: 9b2f4c1e-7d3a-4e8b-a5c6-1f0e2d3c4b5a
  schemas:
    SandboxEvent:
      type: object
      properties:
        id:
          type: integer
          description: Pass as `before` to read the events older than this one.
          example: 1842
        at:
          type: string
          format: date-time
          description: When it happened, with milliseconds.
          example: '2026-11-19T10:15:42.318+00:00'
        source:
          type: string
          enum:
            - panel
            - api
            - system
          description: >-
            Who did it: you in the panel, you through the API (the CLI and MCP
            server included), or the platform.
          example: api
        action:
          type: string
          enum:
            - create
            - started
            - start
            - stop
            - stopped
            - destroy
            - destroyed
            - command
            - computer
            - screen
            - environment
            - auto_stop
            - auto_destroy
            - no_credit
          example: command
        status:
          type: string
          enum:
            - ok
            - failed
          description: A command that ran with a non-zero exit code is `failed`.
          example: ok
        message:
          type: string
          nullable: true
          description: One line about it. For a command, the command itself.
          example: python3 --version && echo $MODE
        detail:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            More about it. For a command: `command`, `finished`, `exit_code`,
            and the first 2000 characters of `stdout` and `stderr`.
          example:
            command: python3 --version && echo $MODE
            finished: true
            exit_code: 0
            stdout: |
              Python 3.12.3
              test
            stderr: ''
            cut: false
        duration_ms:
          type: integer
          nullable: true
          description: How long it took, when that was measured.
          example: 412
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code
            message:
              type: string
              description: Human-readable error message
          required:
            - code
            - message
    SandboxError:
      type: object
      description: >-
        How the sandbox endpoints answer an error: a `message`, not an error
        code. `errors` is only there when a request field failed validation.
      properties:
        message:
          type: string
          description: What went wrong, in plain words.
          example: Start the sandbox first.
        errors:
          type: object
          description: Messages per field, only when a field failed validation.
          additionalProperties:
            type: array
            items:
              type: string
          example:
            image_id:
              - The image id field is required.
      required:
        - message
  responses:
    Unauthenticated:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHENTICATED
              message: >-
                Missing or invalid Authorization header. Use: Authorization:
                Bearer <token>
    SandboxNotFound:
      description: No sandbox with this UUID on your account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SandboxError'
          example:
            message: Sandbox not found.
    SandboxValidationError:
      description: >-
        A field failed validation. Send `Accept: application/json` to get this
        as JSON: without it, the answer is a 302 redirect.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SandboxError'
          example:
            message: The command field is required.
            errors:
              command:
                - The command field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token from your CloudBlast account settings. Pass as `Authorization:
        Bearer <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.