When retrieving responses from the Notifications API, each payload has a key titled reason. These correspond to events that trigger a notification.
Here's a list of potential reasons for receiving a notification:
| Reason Name | Description |
|---|---|
assign |
You were assigned to the issue. |
author |
You created the thread. |
comment |
You commented on the thread. |
invitation |
You accepted an invitation to contribute to the repository. |
manual |
You subscribed to the thread (via an issue or pull request). |
mention |
You were specifically @mentioned in the content. |
review_requested |
You, or a team you're a member of, were requested to review a pull request. |
security_alert |
GitHub discovered a security vulnerability in your repository. |
state_change |
You changed the thread state (for example, closing an issue or merging a pull request). |
subscribed |
You're watching the repository. |
team_mention |
You were on a team that was mentioned. |
Note that the reason is modified on a per-thread basis, and can change, if the reason on a later notification is different.
For example, if you are the author of an issue, subsequent notifications on that issue will have a reason of author. If you're then @mentioned on the same issue, the notifications you fetch thereafter will have a reason of mention. The reason remains as mention, regardless of whether you're ever mentioned again.