> ## 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 the snapshot of a pull request head: its changed files against the base tip, their patches and their contents at the head

> Reads, in one call, everything the Diff tab draws at a pull request's head: GitHub's changed-file listing of ref against the base branch at base_sha, each file's unified patch, and each file's content at the head.

Use this tool when you need to:
- Show a pull request's changed files with their patches and head contents without one GitHub call per file
- Poll a head's snapshot until its capture finishes

Examples:
- GET /pull-requests/{pullRequestID}/review/head-snapshot?ref=1a954628a960aaef81d7b2d4521929579f3541e6&base_sha=1405df66cbe219b0bf6355bc3d60361a8376b6b4
- GET /pull-requests/6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21/review/head-snapshot?org_id=0b9d3e57-2c1a-4f6e-8d7b-5a4c3e2f1d09&ref=1a954628a960aaef81d7b2d4521929579f3541e6&base_sha=1405df66cbe219b0bf6355bc3d60361a8376b6b4

Hints:
- pullRequestID is the pull request's uuid; ref and base_sha are required full lowercase 40-hex SHAs; org_id (uuid) is optional, resolved as getPullRequest resolves it. The schema answers 422 for a missing or malformed value.
- ref and base_sha must be the head_sha and base_sha the PullRequest currently names: GitHub lists only the current head against the current base, so a reader still showing an earlier listing, or a pull request whose mirror has not learned both, is told the pull request moved with 409 (no domain code, unlike the pinned diff read's head_moved), and the PullRequest's next read names the new ones.
- Answers a union on kind. capturing: the first reader to find no snapshot claims its capture and enqueues it, and every reader meanwhile is answered capturing, enqueues nothing and reads again shortly. failed: the capture gave up after its retries, with error, and retryPullRequestReviewHeadSnapshotCapture starts it again. ready: the snapshot, captured once and then served from storage.
- A ready snapshot holds head_sha, base_sha, truncated and files, each with its patch where GitHub gives one and, for a file with a patch that exists at the head, head: kind text with content, binary or too_large, or omitted with a reason when the snapshot carries no content for it (its text would have overrun the snapshot's 32 MiB text budget, or GitHub did not find or serve it at capture), in which case getPullRequestReviewFile serves it.
- ready is immutable, so a browser caches it for the listing's life (Cache-Control private, max-age=31536000, immutable); it is sent gzip-encoded to a client whose Accept-Encoding accepts gzip (or every coding), as plain JSON to one that does not, and refused with 406 to one that accepts neither, and the answer varies on Accept-Encoding. capturing and failed are never cached.
- Use getPullRequestGithubDiff instead for a live listing pinned by expected_head_sha, and getPullRequestReviewFile for one file at a reviewed commit.
- Any member of an owning organization (one with a review run of the pull request or a non-archived project on its repository) may call it, a viewer included, and no GitHub connection is needed. A pull request that does not exist, one no organization of the caller owns and an org_id that does not own it answer the same 404.
- When no owner admits the caller, a billing member is refused with 403 org_role_insufficient and a member of a suspended organization with 403 org_suspended; an agent host's grant is refused with 403 agent_host_route_not_allowed, and 503 answers when the membership check is unavailable.



## OpenAPI

````yaml api-reference/openapi.json GET /pull-requests/{pullRequestID}/review/head-snapshot
openapi: 3.1.0
info:
  title: Aether API
  version: 0.1.0
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /pull-requests/{pullRequestID}/review/head-snapshot:
    get:
      tags:
        - pull-requests
      summary: >-
        Get the snapshot of a pull request head: its changed files against the
        base tip, their patches and their contents at the head
      description: >-
        Reads, in one call, everything the Diff tab draws at a pull request's
        head: GitHub's changed-file listing of ref against the base branch at
        base_sha, each file's unified patch, and each file's content at the
        head.


        Use this tool when you need to:

        - Show a pull request's changed files with their patches and head
        contents without one GitHub call per file

        - Poll a head's snapshot until its capture finishes


        Examples:

        - GET
        /pull-requests/{pullRequestID}/review/head-snapshot?ref=1a954628a960aaef81d7b2d4521929579f3541e6&base_sha=1405df66cbe219b0bf6355bc3d60361a8376b6b4

        - GET
        /pull-requests/6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21/review/head-snapshot?org_id=0b9d3e57-2c1a-4f6e-8d7b-5a4c3e2f1d09&ref=1a954628a960aaef81d7b2d4521929579f3541e6&base_sha=1405df66cbe219b0bf6355bc3d60361a8376b6b4


        Hints:

        - pullRequestID is the pull request's uuid; ref and base_sha are
        required full lowercase 40-hex SHAs; org_id (uuid) is optional, resolved
        as getPullRequest resolves it. The schema answers 422 for a missing or
        malformed value.

        - ref and base_sha must be the head_sha and base_sha the PullRequest
        currently names: GitHub lists only the current head against the current
        base, so a reader still showing an earlier listing, or a pull request
        whose mirror has not learned both, is told the pull request moved with
        409 (no domain code, unlike the pinned diff read's head_moved), and the
        PullRequest's next read names the new ones.

        - Answers a union on kind. capturing: the first reader to find no
        snapshot claims its capture and enqueues it, and every reader meanwhile
        is answered capturing, enqueues nothing and reads again shortly. failed:
        the capture gave up after its retries, with error, and
        retryPullRequestReviewHeadSnapshotCapture starts it again. ready: the
        snapshot, captured once and then served from storage.

        - A ready snapshot holds head_sha, base_sha, truncated and files, each
        with its patch where GitHub gives one and, for a file with a patch that
        exists at the head, head: kind text with content, binary or too_large,
        or omitted with a reason when the snapshot carries no content for it
        (its text would have overrun the snapshot's 32 MiB text budget, or
        GitHub did not find or serve it at capture), in which case
        getPullRequestReviewFile serves it.

        - ready is immutable, so a browser caches it for the listing's life
        (Cache-Control private, max-age=31536000, immutable); it is sent
        gzip-encoded to a client whose Accept-Encoding accepts gzip (or every
        coding), as plain JSON to one that does not, and refused with 406 to one
        that accepts neither, and the answer varies on Accept-Encoding.
        capturing and failed are never cached.

        - Use getPullRequestGithubDiff instead for a live listing pinned by
        expected_head_sha, and getPullRequestReviewFile for one file at a
        reviewed commit.

        - Any member of an owning organization (one with a review run of the
        pull request or a non-archived project on its repository) may call it, a
        viewer included, and no GitHub connection is needed. A pull request that
        does not exist, one no organization of the caller owns and an org_id
        that does not own it answer the same 404.

        - When no owner admits the caller, a billing member is refused with 403
        org_role_insufficient and a member of a suspended organization with 403
        org_suspended; an agent host's grant is refused with 403
        agent_host_route_not_allowed, and 503 answers when the membership check
        is unavailable.
      operationId: getPullRequestReviewHeadSnapshot
      parameters:
        - in: path
          name: pullRequestID
          required: true
          schema:
            format: uuid
            type: string
        - description: >-
            The pull request's owning organization to act in: the org_id the
            PullRequest carries. Omitted, getPullRequest and the review page's
            operations (its review, file, head snapshot and stack) act in the
            owning organization getPullRequest ranks first, and a console
            operation refuses with 422 org_id_required when more than one of the
            caller's organizations owns the pull request.
          explode: false
          in: query
          name: org_id
          schema:
            description: >-
              The pull request's owning organization to act in: the org_id the
              PullRequest carries. Omitted, getPullRequest and the review page's
              operations (its review, file, head snapshot and stack) act in the
              owning organization getPullRequest ranks first, and a console
              operation refuses with 422 org_id_required when more than one of
              the caller's organizations owns the pull request.
            format: uuid
            type: string
        - explode: false
          in: query
          name: ref
          required: true
          schema:
            pattern: ^[0-9a-f]{40}$
            type: string
        - explode: false
          in: query
          name: base_sha
          required: true
          schema:
            pattern: ^[0-9a-f]{40}$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PRReviewHeadSnapshot'
          description: >-
            The head's snapshot, that its capture is under way, or that the
            capture gave up
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PullRequestsErrorResponse'
                  - $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Conflict
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Gone
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsErrorResponse'
          description: Service Unavailable
components:
  schemas:
    PRReviewHeadSnapshot:
      discriminator:
        mapping:
          capturing: '#/components/schemas/PRReviewHeadSnapshotCapturing'
          failed: '#/components/schemas/PRReviewHeadSnapshotFailed'
          ready: '#/components/schemas/PRReviewHeadSnapshotReady'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/PRReviewHeadSnapshotReady'
        - $ref: '#/components/schemas/PRReviewHeadSnapshotCapturing'
        - $ref: '#/components/schemas/PRReviewHeadSnapshotFailed'
    PullRequestsErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - account_deleting
            - aether_inference_unserved
            - agent_pr_blocked
            - agent_pr_pending
            - agent_profile_changed
            - agent_starts_off
            - agent_uses_own_sign_in
            - answer_on_its_way
            - app_identity_missing
            - attachments_unsupported
            - attribution_unavailable
            - bad_gateway
            - bad_request
            - base_branch_unusable
            - branch_exists
            - caller_inactive
            - chat_archived
            - chat_being_forked
            - chat_moved
            - chat_not_removable
            - chat_settings_fixed
            - chats_not_addable
            - checkout_not_archivable
            - cli_upgrade_required
            - client_outdated
            - computer_cli_outdated
            - computer_starts_no_agents
            - computer_starts_no_forks
            - computer_unreachable
            - conflict
            - connection_creator_only
            - connection_harness_mismatch
            - connection_not_held
            - contents_write_required
            - continuation_failed
            - continuation_unavailable
            - control_forbidden
            - credential_kind_not_admitted
            - credential_named_file
            - detached_head
            - download_unsupported
            - embeddings_unavailable
            - feature_unsupported
            - file_references_unsupported
            - fix_not_requested
            - fix_requests_unrecorded
            - forbidden
            - fork_branch_delete_unsupported
            - fork_forbidden
            - fork_in_progress
            - fork_unsupported
            - gateway_timeout
            - github_failed
            - github_identity_required
            - github_push_access_required
            - gone
            - handed_branch_protected
            - head_moved
            - html_render_nul_byte
            - html_render_too_large
            - idempotency_key_conflict
            - idempotency_key_reused
            - idle_compaction_not_pending
            - idle_compaction_skipped
            - inference_proxy_unavailable
            - insufficient_credits
            - insufficient_inference_balance
            - interaction_mode_unsupported
            - internal_error
            - invalid_request
            - last_queued_message
            - live_protocol_unsupported
            - main_chat_permanent
            - mcp_server_not_connected
            - merge_when_ready_requires_pr_review
            - message_not_queued
            - method_not_allowed
            - mode_forbidden
            - name_follows_session
            - no_checkout_on_computer
            - no_checkpoint_yet
            - no_commit
            - no_dispatch_target
            - no_main_chat
            - no_origin
            - no_work_tree_folder
            - not_acceptable
            - not_found
            - not_implemented
            - onboarding_already_completed
            - onboarding_requirements_missing
            - open_in_terminal
            - org_id_required
            - org_role_insufficient
            - org_suspended
            - payment_required
            - pending_input_answered
            - permission_prompt_open
            - pr_automation_unsupported
            - pr_review_actor_required
            - pr_review_connection_spent
            - pr_review_publish_forbidden
            - precondition_failed
            - project_has_no_repository
            - project_required
            - pull_request_closed
            - pull_request_mirror_failed
            - pull_request_not_mirrored
            - push_failed
            - question_answers
            - question_shortened
            - queue_for_later_unsupported
            - queued_stop_requires_discard
            - rate_limited
            - reasoning_effort_fixed
            - repository_not_connected
            - request_canceled
            - request_expired
            - request_timeout
            - request_too_large
            - review_name_follows_pull_request
            - sandbox_deleted
            - sandbox_failed
            - sandbox_needs_message
            - service_unavailable
            - session_file_missing
            - session_gone
            - session_not_started_by_aether
            - slash_commands_unsupported
            - stack_cycle
            - stack_too_large
            - stack_two_parents
            - stale_execution
            - stale_or_indeterminate
            - stale_pending_input
            - stream_delivery_gap
            - stream_event_conflict
            - task_awaiting_message
            - task_awaiting_tool_response
            - task_backed_by_work_tree
            - task_connection_disconnected
            - task_creator_deleted
            - task_has_no_branch
            - task_has_no_repository
            - task_ineligible
            - task_not_accepting_messages
            - task_not_pinnable
            - task_not_started
            - task_settings_changed
            - task_start_failed
            - task_start_pending
            - teleport_unavailable
            - terminal_chat
            - terminal_chat_continuation_refused
            - terminal_question
            - too_large
            - too_many_live_connections
            - too_many_waiting_messages
            - turn_running
            - unauthenticated
            - unsigned_aether_head
            - unsigned_commit
            - unsupported_changes
            - unsupported_media_type
            - untyped_error
            - user_suspended
            - validation_failed
            - workspace_git_unavailable
            - workspace_gone
            - workspace_outdated
            - workspace_rejected
            - workspace_start_failed
          minLength: 1
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
        - code
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
            - agent_host_route_not_allowed
            - credential_kind_not_admitted
            - grant_scope_insufficient
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    PRReviewHeadSnapshotCapturing:
      additionalProperties: false
      properties:
        kind:
          enum:
            - capturing
          type: string
      required:
        - kind
      type: object
    PRReviewHeadSnapshotFailed:
      additionalProperties: false
      properties:
        error:
          minLength: 1
          type: string
        kind:
          enum:
            - failed
          type: string
      required:
        - kind
        - error
      type: object
    PRReviewHeadSnapshotReady:
      additionalProperties: false
      properties:
        base_sha:
          maxLength: 40
          minLength: 40
          pattern: ^[0-9a-f]{40}$
          type: string
        files:
          items:
            $ref: '#/components/schemas/PRReviewHeadSnapshotFile'
          type: array
        head_sha:
          maxLength: 40
          minLength: 40
          pattern: ^[0-9a-f]{40}$
          type: string
        kind:
          enum:
            - ready
          type: string
        truncated:
          type: boolean
      required:
        - kind
        - head_sha
        - base_sha
        - truncated
        - files
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    PRReviewHeadSnapshotFile:
      additionalProperties: false
      properties:
        additions:
          format: int64
          minimum: 0
          type: integer
        category:
          $ref: '#/components/schemas/PRReviewFileCategory'
        deletions:
          format: int64
          minimum: 0
          type: integer
        head:
          $ref: '#/components/schemas/PRReviewHeadSnapshotContent'
        patch:
          type: string
        path:
          type: string
        previous_path:
          type: string
        status:
          $ref: '#/components/schemas/PRReviewDiffFileStatus'
      required:
        - path
        - status
        - category
        - additions
        - deletions
      type: object
    PRReviewFileCategory:
      enum:
        - implementation
        - tests
        - documentation
        - generated
      type: string
    PRReviewHeadSnapshotContent:
      discriminator:
        mapping:
          binary: '#/components/schemas/PRReviewHeadSnapshotContentBinary'
          omitted: '#/components/schemas/PRReviewHeadSnapshotContentOmitted'
          text: '#/components/schemas/PRReviewHeadSnapshotContentText'
          too_large: '#/components/schemas/PRReviewHeadSnapshotContentTooLarge'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/PRReviewHeadSnapshotContentText'
        - $ref: '#/components/schemas/PRReviewHeadSnapshotContentBinary'
        - $ref: '#/components/schemas/PRReviewHeadSnapshotContentTooLarge'
        - $ref: '#/components/schemas/PRReviewHeadSnapshotContentOmitted'
    PRReviewDiffFileStatus:
      enum:
        - added
        - removed
        - modified
        - renamed
        - copied
        - changed
        - unchanged
      type: string
    PRReviewHeadSnapshotContentBinary:
      additionalProperties: false
      properties:
        kind:
          enum:
            - binary
          type: string
      required:
        - kind
      type: object
    PRReviewHeadSnapshotContentOmitted:
      additionalProperties: false
      properties:
        kind:
          enum:
            - omitted
          type: string
        reason:
          minLength: 1
          type: string
      required:
        - kind
        - reason
      type: object
    PRReviewHeadSnapshotContentText:
      additionalProperties: false
      properties:
        content:
          type: string
        kind:
          enum:
            - text
          type: string
      required:
        - kind
        - content
      type: object
    PRReviewHeadSnapshotContentTooLarge:
      additionalProperties: false
      properties:
        kind:
          enum:
            - too_large
          type: string
      required:
        - kind
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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