Remove an issue associated with a pull request¶
DELETE /api/v5/repos/{owner}/{repo}/pulls/{number}/issues
This endpoint removes the associations between a specified pull request and multiple issues. The request body contains an array of issue numbers to disassociate, and after the operation completes, it returns information about the issues still associated with the PR.
Access token support¶
- AtomGit user access tokens
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address of the namespace the repository belongs to (the address path of the organization or individual) |
repo |
path | string | Yes | Repository path (path) |
number |
path | string | Yes | The PR number, i.e. the sequence number of the PR in this repository |
access_token |
query | string | Yes | User authorization code |
Request Body:
The request body is an integer array whose elements are the issue numbers to disassociate from the pull request.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"description": "The issue number, i.e. the sequence number of the issue in this repository",
"type": "integer"
}
}
Response parameters¶
The response body is an array of associated issue objects. Each element contains the following fields.
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Issue ID |
number |
string | Yes | No | The issue number, i.e. the sequence number of the issue in this repository |
title |
string | Yes | No | Issue title |
Error responses¶
Understand the failure response shape to make it easier to write error-handling logic.
400 Parameter error
401 Unauthenticated
Note: 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 |
Request example¶
Parameter description¶
The placeholders in https://atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/issues in the example mean the following:
Replace
<owner>with the address of the namespace the repository belongs to (the address path of the organization or individual); replace<repo>with the repository path (path); replace<number>with the PR number, i.e. the sequence number of the PR in this repository; replace<token>with your AtomGit user access token.
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/issues?access_token=<token>' \
-H 'Content-Type: application/json' \
-d '[3, 7]'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/issues?access_token=<token>",
{
method: "DELETE",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify([3, 7]),
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.delete(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/pulls/<number>/issues",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
json=[3, 7],
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": 553397,
"number": "3",
"title": "222"
},
{
"id": 553716,
"number": "7",
"title": "123"
}
]
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or 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