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

# Prepare change review

> Start a GitHub pull request's change review before its preview is deployed. Call it when the PR opens or gets a new commit. Returns 202 with the review conversation, reused the same way as `POST /chat/change-review`.

The agent reads the change and creates the tests it plans to run, without running them. Once the preview is deployed, send `POST /chat/change-review` with `applicationOverrides` for the same head commit: QA.tech treats it as the deployment being ready, and the waiting review runs its tests there.

Does nothing if the head commit already has a review in the conversation. Poll `get_chat_conversation` until its `status` is `completed`, `failed`, or `cancelled`; a prepared conversation completes once the tests are created.



## OpenAPI

````yaml /api-reference/api.json post /v1/chat/change-review/prepare
openapi: 3.0.0
info:
  title: QA.tech API
  version: 1.0.0
  contact:
    name: QA.tech
    url: https://qa.tech
    email: support@qa.tech
  description: API for triggering and managing AI-powered test runs
servers:
  - url: https://api.qa.tech
    description: Production
    variables: {}
security:
  - BearerAuth: []
tags:
  - name: Runs
  - name: Infrastructure
  - name: Test Cases
  - name: Application Builds
  - name: Status badge
  - name: Remote Tunnels
  - name: Chat
  - name: Applications
  - name: Features
  - name: Metrics
  - name: Projects
  - name: Knowledge
  - name: Rules
  - name: Issues
  - name: Automations
paths:
  /v1/chat/change-review/prepare:
    post:
      tags:
        - Chat
      summary: Prepare change review
      description: >-
        Start a GitHub pull request's change review before its preview is
        deployed. Call it when the PR opens or gets a new commit. Returns 202
        with the review conversation, reused the same way as `POST
        /chat/change-review`.


        The agent reads the change and creates the tests it plans to run,
        without running them. Once the preview is deployed, send `POST
        /chat/change-review` with `applicationOverrides` for the same head
        commit: QA.tech treats it as the deployment being ready, and the waiting
        review runs its tests there.


        Does nothing if the head commit already has a review in the
        conversation. Poll `get_chat_conversation` until its `status` is
        `completed`, `failed`, or `cancelled`; a prepared conversation completes
        once the tests are created.
      operationId: PrepareChangeReviewChat
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareChangeReviewRequest'
      responses:
        '202':
          description: >-
            The request has been accepted for processing, but processing has not
            yet completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatConversationResponse'
