> ## 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 change requests

> Newest first: the open ones unless you ask for another `state`, or `all`. Each says whether it's up to date (`up_to_date`) and how much Patch's review flagged (`flagged`, null for one from the repo's own branch, which the review doesn't read), so a list doesn't need a diff per row. `up_to_date` counts once against `repo_diff` for the whole page, and only a page's first 25 open requests have one: past that limit or those 25, or when the repo can't say just now, it's null and the list still answers.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{owner}/{slug}/change-requests
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}/change-requests:
    get:
      tags:
        - Change requests
      summary: A repo's change requests
      description: >-
        Newest first: the open ones unless you ask for another `state`, or
        `all`. Each says whether it's up to date (`up_to_date`) and how much
        Patch's review flagged (`flagged`, null for one from the repo's own
        branch, which the review doesn't read), so a list doesn't need a diff
        per row. `up_to_date` counts once against `repo_diff` for the whole
        page, and only a page's first 25 open requests have one: past that limit
        or those 25, or when the repo can't say just now, it's null and the list
        still answers.
      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
            enum:
              - open
              - merged
              - declined
              - withdrawn
              - all
            default: open
          required: false
          name: state
          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 change requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeRequestPage'
        '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'
        '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'
components:
  schemas:
    ChangeRequestPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ChangeRequestRow'
        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
    ChangeRequestRow:
      allOf:
        - $ref: '#/components/schemas/ChangeRequest'
        - type: object
          properties:
            up_to_date:
              type:
                - boolean
                - 'null'
              description: >-
                Whether it can merge as it is, as its diff says. Null when it
                isn't open, or Patch can't tell just now, which its diff still
                can.
            flagged:
              type:
                - integer
                - 'null'
              description: >-
                How many things Patch's review of its latest commit flagged
                (`PA-320` and `PA-321`), once it's read it: 0 until then. Null
                for a request from one of the repo's own branches, which the
                review doesn't read. It's advice: none of them stops a merge.
          required:
            - up_to_date
            - flagged
    ChangeRequest:
      type: object
      properties:
        number:
          type: integer
          example: 12
        title:
          type: string
          example: Port to 26.5
        description:
          type: string
        state:
          type: string
          enum:
            - open
            - merged
            - declined
            - withdrawn
          description: >-
            open: waiting on the repo's owner. merged: its commits are in the
            branch it was for. declined: the owner turned it down. withdrawn:
            its author took it back.
        from:
          type:
            - string
            - 'null'
          description: >-
            The repo its branch is in, as owner/slug: the fork it comes from, or
            this repo itself for one of its own branches. Null if you can't
            reach the fork.
          example: kai/sky-mod
        branch:
          type: string
          description: The branch it offers, in `from`
          example: port-26.5
        into:
          type: string
          description: The branch it would change in this repo
          example: '26.5'
        head_commit:
          type: string
          description: >-
            Its latest commit, as copied into this repo, where a clone doesn't
            see it: `git fetch <clone_url> <head_commit>` gets its commits while
            it's open.
        problems:
          type: array
          items:
            type: string
          description: >-
            What stopped the latest push to its branch being copied, which stays
            out of the request until it's fixed: a refusal, a fork that isn't
            open, which copies when it opens, or a copy that failed, which a new
            push tries again. Empty says nothing has stopped one, and a copy may
            still be on its way.
        author:
          type:
            - string
            - 'null'
          description: 'Who opened it: their username'
          example: kai
        talk_count:
          type: integer
          description: Posts in its talk
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        closed_at:
          type:
            - string
            - 'null'
          format: date-time
        closed_by:
          type:
            - string
            - 'null'
          description: 'Who merged, declined or withdrew it: their username'
        merge_commit:
          type:
            - string
            - 'null'
          description: The commit its branch was at after the merge.
      required:
        - number
        - title
        - description
        - state
        - from
        - branch
        - into
        - head_commit
        - problems
        - author
        - talk_count
        - created_at
        - updated_at
        - closed_at
        - closed_by
        - merge_commit

````

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