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

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

Events

The Events API is a read-only API to the GitHub events.

These events power the various activity streams on the site.

The Events API can return different types of events triggered by activity on GitHub Enterprise Server. For more information about the specific events that you can receive from the Events API, see "GitHub Event types." An events API for repository issues is also available. For more information, see the "Issue Events API."

Events are optimized for polling with the "ETag" header. If no new events have been triggered, you will see a "304 Not Modified" response, and your current rate limit will be untouched. There is also an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

$ curl -I http(s)://[hostname]/api/v3/users/tater/events
> HTTP/2 200
> X-Poll-Interval: 60
> ETag: "a18c3bded88eb5dbb5c849a489412bf3"

# The quotes around the ETag value are important
$ curl -I http(s)://[hostname]/api/v3/users/tater/events \
$    -H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
> HTTP/2 304
> X-Poll-Interval: 60

Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300).

List public events

Works with GitHub Apps

We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

クエリパラメータ
名前, 種類, 説明
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

403

Forbidden

503

Service unavailable

コードサンプル

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

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-07T07:50:26Z" } ]

List public events for a network of repositories

Works with GitHub Apps

パラメータ

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.

クエリパラメータ
名前, 種類, 説明
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

301

Moved permanently

304

Not modified

403

Forbidden

404

Resource not found

コードサンプル

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

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/rrubenich", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List public organization events

Works with GitHub Apps

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

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

The organization name. The name is not case sensitive.

クエリパラメータ
名前, 種類, 説明
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/orgs/{org}/events
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/events

Response

Status: 200
[ { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octo-org/octo-repo", "url": "https://api.github.com/repos/octo-org/octo-repo" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octo-org/octo-repo", "url": "https://api.github.com/repos/octo-org/oct-repo" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octo-org/oct-repo/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" } ]

List repository events

Works with GitHub Apps

パラメータ

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.

クエリパラメータ
名前, 種類, 説明
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}/events
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22237752260", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List events for the authenticated user

Works with GitHub Apps

If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

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

The handle for the GitHub user account.

クエリパラメータ
名前, 種類, 説明
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/users/{username}/events
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/events

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": false, "created_at": "2022-06-07T07:50:26Z" } ]

List organization events for the authenticated user

This is the user's organization dashboard. You must be authenticated as the user to view this.

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

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

The handle for the GitHub user account.

orgstring必� �

The organization name. The name is not case sensitive.

クエリパラメータ
名前, 種類, 説明
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/users/{username}/events/orgs/{org}
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/events/orgs/ORG

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": false, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22196946742", "type": "CreateEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "ref": null, "ref_type": "repository", "master_branch": "master", "description": null, "pusher_type": "user" }, "public": false, "created_at": "2022-06-07T07:50:26Z", "org": { "id": 9919, "login": "github", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]

List public events for a user

Works with GitHub Apps

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

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

The handle for the GitHub user account.

クエリパラメータ
名前, 種類, 説明
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/users/{username}/events/public
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/events/public

Response

Status: 200
[ { "id": "22249084947", "type": "WatchEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "action": "started" }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-08T23:29:25Z" } ]

List events received by the authenticated user

Works with GitHub Apps

These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

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

The handle for the GitHub user account.

クエリパラメータ
名前, 種類, 説明
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/users/{username}/received_events
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/received_events

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22196946742", "type": "CreateEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "ref": null, "ref_type": "repository", "master_branch": "master", "description": null, "pusher_type": "user" }, "public": false, "created_at": "2022-06-07T07:50:26Z", "org": { "id": 9919, "login": "github", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]

List public events received by a user

Works with GitHub Apps

パラメータ

Headers
名前, 種類, 説明
acceptstring

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

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

The handle for the GitHub user account.

クエリパラメータ
名前, 種類, 説明
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/users/{username}/received_events/public
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/users/USERNAME/received_events/public

Response

Status: 200
[ { "id": "22249084964", "type": "PushEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "push_id": 10115855396, "size": 1, "distinct_size": 1, "ref": "refs/heads/master", "head": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "before": "883efe034920928c47fe18598c01249d1a9fdabd", "commits": [ { "sha": "7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300", "author": { "email": "octocat@github.com", "name": "Monalisa Octocat" }, "message": "commit", "distinct": true, "url": "https://api.github.com/repos/octocat/Hello-World/commits/7a8f3ac80e2ad2f6842cb86f576d4bfe2c03e300" } ] }, "public": true, "created_at": "2022-06-09T12:47:28Z" }, { "id": "22196946742", "type": "CreateEvent", "actor": { "id": 583231, "login": "octocat", "display_login": "octocat", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=4" }, "repo": { "id": 1296269, "name": "octocat/Hello-World", "url": "https://api.github.com/repos/octocat/Hello-World" }, "payload": { "ref": null, "ref_type": "repository", "master_branch": "master", "description": null, "pusher_type": "user" }, "public": false, "created_at": "2022-06-07T07:50:26Z", "org": { "id": 9919, "login": "github", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://avatars.githubusercontent.com/u/9919?" } } ]