components:
  schemas:
    PrepareChangeReviewRequest:
      type: object
      required:
        - prUrl
      properties:
        prUrl:
          type: string
          format: uri
        context:
          type: string
        forceNewConversation:
          type: boolean
          description: >-
            Force a brand-new chat instead of reusing the pull request's
            existing review conversation. Defaults to false, so repeated reviews
            of the same PR share one chat unless that chat is archived.
          default: false
        postMerge:
          allOf:
            - $ref: '#/components/schemas/ChangeReviewPostMergeOptions'
          description: >-
            Optional post-merge options for this PR. Stored on the review
            conversation and applied when the PR merges. Overrides GitHub App
            integration settings for this PR only.
        triage:
          allOf:
            - $ref: '#/components/schemas/ChangeReviewTriageOptions'
          description: >-
            Optional PR triage options for this review. GitHub pull requests
            only. Overrides the GitHub App integration PR triage toggle and
            prompt for this review.
        actor:
          type: string
          description: 'Username that triggered the CI job. Example: `octocat`.'
        branch:
          type: string
          description: >-
            Branch the run was triggered from. Example: `main` or
            `refs/heads/main`.
        commitHash:
          type: string
          description: >-
            Full commit SHA the run was triggered for. Used to link the run back
            to the commit.
        commitMessage:
          type: string
          description: Commit message subject for the triggering commit.
        repository:
          type: string
          description: >-
            Repository the run was triggered from, as `owner/name`. Example:
            `QAdottech/qatech`.
        projectShortId:
          allOf:
            - $ref: '#/components/schemas/ProjectShortId'
          description: >-
            Target a specific project by its prefixed short ID
            (proj-slug_shortId or proj_shortId), as returned by the projects
            API. Required for organization-scoped API keys; project-scoped keys
            may only pass their own project's short ID.
      description: >-
        Prepare a change review for a GitHub pull request before its preview is
        deployed
    ChatConversationResponse:
      type: object
      required:
        - shortId
        - url
        - createdAt
        - updatedAt
        - status
        - runs
      properties:
        shortId:
          $ref: '#/components/schemas/ChatConversationShortId'
        url:
          type: string
          description: Dashboard URL for the conversation.
        title:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        source:
          type: string
          enum:
            - api
            - ui
            - github
            - gitlab
            - system
          description: >-
            Where the conversation originated. `api` for conversations created
            via this API, `ui` for the dashboard, `github`/`gitlab` for
            VCS-triggered chats, and `system` for everything else.
        status:
          type: string
          enum:
            - in_progress
            - completed
            - failed
            - cancelled
          description: >-
            Overall conversation lifecycle. `in_progress` while the assistant is
            working or a background test run / research task is still going.
            Assistant message `COMPLETED` is not enough — starting a run ends
            the current turn. Poll until this is `completed`, `failed`, or
            `cancelled`.
        runs:
          type: array
          items:
            $ref: '#/components/schemas/ChatConversationRun'
          description: >-
            Test runs started from this conversation, newest first. Empty until
            a run is created. Use `shortId` with `get_run` (`testCases` = all)
            or nested test-case short IDs from that call with
            `get_run_test_case`.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageItem'
          description: >-
            Recent messages, newest first. Empty on creation; poll
            `get_chat_conversation` to retrieve. Internal wake messages are
            omitted.
      description: Conversation data with recent messages (newest first).
    ChangeReviewPostMergeOptions:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
          description: >-
            When true, run the post-merge agent after this PR merges. When
            false, skip it even if the GitHub App integration has it enabled.
        prompt:
          type: string
          maxLength: 4000
          description: >-
            Goal for the post-merge agent. This prompt is the entire task — the
            agent only changes tests when the prompt asks it to. Omit or leave
            empty to use the default maintenance prompt.
      description: >-
        Optional post-merge agent options for this pull request. When set,
        overrides the GitHub App integration post-merge settings for the agent
        that runs after this PR merges. Omit to use the integration settings.
    ChangeReviewTriageOptions:
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            When true, triage may skip this review even if the GitHub App
            integration has PR triage off. When false, never skip this review,
            including a commit triage already skipped. Omit to follow the
            integration toggle.
        prompt:
          type: string
          maxLength: 4000
          description: >-
            PR triage prompt for this review, replacing the GitHub App
            integration prompt. Describes which changes to skip and which to
            review. Does not turn triage on by itself. Omit or leave empty to
            use the integration prompt.
      description: >-
        Optional triage options for this GitHub pull request review. Each field
        overrides the matching GitHub App integration PR triage setting for this
        review only. Omit a field to use the integration setting.
    ProjectShortId:
      type: string
      pattern: ^proj(-.+_.+|_.+)$
    ChatConversationShortId:
      type: string
      pattern: ^chat(-.+_.+|_.+)$
    ChatConversationRun:
      type: object
      required:
        - shortId
        - status
        - result
        - url
      properties:
        shortId:
          type: string
        status:
          type: string
          description: >-
            Run lifecycle status: `INITIATED`, `RUNNING`, `COMPLETED`, `ERROR`,
            or `CANCELLED`.
        result:
          type: string
          nullable: true
          description: >-
            Run outcome once complete: `PASSED`, `FAILED`, or `SKIPPED`. `null`
            while the run is still in progress.
        url:
          type: string
          description: Dashboard URL for the run.
      description: >-
        A test run started from this conversation. `shortId` works with
        `get_run` and `rerun_run`.
    ChatMessageItem:
      type: object
      required:
        - id
        - role
        - createdAt
        - text
      properties:
        id:
          type: string
        role:
          type: string
          enum:
            - user
            - assistant
        createdAt:
          type: string
          format: date-time
        text:
          type: string
          description: The plain-text body of the message.
        status:
          type: string
          enum:
            - INITIATED
            - PARTIAL
            - COMPLETED
            - CANCELLED
            - FAILED
          description: >-
            Lifecycle status of this message. Do not treat assistant `COMPLETED`
            as the end of the conversation — starting a test run ends the
            current turn while the run continues in the background. Poll the
            conversation `status` instead.
        isStreaming:
          type: boolean
          description: True while the assistant is still streaming tokens for this message.
      description: >-
        A chat message. Tool calls and reasoning are not exposed in this
        version; only the text response is returned.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````

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