Skip to content

List notifications in a repository

GET /api/v5/repos/{owner}/{repo}/notifications

Call this endpoint to list the notifications in a specified repository. You can filter by unread status, notification type, and time range, or query a specific notification by ID. The response includes the notification content, the triggering user, and the related repository.

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
unread query boolean No Whether unread; default true
type query string No Filter by the specified notification type, enum: all (all), event (event notification), referer (@ notification)
since query string No Only return messages updated after the specified time; the time must be in ISO 8601 format
before query string No Only return messages updated before the specified time; the time must be in ISO 8601 format
ids query string No A set of notification IDs, separated by ,

Response parameters

Field Type Always returned Nullable Description
list array Yes No Notification list

list object

Field Type Always returned Nullable Description
list.id string Yes No Notification ID
list.content string Yes No Notification content
list.type string Yes No Notification type
list.unread boolean Yes No Whether unread
list.update_at string Yes No Update time
list.html_url string Yes No URL of the resource that triggered the notification
list.actor object Yes No Information about the user who triggered the notification
list.repository object Yes No Information about the related repository

list.actor object

Field Type Always returned Nullable Description
list.actor.id integer Yes No User ID
list.actor.login string Yes No Login name
list.actor.name string Yes No User name

list.repository object

Field Type Always returned Nullable Description
list.repository.id integer Yes No Repository ID
list.repository.full_name string Yes No Repository full name
list.repository.human_name string Yes No Repository display name
list.repository.url string Yes No Repository URL

Error response

401 Unauthenticated

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

(The actual error field names returned by the backend take precedence.)

HTTP status codes

Status code Description
200 Success (OK)
304 Not modified
401 Requires authentication
403 Forbidden

Request example

Parameter notes

<owner> Replace with the namespace address path 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.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/notifications?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/notifications?access_token=<YOUR-TOKEN>",
  {
    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>/notifications",
    params={"access_token": "<YOUR-TOKEN>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "list": [
    {
      "id": "string",
      "content": "string",
      "type": "string",
      "unread": true,
      "update_at": "string",
      "html_url": "string",
      "actor": {
        "id": 0,
        "login": "string",
        "name": "string"
      },
      "repository": {
        "id": 0,
        "full_name": "string",
        "human_name": "string",
        "url": "string"
      }
    }
  ]
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
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