Skip to content

Reset the test status of a pull request

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

This endpoint resets the test status of a specified pull request. Using the reset_all parameter in the request body, you can reset the test result of a single tester or reset the test status of all testers at once (effective only for administrators). After the reset, the test status of the PR is restored to its initial value.

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:

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

Response parameters

This endpoint returns an empty object {} with no business response fields.

Error responses

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Missing parameters or invalid format"
}

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)
304 Not modified
401 Requires authentication
403 Forbidden
404 Request path not found
500 Internal server error

Request example

Parameter description

Replace <owner> with the namespace address the repository belongs to (the address path of an organization or individual); replace <repo> with the repository path (path); replace <number> with the number of the PR, that is, the ordinal number of the PR in this repository; replace <token> with your AtomGit user access token.

cURL

curl -X PATCH 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/testers?access_token=<token>' \
  -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>/testers?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>/testers",
    params={"access_token": "<token>"},
    json={"reset_all": False},
    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