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

# Export logs

> Export matching log entries as a gzip-compressed file. When dryRun=true, returns a JSON preflight estimate instead of streaming the file.



## OpenAPI

````yaml /api/openapi.json get /api/indexes/{indexId}/logs/export
openapi: 3.1.0
info:
  description: HTTP API for the Rootprint log management platform.
  title: Rootprint API
  version: 0.4.0
servers:
  - description: Rootprint API
    url: https://example.com
security:
  - cookieAuth: []
paths:
  /api/indexes/{indexId}/logs/export:
    get:
      tags:
        - Log explorer
      summary: Export logs
      description: >-
        Export matching log entries as a gzip-compressed file. When dryRun=true,
        returns a JSON preflight estimate instead of streaming the file.
      operationId: getApiIndexesByIndexIdLogsExport
      parameters:
        - in: path
          name: indexId
          required: true
          schema:
            minLength: 1
            type: string
        - in: query
          name: q
          schema:
            type: string
        - in: query
          name: startTs
          required: true
          schema:
            minimum: 0
            type: number
        - in: query
          name: endTs
          required: true
          schema:
            minimum: 0
            type: number
        - in: query
          name: format
          required: true
          schema:
            enum:
              - json
              - csv
              - text
            type: string
        - in: query
          name: dryRun
          schema:
            type: string
      responses:
        '200':
          content:
            application/x-ndjson:
              schema:
                format: binary
                type: string
            text/csv:
              schema:
                format: binary
                type: string
            text/plain:
              schema:
                format: binary
                type: string
          description: >-
            Gzip-compressed export stream. Content-Type reflects the requested
            format (application/x-ndjson for JSON, text/csv for CSV, text/plain
            for text).
          headers:
            Content-Disposition:
              description: >-
                Attachment filename, e.g. attachment;
                filename="rootprint-index-....ndjson.gz"
              schema:
                type: string
            Content-Encoding:
              schema:
                enum:
                  - gzip
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Request validation failed
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Authentication required
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Permission denied
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Resource not found
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Internal server error
    ServiceUnavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Upstream service unavailable
  schemas:
    ApiErrorBody:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              items:
                properties:
                  message:
                    type: string
                  path:
                    type: string
                required:
                  - path
                  - message
                type: object
              type: array
            message:
              type: string
            requestId:
              type: string
            statusCode:
              type: number
          required:
            - code
            - message
            - statusCode
            - requestId
          type: object
      required:
        - error
      type: object
  securitySchemes:
    cookieAuth:
      in: cookie
      name: better-auth.session_token
      type: apiKey

````