@PLUGIN@ - /reviewers/ REST API
===============================

This page describes the REST endpoints that are added by the @PLUGIN@ plugin.

Please also take note of the general information on the
[REST API](../../../Documentation/rest-api.html).

 Reviewers Endpoints
----------------------------------------------

###  Get Reviewers
_GET /projects/project_name/@PLUGIN@_

Gets the default reviewers for specified project.

#### Request

```
  GET /projects/myproject/@PLUGIN@ HTTP/1.0
```

As response a List of [ReviewerFilter](#reviewer-filter) is returned
that describes the default reviewers for myproject.

#### Response

```
  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    {
      "filter": "branch:master",
      "reviewers": [
        "UserA",
        "UserB"
      ],
      "cc": [
        "DevGroup"
      ]
    },
    {
      "filter": "file:^lib/*",
      "reviewers": [
        "UserB",
        "UserC"
      ]
    }
  ]
```

###  Change Reviewers
_POST /projects/project_name/@PLUGIN@_

Changes the default reviewers for the specified project.

The change to reviewers must be provided in the request body inside
a [ConfigReviewersInput](#config-reviewers-input) entity.

Caller must be a member of a group that is granted the 'Modify Reviewers Config'
capability (provided by this plugin) or be a Project Owner for the project.

#### Request

```
  POST /projects/myproject/@PLUGIN@ HTTP/1.0
  Content-Type: application/json;charset=UTF-8
  {
    "action": "ADD",
    "type": "REVIEWER"
    "filter": "branch:master",
    "reviewer": "UserA",
  }
```

As response the default reviewers are returned as a list of
[ReviewerFilter](#reviewer-filter).

#### Response

```
  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    {
      "filter": "branch:master",
      "reviewers": [
        "UserA",
        "UserB"
      ]
      "ccs": [
        "DevGroup"
      ]
    },
    {
      "filter": "file:^lib/*",
      "reviewers": [
        "UserB",
        "UserC"
      ]
    }
  ]

```


JSON Entities
-----------------------------------

### ReviewerFilter

The `ReviewerFilter` entity contains a filter of the default reviewers.

* _filter_: A filter that is used to assign default reviewers.
* _reviewers_: List of usernames which are assigned as default reviewers
 under the filter.
* _ccs_: List of usernames which are assigned as default ccs
 under the filter.

### ConfigReviewersInput

The `ConfigReviewersInput` entity contains an update for the default
reviewers.

* _action_: Indicates whether to add or remove the input reviewer
* _type_: Which type to add/remove the user as, (REVIEWER|CC), defaults to REVIEWER.
* _filter_: The filter associated with the input reviewer.
* _reviewer_: The user to add or remove from the default reviewers.

GERRIT
------
Part of [Gerrit Code Review](../../../Documentation/index.html)
