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

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

マイルストーン

List milestones

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.

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

The state of the milestone. Either open, closed, or all.

デフォルト: open

Can be one of: open, closed, all

sortstring

What to sort results by. Either due_on or completeness.

デフォルト: due_on

Can be one of: due_on, completeness

directionstring

The direction of the sort. Either asc or desc.

デフォルト: asc

Can be one of: asc, desc

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

404

Resource not found

コードサンプル

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

Response

Status: 200
[ { "url": "https://api.github.com/repos/octocat/Hello-World/milestones/1", "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0", "labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels", "id": 1002604, "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==", "number": 1, "state": "open", "title": "v1.0", "description": "Tracking milestone for version 1.0", "creator": { "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 }, "open_issues": 4, "closed_issues": 8, "created_at": "2011-04-10T20:09:31Z", "updated_at": "2014-03-03T18:58:10Z", "closed_at": "2013-02-12T13:22:01Z", "due_on": "2012-10-09T23:39:01Z" } ]

Create a milestone

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.

Body parameters
名前, 種類, 説明
titlestring必� �

The title of the milestone.

statestring

The state of the milestone. Either open or closed.

デフォルト: open

Can be one of: open, closed

descriptionstring

A description of the milestone.

due_onstring

The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

HTTP response status codes

Status code説明
201

Created

404

Resource not found

422

Validation failed

コードサンプル

post/repos/{owner}/{repo}/milestones
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones \ -d '{"title":"v1.0","state":"open","description":"Tracking milestone for version 1.0","due_on":"2012-10-09T23:39:01Z"}'

Response

Status: 201
{ "url": "https://api.github.com/repos/octocat/Hello-World/milestones/1", "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0", "labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels", "id": 1002604, "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==", "number": 1, "state": "open", "title": "v1.0", "description": "Tracking milestone for version 1.0", "creator": { "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 }, "open_issues": 4, "closed_issues": 8, "created_at": "2011-04-10T20:09:31Z", "updated_at": "2014-03-03T18:58:10Z", "closed_at": "2013-02-12T13:22:01Z", "due_on": "2012-10-09T23:39:01Z" }

Get a milestone

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.

milestone_numberinteger必� �

The number that identifies the milestone.

HTTP response status codes

Status code説明
200

OK

404

Resource not found

コードサンプル

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

Response

Status: 200
{ "url": "https://api.github.com/repos/octocat/Hello-World/milestones/1", "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0", "labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels", "id": 1002604, "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==", "number": 1, "state": "open", "title": "v1.0", "description": "Tracking milestone for version 1.0", "creator": { "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 }, "open_issues": 4, "closed_issues": 8, "created_at": "2011-04-10T20:09:31Z", "updated_at": "2014-03-03T18:58:10Z", "closed_at": "2013-02-12T13:22:01Z", "due_on": "2012-10-09T23:39:01Z" }

Update a milestone

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.

milestone_numberinteger必� �

The number that identifies the milestone.

Body parameters
名前, 種類, 説明
titlestring

The title of the milestone.

statestring

The state of the milestone. Either open or closed.

デフォルト: open

Can be one of: open, closed

descriptionstring

A description of the milestone.

due_onstring

The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

HTTP response status codes

Status code説明
200

OK

コードサンプル

patch/repos/{owner}/{repo}/milestones/{milestone_number}
curl \ -X PATCH \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones/MILESTONE_NUMBER \ -d '{"title":"v1.0","state":"open","description":"Tracking milestone for version 1.0","due_on":"2012-10-09T23:39:01Z"}'

Response

Status: 200
{ "url": "https://api.github.com/repos/octocat/Hello-World/milestones/1", "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0", "labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels", "id": 1002604, "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==", "number": 1, "state": "open", "title": "v1.0", "description": "Tracking milestone for version 1.0", "creator": { "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 }, "open_issues": 4, "closed_issues": 8, "created_at": "2011-04-10T20:09:31Z", "updated_at": "2014-03-03T18:58:10Z", "closed_at": "2013-02-12T13:22:01Z", "due_on": "2012-10-09T23:39:01Z" }

Delete a milestone

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.

milestone_numberinteger必� �

The number that identifies the milestone.

HTTP response status codes

Status code説明
204

No Content

404

Resource not found

コードサンプル

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

Response

Status: 204