|
| 1 | +--- |
| 2 | +title:Notifications | GitHub API |
| 3 | +--- |
| 4 | + |
| 5 | +#Notifications API |
| 6 | + |
| 7 | +* TOC |
| 8 | +{:toc} |
| 9 | + |
| 10 | +GitHub Notifications are powered by[watched repositories](/v3/repos/watching/). |
| 11 | +Users receive notifications for discussions in repositories they watch |
| 12 | +including: |
| 13 | + |
| 14 | +* Issues and their comments |
| 15 | +* Pull Requests and their comments |
| 16 | +* Comments on any commits |
| 17 | + |
| 18 | +Notifications are also sent for discussions in unwatched repositories when the |
| 19 | +user is involved including: |
| 20 | + |
| 21 | +***@mentions** |
| 22 | +* Assignments |
| 23 | +* Commits the user authors or commits |
| 24 | +* Any discussion in which the user actively participates |
| 25 | + |
| 26 | + |
| 27 | +##List your notifications |
| 28 | + |
| 29 | +List all notifications for the current user, grouped by repository. |
| 30 | + |
| 31 | +GET /notifications |
| 32 | + |
| 33 | +###Parameters |
| 34 | + |
| 35 | +all |
| 36 | +:_Optional_**boolean**`true` to show notifications marked as read. |
| 37 | + |
| 38 | +participating |
| 39 | +:_Optional_**boolean**`true` to show only notifications in which the user is |
| 40 | +directly participating or mentioned. |
| 41 | + |
| 42 | + |
| 43 | +##List your notifications in a repository |
| 44 | + |
| 45 | +List all notifications for the current user. |
| 46 | + |
| 47 | +GET /repos/:owner/:repo/notifications |
| 48 | + |
| 49 | +###Parameters |
| 50 | + |
| 51 | +all |
| 52 | +:_Optional_**boolean**`true` to show notifications marked as read. |
| 53 | + |
| 54 | +participating |
| 55 | +:_Optional_**boolean**`true` to show only notifications in which the user is |
| 56 | +directly participating or mentioned. |
| 57 | + |
| 58 | +##Mark as read |
| 59 | + |
| 60 | +Marking a notification as "read" archives it removes it from the[default view |
| 61 | +on GitHub.com](https://github.com/notifications). |
| 62 | + |
| 63 | +POST /notifications/mark_as_read |
| 64 | + |
| 65 | +###Parameters |
| 66 | + |
| 67 | +ids |
| 68 | +:_Optional_**Array(Number)** IDs of notifications to mark as read. If this |
| 69 | +parameter is omitted, all notifications will be marked as read. |
| 70 | + |
| 71 | +##Mark notifications as read in a repository |
| 72 | + |
| 73 | +Marking all notification in a repository as "read" archives them removes them |
| 74 | +from the[default view on GitHub.com](https://github.com/notifications). |
| 75 | + |
| 76 | +POST /repos/:owner/:repo/notifications/mark_as_read |
| 77 | + |
| 78 | +##Mute a thread |
| 79 | + |
| 80 | +Muting a thread prevents future notifications from being sent for a discussion |
| 81 | +thread. |
| 82 | + |
| 83 | +POST /notifications/threads/:id/mute |
| 84 | + |
| 85 | +##Unmute a thread |
| 86 | + |
| 87 | +Muting a thread enables future notifications from being sent for a discussion |
| 88 | +thread. |
| 89 | + |
| 90 | +POST /notifications/threads/:id/unmute |
| 91 | + |
| 92 | +##Settings |
| 93 | + |
| 94 | +Update the notification settings for the authenticated user. |
| 95 | + |
| 96 | +PATCH /notifications/settings |
| 97 | + |
| 98 | +###Parameters |
| 99 | + |
| 100 | +participating.email |
| 101 | +:_Optional_**boolean**`true` to receive participating notificationsn via |
| 102 | +email. |
| 103 | + |
| 104 | +participating.web |
| 105 | +:_Optional_**boolean**`true` to receive participating notificationsn via |
| 106 | +web. |
| 107 | + |
| 108 | +watching.email |
| 109 | +:_Optional_**boolean**`true` to receive watching notificationsn via |
| 110 | +email. |
| 111 | + |
| 112 | +watching.web |
| 113 | +:_Optional_**boolean**`true` to receive watching notificationsn via |
| 114 | +web. |
| 115 | + |
| 116 | + |
| 117 | +##Organization email address settings |
| 118 | + |
| 119 | +Update the notification settings for the authenticated user. |
| 120 | + |
| 121 | +PATCH /orgs/:org/notifications/settings |
| 122 | + |
| 123 | +###Parameters |
| 124 | + |
| 125 | +email |
| 126 | +:_Required_**string** Email address to which to send notifications to the |
| 127 | +authenticated user for discussions related to projects for this organization. |
| 128 | + |