Skip to content

Refresh the position/expiration status of pull request comments

POST /api/v5/repos/{owner}/{repo}/pulls/{number}/refresh_position

Refreshes the position and expiration status of comments on the specified pull request. You can target a refresh by file path or by comment ID; when neither is specified, all comments on that pull request are refreshed.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address to which the repository belongs (address path of the organization or user)
repo path string Yes Repository path (path)
number path integer Yes Pull request number
access_token query string Yes User authorization code

Request Body:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "refresh_by_paths": {
      "description": "Refresh by file path; if neither file paths nor comment ID are passed, all comments are refreshed",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "refresh_by_note_id": {
      "description": "Refresh by comment ID; if neither file paths nor comment ID are passed, all comments are refreshed",
      "type": "string"
    }
  },
  "required": []
}

Response parameters

Field Type Always returned Nullable Description
note_ids integer[] Yes No List of IDs of the comments that were refreshed

Error response

400 Invalid parameters

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

401 Unauthenticated

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

Error field names follow what the backend actually returns.

HTTP status codes

Status code Description
200 Success (OK)
400 Parameter error (Bad request)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Resource does not exist (Not found)
405 Request method not allowed (Method not allowed)
429 Too many requests; rate limit triggered (Too many requests)
500 Internal server error (Internal server error)

Request example

Parameter notes

replace <owner> with the namespace address to which the repository belongs (address path of the organization or user); replace <repo> with the repository path (path); replace <number> with the pull request number; replace <token> with your AtomGit user access token.

cURL

curl -X POST 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/refresh_position?access_token=<token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "refresh_by_paths": ["src/main/java/App.java"],
    "refresh_by_note_id": "12345"
  }'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const token = "<YOUR-TOKEN>";
const owner = "<owner>";
const repo = "<repo>";
const number = "<number>";

const response = await fetch(
  `https://api.atomgit.com/api/v5/repos/${owner}/${repo}/pulls/${number}/refresh_position?access_token=${token}`,
  {
    method: "POST",
    headers: {
      "Accept": "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      refresh_by_paths: ["src/main/java/App.java"],
      refresh_by_note_id: "12345",
    }),
  }
);

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

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

Python

import requests

resp = requests.post(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/refresh_position",
    params={"access_token": "<token>"},
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "refresh_by_paths": ["src/main/java/App.java"],
        "refresh_by_note_id": "12345",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "note_ids": [
    0
  ]
}

Error codes

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

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