Skip to main content

notifications_thread_subscriptions

Creates, updates, deletes, gets or lists a notifications_thread_subscriptions resource.

Overview

Namenotifications_thread_subscriptions
TypeResource
Idgithub.activity.notifications_thread_subscriptions

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
created_atstring (date-time) (example: 2012-10-06T21:34:12Z)
ignoredboolean
reasonstring
repository_urlstring (uri) (example: https://api.github.com/repos/1)
subscribedboolean
thread_urlstring (uri) (example: https://api.github.com/notifications/threads/1)
urlstring (uri) (example: https://api.github.com/notifications/threads/1/subscription)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_thread_subscription_for_authenticated_userselectthread_idThis 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.
set_thread_subscriptionreplacethread_idIf you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.
delete_thread_subscriptiondeletethread_idMutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
thread_idintegerThe unique identifier of the notification thread. This corresponds to the value returned in the id field when you retrieve notifications (for example with the GET /notifications operation).

SELECT examples

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.

SELECT
created_at,
ignored,
reason,
repository_url,
subscribed,
thread_url,
url
FROM github.activity.notifications_thread_subscriptions
WHERE thread_id = '{{ thread_id }}' -- required
;

REPLACE examples

If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.

REPLACE github.activity.notifications_thread_subscriptions
SET
ignored = {{ ignored }}
WHERE
thread_id = '{{ thread_id }}' --required
RETURNING
created_at,
ignored,
reason,
repository_url,
subscribed,
thread_url,
url;

DELETE examples

Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

DELETE FROM github.activity.notifications_thread_subscriptions
WHERE thread_id = '{{ thread_id }}' --required
;