Skip to main content
ドキュメントには� �繁に更新が� えられ、その都度公開されています。本ページの翻訳はま� 未完成な部分があることをご了承く� さい。最新の情� �については、英語のドキュメンテーションをご参照く� さい。本ページの翻訳に問題がある� �合はこちらまでご連絡く� さい。

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-06-03. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの改善、新機能のためには、最新バージョンのGitHub Enterpriseにアップグレードしてく� さい。 アップグレードに関する支援については、GitHub Enterprise supportに連絡してく� さい。

通知

Notifications APIを使うと、GitHub Enterprise Server通知の管理ができます。

Notifications APIについて

Notifications APIを使うと、GitHub Enterprise Server通知の管理ができます。 通知に関する詳しい情� �については「通知について」を参照してく� さい。

すべての通知 API 呼び出しには、notifications または repo API スコープが必要です。 これを行うと、一部の Issue およびコミットコンテンツへの読み取り専用アクセス権が付与されます。 それぞれのエンドポイントから Issue とコミットにアクセスするには、repo スコープが必要です。

通知は「スレッド」として返されます。 スレッドには、Issue、プルリクエスト、またはコミットの現在のディスカッションに関する情� �が含まれています。

通知は、Last-Modified ヘッダでポーリングするために最適化されています。 新しい通知がない� �合は、304 Not Modified レスポンスが表示され、現在のレート制限は変更されません。 X-Poll-Interval ヘッダで、ポーリングを許可する� �度(秒単位)を指定します。 サーバー� 荷が高い� �合、長時間かかることがあります。 ヘッダに従ってく� さい。

# リクエストに認証を追� 
$ curl -I http(s)://[hostname]/api/v3/notifications
HTTP/2 200
Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
X-Poll-Interval: 60

# Last-Modifiedヘッダを正確に渡す
$ curl -I http(s)://[hostname]/api/v3/notifications
$    -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
> HTTP/2 304
> X-Poll-Interval: 60

通知の理由について

通知 API からレスポンスを取得するとき、各ペイロードには reason というタイトルのキーがあります。 これらは、通知をトリガーするイベントに対応しています。

通知を受け取るreason(理由)には、次のようなものがあります。

理由名説明
assignIssue に割り当てられた。
authorスレッドを作成した。
commentスレッドにコメントした。
ci_activityトリガーしたGitHub Actions ワークフローの実行が完了した。
invitationリポジトリへのコントリビューションへの招待を承諾した。
manualスレッドをサブスクライブした(Issue またはプルリクエストを介して)。
mentionコンテンツで具体的に@メンションされた。
review_requested自分、または自分が所属している Team が、Pull Requestのレビューを求められた。
state_changeスレッドの状態を変更した(たとえば、Issue をクローズしたり、プルリクエストをマージしたりした)。
subscribedリポジトリを Watch している。
team_mentionメンションされた Team に所属していた。

reason はスレッドごとに変更され、後の通知の reason が異なる� �合は変更される可能性があることに注意してく� さい。

たとえば、Issue の作者である� �合は、その Issue に関するその後の通知には、author(作者)の reason(理由)が含まれます。 その後、同じ Issue について@メンションされている� �合、その後に取得する通知に mention(メンション)する reason(理由)が含まれます。 その reason は、再度メンションされたかどうかにかかわらず、mention として残ります。

List notifications for the authenticated user

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

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

クエリパラメータ
名前, 種類, 説明
allboolean

If true, show notifications marked as read.

デフォルト: false

participatingboolean

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

デフォルト: false

sincestring

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

beforestring

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

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

422

Validation failed

コードサンプル

get/notifications
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications

Response

