notifications_thread_subscriptions
Creates, updates, deletes, gets or lists a notifications_thread_subscriptions resource.
Overview
| Name | notifications_thread_subscriptions |
| Type | Resource |
| Id | github.activity.notifications_thread_subscriptions |
Fields
The following fields are returned by SELECT queries:
- get_thread_subscription_for_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | (example: 2012-10-06T21:34:12Z) |
ignored | boolean | |
reason | string | |
repository_url | string (uri) | (example: https://api.github.com/repos/1) |
subscribed | boolean | |
thread_url | string (uri) | (example: https://api.github.com/notifications/threads/1) |
url | string (uri) | (example: https://api.github.com/notifications/threads/1/subscription) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_thread_subscription_for_authenticated_user | select | thread_id | 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. | |
set_thread_subscription | replace | thread_id | 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. | |
delete_thread_subscription | delete | thread_id | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
thread_id | integer | The 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
- get_thread_subscription_for_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.
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
- set_thread_subscription
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
- delete_thread_subscription
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
;