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

# A repo's history

> From a branch, tag or commit, newest first, along each commit's first parent. Each row has its subject and not its whole message: `/repo/commit` has that. A page has no more than its `limit`, and can have fewer along a history with many merges. `next_cursor` holds the commit the next page starts from, so pushes in between don't shift it. 404 `ref_not_found`.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{owner}/{slug}/repo/commits
openapi: 3.1.0
info:
  title: Patch API
  version: 1.0.0
  description: >-
    The public API behind patch.gg, the desktop app and pch. Changes within v1
    are additive only. Errors are { error: { code, message, details } }; branch
    on code.
servers:
  - url: https://patch.gg/api/v1
security: []
paths:
  /projects/{owner}/{slug}/repo/commits:
    get:
      tags:
        - Repos
      summary: A repo's history
      description: >-
        From a branch, tag or commit, newest first, along each commit's first
        parent. Each row has its subject and not its whole message:
        `/repo/commit` has that. A page has no more than its `limit`, and can
        have fewer along a history with many merges. `next_cursor` holds the
        commit the next page starts from, so pushes in between don't shift it.
        404 `ref_not_found`.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
        - schema:
            type: string
            pattern: ^\S{1,255}$
            description: >-
              A branch, a tag or a full commit hash: the default branch unless
              you say. A branch comes before a tag of the same name, and
              `refs/tags/v1` says which.
            example: main
          required: false
          description: >-
            A branch, a tag or a full commit hash: the default branch unless you
            say. A branch comes before a tag of the same name, and
            `refs/tags/v1` says which.
          name: ref
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          required: false
          name: limit
          in: query
        - schema:
            type: string
            maxLength: 500
            description: The next_cursor from the previous page
          required: false
          description: The next_cursor from the previous page
          name: cursor
          in: query
      responses:
        '200':
          description: A page of commits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepoLogPage'
        '308':
          description: Renamed; follow the Location header
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not signed in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '`on_github`: its home is GitHub, which has its files'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Too many requests: wait as long as `Retry-After` says
            (`retry_after_s` in `details`), then retry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: It couldn't be read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Reading repos isn't set up here, or the repo is waking up
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RepoLogPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RepoLogCommit'
        next_cursor:
          type:
            - string
            - 'null'
      required:
        - data
        - next_cursor
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    RepoLogCommit:
      type: object
      properties:
        hash:
          type: string
        message:
          type: string
          description: >-
            Its subject, the message's first paragraph on one line: 4,000
            characters at most.
        parents:
          type: array
          items:
            type: string
          description: Empty for a repo's first commit.
        author:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
          required:
            - name
            - email
        committer:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
          required:
            - name
            - email
        authored_at:
          type: string
          format: date-time
        committed_at:
          type: string
          format: date-time
      required:
        - hash
        - message
        - parents
        - author
        - committer
        - authored_at
        - committed_at

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.