Mark notifications as read in a repository¶
PUT /api/v5/repos/{owner}/{repo}/notifications
Call this endpoint to mark one or more notifications in a specified repository as read. You can process multiple notifications at once by passing a list of notification IDs. On success, the endpoint returns an empty response.
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 of the repository (enterprise, organization, or personal address path) |
repo |
path | string | Yes | Repository path (path) |
access_token |
query | string | Yes | User authorization code |
ids |
query | string | No | A set of notification IDs, separated by , |
Response parameters¶
This endpoint has no response body (the handler returns void). On success it returns HTTP 200 with an empty response body.
Error response¶
A successful response alone is not enough: callers need to know what a failure looks like in order to write error handling.
400 Invalid parameters
{
"error": "invalid_request",
"message": "Failed to parse the parameters or the request content-type is not supported",
"field": "content-type"
}
401 Unauthenticated
404 Resource not found
Note: The actual error field names returned by the backend take precedence.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
404 |
Repository not found |
405 |
Method not allowed |
429 |
Rate limited |
Request example¶
Parameter notes¶
<owner>Replace with the namespace address of the repository (the address path of the enterprise, organization, or user);<repo>Replace with the repository path;<token>Replace with your AtomGit user access token;<ids>Replace with the list of notification IDs to mark as read, separated by,.
cURL¶
curl -X PUT 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/notifications?access_token=<token>&ids=1,2,3' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const params = new URLSearchParams({
access_token: "<token>",
ids: "1,2,3",
});
const response = await fetch(
`https://api.atomgit.com/api/v5/repos/<owner>/<repo>/notifications?${params.toString()}`,
{
method: "PUT",
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
Python¶
import requests
resp = requests.put(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/notifications",
params={
"access_token": "<token>",
"ids": "1,2,3",
},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
Response example¶
Status code: 200
This endpoint has no response body; on success it returns an empty response.
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
400 |
Invalid parameters or unparseable request |
404 |
Request path or resource 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