Check whether a pull request is merged¶
GET /api/v5/repos/{owner}/{repo}/pulls/{number}/merge
This endpoint checks whether a pull request in the specified repository has been merged, locating the target by repository namespace address, repository path, and PR number, and returns the corresponding merge status message.
Access token support¶
- AtomGit user access tokens (AtomGit user access tokens)
Whether anonymous access is allowed¶
This endpoint allows 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 personal namespace) |
repo |
path | string | Yes | Repository path (path) |
number |
path | integer | Yes | Which PR, that is, the ordinal number of the PR in this repository |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
message |
string | Yes | No | Merge status message, for example Pull Request already merged |
Error response¶
This endpoint has no business error response. The reference documentation defines only the 200 success response; if the endpoint returns an error, the actual error field names are as returned by the backend.
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Authentication required (Requires authentication) |
403 |
Forbidden (Forbidden) |
404 |
The requested resource does not exist (Not found) |
Request example¶
Parameter descriptions¶
<owner>is replaced with the namespace address the repository belongs to (the address path of an enterprise, organization, or personal namespace);<repo>with the repository path (path);<number>with which PR, that is, the ordinal number of the PR in this repository.
This endpoint allows anonymous access and can be called without authentication headers; to access restricted resources such as private repositories, you can also include an AtomGit user access token.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/merge' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/merge", {
headers: {
"Accept": "application/json",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/merge",
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 |
Parameter error or the request cannot be parsed |
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