Jump to >

Default Reviewer List Resource

Added in 1.6.16

Provides information on default reviewers for review requests.

Review Board will apply any default reviewers that match the repository and any file path in an uploaded diff for new and updated review requests. A default reviewer entry can list multiple users and groups.

This is useful when different groups own different parts of a codebase. Adding DefaultReviewer entries ensures that the right people will always see the review request and discussions.

Default reviewers take a regular expression for the file path matching, making it flexible.

As a tip, specifying .* for the regular expression would have this default reviewer applied to every review request on the matched repositories.

Details

Name default_reviewers
URI /api/default-reviewers/
Token Policy ID default_reviewer
HTTP Methods
  • GET - Retrieves the list of default reviewers on the server.
  • POST - Creates a new default reviewer entry.
Parent Resource Root List Resource
Child Resources
Anonymous Access Yes, if anonymous site access is enabled

HTTP GET

Retrieves the list of default reviewers on the server.

By default, this lists all default reviewers. This list can be further filtered down through the query arguments.

Request Parameters

counts-onlyBoolean If specified, a single count field is returned with the number of results, instead of the results themselves.
groupsString A comma-separated list of group names that each resulting default reviewer must apply to review requests.
max-resultsInteger The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link.
repositoriesString A comma-separated list of IDs of repositories that each resulting default reviewer must match against.
startInteger The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0.
usersString A comma-separated list of usernames that each resulting default reviewer must apply to review requests.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in
105 - Invalid Form DataHTTP 400 - Bad Request One or more fields had errors

HTTP POST

Creates a new default reviewer entry.

Note that by default, a default reviewer will apply to review requests on all repositories, unless one or more repositories are provided in the default reviewer’s list.

Request Parameters

file_regexString Required

The regular expression used to match file paths in newly uploaded diffs.

nameString Required

The name of the default reviewer entry.

groupsString A comma-separated list of group names.
repositoriesString A comma-separated list of repository IDs.
usersString A comma-separated list of usernames.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in
105 - Invalid Form DataHTTP 400 - Bad Request One or more fields had errors

Examples

application/vnd.reviewboard.org.default-reviewers+json

$ curl http://reviews.example.com/api/default-reviewers/ -H "Accept: application/json"
Vary: Accept, Cookie
Item-Content-Type: application/vnd.reviewboard.org.default-reviewer+json
Content-Type: application/vnd.reviewboard.org.default-reviewers+json
X-Content-Type-Options: nosniff
{
  "default_reviewers": [
    {
      "file_regex": "/docs/.*", 
      "groups": [], 
      "id": 1, 
      "links": {
        "delete": {
          "href": "http://reviews.example.com/api/default-reviewers/1/", 
          "method": "DELETE"
        }, 
        "self": {
          "href": "http://reviews.example.com/api/default-reviewers/1/", 
          "method": "GET"
        }, 
        "update": {
          "href": "http://reviews.example.com/api/default-reviewers/1/", 
          "method": "PUT"
        }
      }, 
      "name": "docs-team", 
      "repositories": [
        {
          "href": "http://reviews.example.com/api/repositories/1/", 
          "method": "GET", 
          "title": "Review Board SVN"
        }
      ], 
      "users": [
        {
          "href": "http://reviews.example.com/api/users/doc/", 
          "method": "GET", 
          "title": "doc"
        }
      ]
    }
  ], 
  "links": {
    "create": {
      "href": "http://reviews.example.com/api/default-reviewers/", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api/default-reviewers/", 
      "method": "GET"
    }
  }, 
  "stat": "ok", 
  "total_results": 1
}