GitHub v3 REST API

List notifications for the authenticated user

List all notifications for the current user, sorted by most recently updated.

get
http://HOSTNAME/api/v3/notifications

Query Parameters

allboolean

If true, show notifications marked as read.

Default:false

participatingboolean

If true, only shows notifications in which the user is directly participating or mentioned.

Default:false

sincestring(date-time)

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

beforestring(date-time)

Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Thread

idstringrequired
repositoryobjectrequired

Minimal Repository

Show Child Parameters
subjectobjectrequired
Show Child Parameters
reasonstringrequired
unreadbooleanrequired
updated_atstringrequired
last_read_atstring | nullrequired
urlstringrequired
subscription_urlstringrequired

Example:https://api.github.com/notifications/threads/2/subscription

get/notifications
 
application/json

Mark notifications as read

Marks all notifications as “read” removes it from the default view on GitHub Enterprise Server. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub Enterprise Server will run an asynchronous process to mark notifications as “read.” To check whether any “unread” notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

put
http://HOSTNAME/api/v3/notifications

Body

application/json
last_read_atstring(date-time)

Describes the last point that notifications were checked.

readboolean

Whether the notification has been read.

Response

application/json

Response

messagestring
put/notifications

Body

{}
 
application/json

Get a thread

get
http://HOSTNAME/api/v3/notifications/threads/{thread_id}

Path Parameters

thread_idintegerrequired

thread_id parameter

Response

application/json

Response

Thread

Thread

idstringrequired
repositoryobjectrequired

Minimal Repository

Show Child Parameters
subjectobjectrequired
Show Child Parameters
reasonstringrequired
unreadbooleanrequired
updated_atstringrequired
last_read_atstring | nullrequired
urlstringrequired
subscription_urlstringrequired

Example:https://api.github.com/notifications/threads/2/subscription

get/notifications/threads/{thread_id}
 
application/json

Mark a thread as read

patch
http://HOSTNAME/api/v3/notifications/threads/{thread_id}

Path Parameters

thread_idintegerrequired

thread_id parameter

Response

Reset Content

patch/notifications/threads/{thread_id}
 

Get a thread subscription for the authenticated user

This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.

Note that subscriptions are only generated if a user is participating in a conversation–for example, they’ve replied to the thread, were @mentioned, or manually subscribe to a thread.

get
http://HOSTNAME/api/v3/notifications/threads/{thread_id}/subscription

Path Parameters

thread_idintegerrequired

thread_id parameter

Response

application/json

Response

Thread Subscription

Thread Subscription

subscribedbooleanrequired

Example:true

ignoredbooleanrequired
reasonstring | nullrequired
created_atstring | null(date-time)required

Example:2012-10-06T21:34:12Z

urlstring(uri)required

Example:https://api.github.com/notifications/threads/1/subscription

thread_urlstring(uri)

Example:https://api.github.com/notifications/threads/1

repository_urlstring(uri)

Example:https://api.github.com/repos/1

get/notifications/threads/{thread_id}/subscription
 
application/json