> ## 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 whole stack a reviewed pull request belongs to

> Walks the branch chain through the pull request up to its bottom layer, through the tracked open pull request whose head branch is each layer's base, then returns the whole tree from there, forks included: every tracked open pull request based on a layer's head is a child of that layer. Layers are depth first from the bottom, each layer's children in ascending number; parent_pull_request_id is absent on the bottom layer only, depth is 0 there, and base_branch is its base. A pull request in no stack is one layer. A loop is a 409 stack_cycle, a layer based on a branch two open pull requests head a 409 stack_two_parents, and more than 64 layers a 409 stack_too_large; each names the pull request where it breaks, and none returns a partial stack. Authorized like getPRReview, with the same indistinguishable 404.



## OpenAPI

````yaml api-reference/openapi.account.json GET /pr-reviews/{pullRequestID}/stack
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:
  /pr-reviews/{pullRequestID}/stack:
    get:
      tags:
        - pr-reviews
      summary: Get the whole stack a reviewed pull request belongs to
      description: >-
        Walks the branch chain through the pull request up to its bottom layer,
        through the tracked open pull request whose head branch is each layer's
        base, then returns the whole tree from there, forks included: every
        tracked open pull request based on a layer's head is a child of that
        layer. Layers are depth first from the bottom, each layer's children in
        ascending number; parent_pull_request_id is absent on the bottom layer
        only, depth is 0 there, and base_branch is its base. A pull request in
        no stack is one layer. A loop is a 409 stack_cycle, a layer based on a
        branch two open pull requests head a 409 stack_two_parents, and more
        than 64 layers a 409 stack_too_large; each names the pull request where
        it breaks, and none returns a partial stack. Authorized like
        getPRReview, with the same indistinguishable 404.
      operationId: getPRReviewStack
      parameters:
        - in: path
          name: pullRequestID
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  base_branch:
                    type: string
                  layers:
                    items:
                      $ref: '#/components/schemas/PRReviewStackLayer'
                    minItems: 1
                    type: array
                required:
                  - layers
                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/PullRequestStackRefusalErrorResponse'
          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
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    PRReviewStackLayer:
      additionalProperties: false
      properties:
        ci_status:
          $ref: '#/components/schemas/TaskCIStatus'
        depth:
          format: int64
          minimum: 0
          type: integer
        has_review:
          type: boolean
        html_url:
          type: string
        parent_pull_request_id:
          format: uuid
          type: string
        pr_number:
          format: int64
          minimum: 1
          type: integer
        pull_request_id:
          format: uuid
          type: string
        ready_for_merge:
          type: boolean
        state:
          $ref: '#/components/schemas/TaskGitHubPRState'
        title:
          type: string
      required:
        - pull_request_id
        - depth
        - pr_number
        - title
        - html_url
        - ready_for_merge
        - has_review
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    PullRequestStackRefusalErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - stack_cycle
            - stack_two_parents
            - stack_too_large
          type: string
        error:
          minLength: 1
          type: string
        pr_number:
          format: int64
          minimum: 1
          type: integer
      required:
        - error
        - code
        - pr_number
      type: object
    TaskCIStatus:
      enum:
        - pending
        - passed
        - failed
      type: string
    TaskGitHubPRState:
      enum:
        - open
        - closed
        - merged
      type: string
    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
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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