Status: 200
[ { "id": "1", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks" }, "subject": { "title": "Greetings", "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123", "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123", "type": "Issue" }, "reason": "subscribed", "unread": true, "updated_at": "2014-11-07T22:01:45Z", "last_read_at": "2014-11-07T22:01:45Z", "url": "https://api.github.com/notifications/threads/1", "subscription_url": "https://api.github.com/notifications/threads/1/subscription" } ]

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.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Body parameters
名前, 種類, 説明
last_read_atstring

Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

readboolean

Whether the notification has been read.

HTTP response status codes

Status code説明
202

Accepted

205

Reset Content

304

Not modified

401

Requires authentication

403

Forbidden

コードサンプル

put/notifications
curl \ -X PUT \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications \ -d '{"last_read_at":"2022-06-10T00:00:00Z","read":true}'

Response

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

Get a thread

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
thread_idinteger必� �

The unique identifier of the pull request thread.

HTTP response status codes

Status code説明
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

コードサンプル

get/notifications/threads/{thread_id}
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID

Response

Status: 200
{ "id": "1", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks" }, "subject": { "title": "Greetings", "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123", "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123", "type": "Issue" }, "reason": "subscribed", "unread": true, "updated_at": "2014-11-07T22:01:45Z", "last_read_at": "2014-11-07T22:01:45Z", "url": "https://api.github.com/notifications/threads/1", "subscription_url": "https://api.github.com/notifications/threads/1/subscription" }

Mark a thread as read

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
thread_idinteger必� �

The unique identifier of the pull request thread.

HTTP response status codes

Status code説明
205

Reset Content

304

Not modified

403

Forbidden

コードサンプル

patch/notifications/threads/{thread_id}
curl \ -X PATCH \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID

Reset Content

Status: 205

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.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
thread_idinteger必� �

The unique identifier of the pull request thread.

HTTP response status codes

Status code説明
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

コードサンプル

get/notifications/threads/{thread_id}/subscription
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription

Response

Status: 200
{ "subscribed": true, "ignored": false, "reason": null, "created_at": "2012-10-06T21:34:12Z", "url": "https://api.github.com/notifications/threads/1/subscription", "thread_url": "https://api.github.com/notifications/threads/1" }

Set a 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.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
thread_idinteger必� �

The unique identifier of the pull request thread.

Body parameters
名前, 種類, 説明
ignoredboolean

Whether to block all notifications from a thread.

デフォルト: false

HTTP response status codes

Status code説明
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

コードサンプル

put/notifications/threads/{thread_id}/subscription
curl \ -X PUT \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription \ -d '{"ignored":false}'

Response

Status: 200
{ "subscribed": true, "ignored": false, "reason": null, "created_at": "2012-10-06T21:34:12Z", "url": "https://api.github.com/notifications/threads/1/subscription", "thread_url": "https://api.github.com/notifications/threads/1" }

Delete a 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.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
thread_idinteger必� �

The unique identifier of the pull request thread.

HTTP response status codes

Status code説明
204

No Content

304

Not modified

401

Requires authentication

403

Forbidden

コードサンプル

delete/notifications/threads/{thread_id}/subscription
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/notifications/threads/THREAD_ID/subscription

Response

Status: 204

List repository notifications for the authenticated user

List all notifications for the current user.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

クエリパラメータ
名前, 種類, 説明
allboolean

If true, show notifications marked as read.

デフォルト: false

participatingboolean

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

デフォルト: false

sincestring

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

beforestring

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

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

コードサンプル

get/repos/{owner}/{repo}/notifications
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/notifications

Response

Status: 200
[ { "id": "1", "repository": { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks" }, "subject": { "title": "Greetings", "url": "https://api.github.com/repos/octokit/octokit.rb/issues/123", "latest_comment_url": "https://api.github.com/repos/octokit/octokit.rb/issues/comments/123", "type": "Issue" }, "reason": "subscribed", "unread": true, "updated_at": "2014-11-07T22:01:45Z", "last_read_at": "2014-11-07T22:01:45Z", "url": "https://api.github.com/notifications/threads/1", "subscription_url": "https://api.github.com/notifications/threads/1/subscription" } ]

Mark repository notifications as read

Marks all notifications in a repository as "read" removes them 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 repository notifications for the authenticated user endpoint and pass the query parameter all=false.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

Body parameters
名前, 種類, 説明
last_read_atstring

Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: The current timestamp.

HTTP response status codes

Status code説明
202

Accepted

205

Reset Content

コードサンプル

put/repos/{owner}/{repo}/notifications
curl \ -X PUT \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/notifications

Response

Status: 202