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

# List File Segments

> List all segments for a specific file



## OpenAPI

````yaml GET /files/{file_id}/segments
openapi: 3.0.0
info:
  title: Cloudglue API
  description: API for Cloudglue
  license:
    name: Apache License 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 0.7.8
servers:
  - url: https://api.cloudglue.dev/v1
security:
  - bearerAuth: []
paths:
  /files/{file_id}/segments:
    get:
      tags:
        - Files
        - File Segments
      summary: List file segments
      description: List all segments for a specific file
      operationId: listFileSegments
      parameters:
        - name: file_id
          in: path
          required: true
          description: The ID of the file
          schema:
            type: string
            format: uuid
        - name: start_time_after
          in: query
          description: Filter segments by start time
          required: false
          schema:
            type: number
            minimum: 0
        - name: end_time_before
          in: query
          description: Filter segments by end time
          required: false
          schema:
            type: number
            minimum: 0
        - name: min_duration
          in: query
          description: >-
            Filter segments with duration greater than or equal to this value
            (in seconds)
          required: false
          schema:
            type: number
            minimum: 0
        - name: max_duration
          in: query
          description: >-
            Filter segments with duration less than or equal to this value (in
            seconds). Must be greater than or equal to min_duration when both
            are provided.
          required: false
          schema:
            type: number
            minimum: 0
        - name: limit
          in: query
          description: Number of segments to return
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
        - name: offset
          in: query
          description: Offset from the start of the list
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: List of segments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSegmentListResponse'
        '400':
          description: >-
            Invalid query parameters (e.g., min_duration > max_duration,
            start_time_after >= end_time_before)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FileSegmentListResponse:
      type: object
      required:
        - object
        - data
        - total
        - limit
        - offset
      properties:
        object:
          type: string
          enum:
            - list
          description: Object type, always 'list'
        data:
          type: array
          items:
            $ref: '#/components/schemas/FileSegment'
        total:
          type: integer
          description: The total number of items
        limit:
          type: integer
          description: The number of items per page
        offset:
          type: integer
          description: The offset of the items
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
    FileSegment:
      type: object
      required:
        - id
        - file_id
        - start_time
        - end_time
        - thumbnail_url
      properties:
        id:
          type: string
          format: uuid
          description: The ID of the segment
        file_id:
          type: string
          format: uuid
          description: The ID of the file
        start_time:
          type: number
          description: The start time of the segment in seconds
        end_time:
          type: number
          description: The end time of the segment in seconds
        thumbnail_url:
          type: string
          description: The URL of the thumbnail for the segment (if available)
        metadata:
          type: object
          description: The user defined metadata for the segment
        segmentation_id:
          type: string
          format: uuid
          description: The ID of the segmentation job it belongs to
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````