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

# List segments

> List log segments whose start sequence falls within the given range.
Segments are the physical storage units of the log.




## OpenAPI

````yaml /openapi/log.yaml get /api/v1/log/segments
openapi: 3.1.0
info:
  title: OpenData Log API
  version: 1.0.0
  description: HTTP API for the OpenData Log service — an append-only, key-partitioned log.
servers:
  - url: http://localhost:3001
    description: Local development server
security: []
paths:
  /api/v1/log/segments:
    get:
      summary: List segments
      description: |
        List log segments whose start sequence falls within the given range.
        Segments are the physical storage units of the log.
      operationId: listSegments
      parameters:
        - name: start_seq
          in: query
          required: false
          description: Start sequence number (inclusive). Defaults to `0`.
          schema:
            type: integer
            format: uint64
            minimum: 0
        - name: end_seq
          in: query
          required: false
          description: End sequence number (exclusive). Defaults to `max uint64`.
          schema:
            type: integer
            format: uint64
            minimum: 0
      responses:
        '200':
          description: List of segments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentsResponse'
              example:
                status: success
                segments:
                  - id: 0
                    startSeq: 0
                    startTimeMs: 1705766400000
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SegmentsResponse:
      type: object
      description: Response listing log segments.
      properties:
        status:
          type: string
          example: success
        segments:
          type: array
          items:
            $ref: '#/components/schemas/Segment'
      required:
        - status
        - segments
    ErrorResponse:
      type: object
      description: Error response returned for all error cases.
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          description: Human-readable error message.
      required:
        - status
        - message
    Segment:
      type: object
      description: Metadata for a log segment (physical storage unit).
      properties:
        id:
          type: integer
          format: uint32
          description: Segment ID.
        startSeq:
          type: integer
          format: uint64
          description: First sequence number in this segment.
        startTimeMs:
          type: integer
          format: int64
          description: Wall-clock timestamp (ms since epoch) when the segment was created.
      required:
        - id
        - startSeq
        - startTimeMs

````