> ## Documentation Index
> Fetch the complete documentation index at: https://sourcebot-whoisthey-language-model-input-modalities.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List commits

> Returns a paginated list of commits for a repository.



## OpenAPI

````yaml /api-reference/sourcebot-public.openapi.json get /api/commits
openapi: 3.0.3
info:
  title: Sourcebot Public API
  version: v5.0.4
  description: >-
    OpenAPI description for the public Sourcebot REST endpoints used for search,
    repository listing, and file browsing. Authentication is instance-dependent:
    API keys are the standard integration mechanism, OAuth bearer tokens are
    EE-only, and some instances may allow anonymous access.
servers: []
security:
  - bearerToken: []
  - apiKeyHeader: []
  - {}
tags:
  - name: Search & Navigation
    description: Code search and symbol navigation endpoints.
  - name: Repositories
    description: Repository listing and metadata endpoints.
  - name: Git
    description: Git history, diff, and file content endpoints.
  - name: System
    description: System health and version endpoints.
  - name: Enterprise (EE)
    description: Enterprise endpoints for user management and audit logging.
paths:
  /api/commits:
    get:
      tags:
        - Git
      summary: List commits
      description: Returns a paginated list of commits for a repository.
      operationId: listCommits
      parameters:
        - schema:
            type: string
            description: The fully-qualified repository name.
          required: true
          description: The fully-qualified repository name.
          name: repo
          in: query
        - schema:
            type: string
            description: >-
              Filter commits by message content (case-insensitive). Interpreted
              as a POSIX BRE regex — escape metacharacters for literal matching.
          required: false
          description: >-
            Filter commits by message content (case-insensitive). Interpreted as
            a POSIX BRE regex — escape metacharacters for literal matching.
          name: query
          in: query
        - schema:
            type: string
            description: >-
              Return commits after this date. Accepts ISO 8601 or relative
              formats (e.g. `30 days ago`).
          required: false
          description: >-
            Return commits after this date. Accepts ISO 8601 or relative formats
            (e.g. `30 days ago`).
          name: since
          in: query
        - schema:
            type: string
            description: >-
              Return commits before this date. Accepts ISO 8601 or relative
              formats.
          required: false
          description: >-
            Return commits before this date. Accepts ISO 8601 or relative
            formats.
          name: until
          in: query
        - schema:
            type: string
            description: >-
              Filter commits by author name or email (case-insensitive).
              Interpreted as a POSIX BRE regex — escape metacharacters for
              literal matching.
          required: false
          description: >-
            Filter commits by author name or email (case-insensitive).
            Interpreted as a POSIX BRE regex — escape metacharacters for literal
            matching.
          name: author
          in: query
        - schema:
            type: string
            description: >-
              The git ref (branch, tag, or commit SHA) to list commits from.
              Defaults to `HEAD`.
          required: false
          description: >-
            The git ref (branch, tag, or commit SHA) to list commits from.
            Defaults to `HEAD`.
          name: ref
          in: query
        - schema:
            type: string
            description: Restrict commits to those that touch this file path.
          required: false
          description: Restrict commits to those that touch this file path.
          name: path
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 100
            default: 50
          required: false
          name: perPage
          in: query
      responses:
        '200':
          description: Paginated commit list.
          headers:
            X-Total-Count:
              description: Total number of commits matching the query across all pages.
              schema:
                type: integer
            Link:
              description: Pagination links formatted per RFC 8288.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicListCommitsResponse'
        '400':
          description: Invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '404':
          description: Repository not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
components:
  schemas:
    PublicListCommitsResponse:
      type: array
      items:
        $ref: '#/components/schemas/PublicCommit'
    PublicApiServiceError:
      type: object
      properties:
        statusCode:
          type: number
        errorCode:
          type: string
        message:
          type: string
      required:
        - statusCode
        - errorCode
        - message
      description: Structured error response returned by Sourcebot public API endpoints.
    PublicCommit:
      type: object
      properties:
        hash:
          type: string
          description: The full commit SHA.
        date:
          type: string
          description: The commit date in ISO 8601 format.
        message:
          type: string
          description: The commit subject line.
        refs:
          type: string
          description: Refs pointing to this commit (e.g. branch or tag names).
        body:
          type: string
          description: The commit body (everything after the subject line).
        authorName:
          type: string
        authorEmail:
          type: string
      required:
        - hash
        - date
        - message
        - refs
        - body
        - authorName
        - authorEmail
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your API key.
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-Sourcebot-Api-Key
      description: >-
        Header of the form `X-Sourcebot-Api-Key: <token>`, where `<token>` is
        your API key.

````