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

# Get a pull request's changed files with unified-diff patches

> Fetched live from GitHub at request time; nothing is persisted. patch is absent when GitHub provides none (binary or oversized files). truncated is true when the listing hit GitHub's 3000-file cap. expected_head is optional and pins the answer to one commit: GitHub computes this listing against the pull request's head at request time, so the head is read back after the walk and a head that has moved is a 409 rather than the file list of a different commit. Pass it when the patches will be paired with file content read at that same commit; omit it to read whatever the head is now. Requires membership in the owning organization of a task linked to this pull request — the task that published it or a task that reviewed it — and current GitHub access to the repository. 404 covers an unknown pull request, one linked to no organization the caller belongs to, and one whose GitHub access the caller has lost; the three are deliberately indistinguishable.



## OpenAPI

````yaml api-reference/openapi.account.json GET /pull-requests/{pullRequestID}/github/pr/diff
openapi: 3.1.0
info:
  title: Aether Account & Integrations API
  version: 0.1.0
  description: >-
    Account, billing, and integration-management endpoints used by the Aether
    web app and CLI. Root-mounted; NOT part of the versioned /v1 contract.
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /pull-requests/{pullRequestID}/github/pr/diff:
    get:
      tags:
        - pull-requests
      summary: Get a pull request's changed files with unified-diff patches
      description: >-
        Fetched live from GitHub at request time; nothing is persisted. patch is
        absent when GitHub provides none (binary or oversized files). truncated
        is true when the listing hit GitHub's 3000-file cap. expected_head is
        optional and pins the answer to one commit: GitHub computes this listing
        against the pull request's head at request time, so the head is read
        back after the walk and a head that has moved is a 409 rather than the
        file list of a different commit. Pass it when the patches will be paired
        with file content read at that same commit; omit it to read whatever the
        head is now. Requires membership in the owning organization of a task
        linked to this pull request — the task that published it or a task that
        reviewed it — and current GitHub access to the repository. 404 covers an
        unknown pull request, one linked to no organization the caller belongs
        to, and one whose GitHub access the caller has lost; the three are
        deliberately indistinguishable.
      operationId: getPullRequestGithubPRDiff
      parameters:
        - in: path
          name: pullRequestID
          required: true
          schema:
            format: uuid
            type: string
        - explode: false
          in: query
          name: expected_head
          schema:
            pattern: ^[0-9a-f]{40}$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  files:
                    items:
                      $ref: '#/components/schemas/PRReviewDiffFile'
                    type: array
                  total_files:
                    format: int64
                    minimum: 0
                    type: integer
                  truncated:
                    type: boolean
                required:
                  - files
                  - total_files
                  - truncated
                type: object
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Gateway
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    PRReviewDiffFile:
      additionalProperties: false
      properties:
        additions:
          format: int64
          minimum: 0
          type: integer
        deletions:
          format: int64
          minimum: 0
          type: integer
        patch:
          type: string
        path:
          type: string
        previous_path:
          type: string
        status:
          $ref: '#/components/schemas/PRReviewDiffFileStatus'
      required:
        - path
        - status
        - additions
        - deletions
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    PRReviewDiffFileStatus:
      enum:
        - added
        - removed
        - modified
        - renamed
        - copied
        - changed
        - unchanged
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````