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

# Turn PR reviews on or off

> Turn automatic pull and merge request reviews on or off for repositories.

Enables automatic pull and merge request reviews for repositories in `enable` and disables them for repositories in `disable`. Use repository IDs from [List repositories](https://docs.hacktron.ai/api-reference/repos/list-repos.md) for any supported provider. Each list can contain up to 100 IDs per request.

> [!NOTE]
>
> **Scope required**: `write`. **Role**: organization admin.

* First, enable Hacktron access to the repository from **Repositories** in Hacktron.
* If one repository fails, Hacktron continues with the others. The response reports how many changed in `processed` and lists failures with their reasons in `failedRepositories`.
* `webhookPending` lists enabled repositories whose provider webhook is still pending registration. Reviews begin once the webhook is registered.


## OpenAPI

````yaml POST /repos/pr-reviews
openapi: 3.0.0
info:
  title: Hacktron REST API
  description: Public REST API for programmatic access to Hacktron
  version: '1.0'
  contact: {}
servers:
  - url: https://api.hacktron.ai/v1
security:
  - api-key: []
tags: []
paths:
  /repos/pr-reviews:
    post:
      tags:
        - REST API - Repos
      summary: >-
        Turn PR/MR reviews on or off for repositories, by their id from the
        repository list. A repository must be selected for Hacktron access
        before its reviews can be turned on.
      operationId: RestRepoController_setPrReviews
      parameters:
        - name: X-Organization-Id
          in: header
          description: Organization ID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepositoryIdBatchDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryBatchResultDto'
components:
  schemas:
    RepositoryIdBatchDto:
      type: object
      properties:
        enable:
          description: Ids from the repository list of the repositories to turn on
          example:
            - 123e4567-e89b-12d3-a456-426614174000
          type: array
          items:
            type: string
            format: uuid
        disable:
          description: Ids from the repository list of the repositories to turn off
          example: []
          type: array
          items:
            type: string
            format: uuid
      required:
        - enable
        - disable
    RepositoryBatchResultDto:
      type: object
      properties:
        processed:
          type: number
          description: Keys applied
          example: 2
        failed:
          type: number
          description: Keys that failed
          example: 0
        failedRepositories:
          description: Keys that failed, with the reason
          type: array
          items:
            $ref: '#/components/schemas/RepositoryBatchFailureDto'
        webhookPending:
          description: Keys turned on whose provider webhook could not be registered
          example: []
          type: array
          items:
            type: string
      required:
        - processed
        - failed
        - failedRepositories
        - webhookPending
    RepositoryBatchFailureDto:
      type: object
      properties:
        repo:
          type: string
          description: The key the request named
          example: acme/api
        reason:
          type: string
          description: Why the key was not applied
          example: Repository acme/api not found
      required:
        - repo
        - reason
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-Api-Key

````

## Related topics

- [Hacktron in Slack](https://docs.hacktron.ai/platform/slack-assistant.md)
- [Get Started](https://docs.hacktron.ai/mcp/get-started.md)
- [Organization settings](https://docs.hacktron.ai/platform/organization-settings.md)
- [Findings and feedback](https://docs.hacktron.ai/code-review/findings-feedback.md)
- [Changelog](https://docs.hacktron.ai/changelog.md)


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