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

# List commits

> Get a list of commits. (Executed on secondary shard)



## OpenAPI

````yaml get /repos/{repo_id}/commits
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/commits:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
    get:
      tags:
        - Repository Commit Manipulation
      description: Get a list of commits
      operationId: src.handlersv2.commit.list_all
      parameters:
        - in: query
          name: ref_ids
          description: >
            If specified, filters commit list to start with specified ref IDs
            (branches, workspaces etc.), otherwise return commits accessible
            from all branches.
          schema:
            type: array
            items:
              type: string
        - $ref: '#/components/parameters/PageLimit'
        - $ref: '#/components/parameters/PageSkip'
        - $ref: '#/components/parameters/PageQuery'
      responses:
        '200':
          $ref: '#/components/responses/CommitList'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/read
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
    PageLimit:
      in: query
      name: limit
      schema:
        type: integer
        example: 17
        minimum: 1
        default: 100
      description: Limit the number or items returned from a listing api
    PageSkip:
      in: query
      name: skip
      schema:
        type: integer
        example: 17
        minimum: 0
      description: Skip a number of items returned from a listing api
    PageQuery:
      in: query
      name: query
      schema:
        type: string
        example: foo
        minLength: 3
        maxLength: 64
      description: A string query to filter against in a listing api
  responses:
    CommitList:
      description: Success
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Commit
              items:
                type: array
                items:
                  $ref: '#/components/schemas/Commit'
            required:
              - object
              - items
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Commit:
      allOf:
        - $ref: '#/components/schemas/CommitId'
        - type: object
          properties:
            created_ts:
              type: integer
              description: Seconds since epoch UTC
              format: int64
            commit_message:
              type: string
            branch_id:
              type: string
              description: The branch on which this commit was created
            author:
              $ref: '#/components/schemas/User'
              description: Details of the user who added the commit
            parents:
              type: array
              description: List of parent commits of this commit
              items:
                type: string
          required:
            - created_ts
            - branch_id
            - author
            - parents
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
          example: 403
        detail:
          type: string
          example: User not authorized to perform the requested action on the resource
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
    CommitId:
      type: object
      properties:
        commit_id:
          type: string
          example: example_id
          minLength: 3
          maxLength: 128
      required:
        - commit_id
    User:
      description: User details
      type: object
      properties:
        image:
          type: string
          description: URL of the user image
        email:
          type: string
          format: email
        full_name:
          type: string
        id:
          type: string
        name:
          type: string
      required:
        - id
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````