New response code for notifications marked as "read" in bulk

You can use the /PUT notifications endpoint to mark all notifcations as "read." Similarly, you can use the PUT /repos/:owner/:repo/notifications endpoint to mark all notifications as "read" for a specific repository.

Sometimes, GitHub would time out and return an error when there were too many unread notifications to process in a single request. We've changed both endpoints to trigger a background job that will mark the notifications as "read" asynchronously. If the operation is too expensive for a single request, the endpoint returns a 202 status code with the following response:

{
  "message": "Unread notifications couldn't be marked in a single request. Notifications are being marked as read in the background."
}

After analyzing recent request data and we expect very few requests to trigger a background job. Most requests should return a 205 status code as usual. If you do receive a 202 status code, it will take a short amount of time for all notifications to be marked as "read" in the background job. There is currently no way to check if the job has completed. Instead, we recommend checking the number of unread notifications in separate requests using one of these endpoints:

GET https://api.github.com/notifications?all=false

or

GET https://api.github.com/repos/:owner/:repo/notifications?all=false