Skip to content

Reset the review status of a pull request

PATCH /api/v5/repos/{owner}/{repo}/pulls/{number}/assignees

This endpoint resets the review status of a specific pull request in a specified repository. An optional parameter in the request body controls whether the review records of all reviewers are reset; resetting all reviewers takes effect only for repository administrators.

Access token support

  • AtomGit user access tokens

Anonymous access allowed

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes The namespace address the repository belongs to (the address path of an organization or individual)
repo path string Yes Repository path (path)
number path integer Yes The number of the PR, that is, the ordinal number of the PR in this repository
access_token query string Yes User authorization code

Request Body:

The request body is an optional JSON object that specifies the reset scope.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "reset_all": {
      "description": "Whether to reset all reviewers. Default: false. Effective only for administrators.",
      "type": "boolean",
      "default": false
    }
  }
}

Response parameters

A successful response returns an empty object {} with no business fields.

Error responses

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Invalid parameters"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The error field names above are subject to what the backend actually returns.

HTTP response status codes

Status code Description
200 Success (OK)
400 Invalid parameters (Bad request)
401 Requires authentication
403 Forbidden
404 Resource not found
429 Too many requests, rate limit triggered
500 Internal server error

Request example

Parameter description

  • <owner> — replace with the namespace address the repository belongs to (the address path of an organization or individual);
  • <repo> — replace with the repository path (path);
  • <number> — replace with the PR number;
  • <token> — replace with your AtomGit user access token.

cURL

curl -X PATCH 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/assignees?access_token=<token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"reset_all": false}'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/assignees?access_token=<token>",
  {
    method: "PATCH",
    headers: {
      "Accept": "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ reset_all: false }),
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.patch(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/assignees",
    params={"access_token": "<token>"},
    json={"reset_all": False},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Invalid parameters or unparseable request
404 Request path not found
405 Request method not supported
429 Too many requests, rate limit triggered
500 Internal server error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc