Notifications API

Now that the dust has settled aroundNotifications and Stars,we've unleashed all that:sparkles: in abrand new API. You can nowview and mark notifications as read.

Endpoint

The core notifications functionality is under the/notifications endpoint.You can look for unread notifications:

curl https://api.github.com/notifications

You can filter these notifications to a single Repository:

curl https://api.github.com/repos/technoweenie/faraday/notifications

You can mark them as read:

# all notificationscurl https://api.github.com/notifications \   -X PUT -d '{"read": true}'# notifications for a single repositorycurl https://api.github.com/repos/technoweenie/faraday/notifications \   -X PUT -d '{"read": true}'

You can also modify subscriptions for a Repository or a single thread.

# subscription details for the thread (either an Issue or Commit)curl https://api.github.com/notifications/threads/1/subscription# subscription details for a whole Repository.curl https://api.github.com/repos/technoweenie/faraday/subscription

Polling

The Notifications API is optimized for polling by the last modified time:

# Add authentication to your requestscurl -I https://api.github.com/notificationsHTTP/1.1 200 OKLast-Modified: Thu, 25 Oct 2012 15:16:27 GMTX-Poll-Interval: 60# Pass the Last-Modified header exactlycurl -I https://api.github.com/notifications   -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"HTTP/1.1 304 Not ModifiedX-Poll-Interval: 60

You can read about the API details in depth in theNotifications documentation.