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

# Get build logs

> Get template build logs



## OpenAPI

````yaml /openapi-public.yml get /templates/{templateID}/builds/{buildID}/logs
openapi: 3.1.0
info:
  title: E2B API
  version: 0.1.0
  description: >-
    Complete E2B developer API. Platform endpoints are served on api.e2b.app.
    Sandbox endpoints (envd) are served on the shared sandbox host
    (sandbox.e2b.app); target a specific sandbox with the E2b-Sandbox-Id and
    E2b-Sandbox-Port headers.
servers:
  - url: https://api.e2b.app
    description: E2B Platform API
security: []
tags:
  - name: Sandboxes
  - name: Templates
  - name: Tags
  - name: Volumes
  - name: Envd
  - name: Filesystem
  - name: Process
  - name: Teams
paths:
  /templates/{templateID}/builds/{buildID}/logs:
    servers:
      - url: https://api.e2b.app
        description: E2B Platform API
    get:
      tags:
        - Templates
      summary: Get build logs
      description: Get template build logs
      operationId: getTemplateBuildLogs
      parameters:
        - $ref: '#/components/parameters/templateID'
        - $ref: '#/components/parameters/buildID'
        - in: query
          name: cursor
          schema:
            type: integer
            format: int64
            minimum: 0
          description: >-
            Starting timestamp of the logs that should be returned in
            milliseconds
        - in: query
          name: limit
          schema:
            default: 100
            type: integer
            format: int32
            minimum: 0
            maximum: 100
          description: Maximum number of logs that should be returned
        - in: query
          name: direction
          schema:
            $ref: '#/components/schemas/LogsDirection'
        - in: query
          name: level
          schema:
            $ref: '#/components/schemas/LogLevel'
        - in: query
          name: source
          schema:
            $ref: '#/components/schemas/LogsSource'
          description: Source of the logs that should be returned from
      responses:
        '200':
          description: Successfully returned the template build logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateBuildLogsResponse'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      security:
        - AccessTokenAuth: []
        - ApiKeyAuth: []
components:
  parameters:
    templateID:
      name: templateID
      in: path
      required: true
      schema:
        type: string
    buildID:
      name: buildID
      in: path
      required: true
      schema:
        type: string
  schemas:
    LogsDirection:
      type: string
      description: Direction of the logs that should be returned
      enum:
        - forward
        - backward
      x-enum-varnames:
        - LogsDirectionForward
        - LogsDirectionBackward
    LogLevel:
      type: string
      description: Severity level for log entries (e.g. info, warn, error)
    LogsSource:
      type: string
      description: Source of the logs that should be returned
      enum:
        - temporary
        - persistent
      x-enum-varnames:
        - LogsSourceTemporary
        - LogsSourcePersistent
    TemplateBuildLogsResponse:
      required:
        - logs
      properties:
        logs:
          default: []
          description: Build logs structured
          type: array
          items:
            $ref: '#/components/schemas/BuildLogEntry'
      type: object
    BuildLogEntry:
      required:
        - timestamp
        - message
        - level
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the log entry
        message:
          type: string
          description: Log message content
        level:
          $ref: '#/components/schemas/LogLevel'
        step:
          type: string
          description: Step in the build process related to the log entry
      type: object
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error
      type: object
  responses:
    '401':
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    AccessTokenAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````