{"meta":{"title":"マイルストーン用の REST API エンドポイント","intro":"REST API を使って、マイルストーンを管理します。","product":"REST API","breadcrumbs":[{"href":"/ja/rest","title":"REST API"},{"href":"/ja/rest/issues","title":"課題"},{"href":"/ja/rest/issues/milestones","title":"マイルストーン"}],"documentType":"article"},"body":"# マイルストーン用の REST API エンドポイント\n\nREST API を使って、マイルストーンを管理します。\n\n\n> [!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n\n## List milestones\n\n```\nGET /repos/{owner}/{repo}/milestones\n```\n\nLists milestones for a repository.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`state`** (string)\n  The state of the milestone. Either open, closed, or all.\n  Default: `open`\n  Can be one of: `open`, `closed`, `all`\n\n- **`sort`** (string)\n  What to sort results by. Either due_on or completeness.\n  Default: `due_on`\n  Can be one of: `due_on`, `completeness`\n\n- **`direction`** (string)\n  The direction of the sort. Either asc or desc.\n  Default: `asc`\n  Can be one of: `asc`, `desc`\n\n- **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n- **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/milestones\n```\n\n**Response schema (Status: 200):**\n\nArray of `Milestone`:\n  * `url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `labels_url`: required, string, format: uri\n  * `id`: required, integer\n  * `node_id`: required, string\n  * `number`: required, integer\n  * `state`: required, string, enum: `open`, `closed`, default: `\"open\"`\n  * `title`: required, string\n  * `description`: required, string or null\n  * `creator`: required, any of:\n    * **null**\n    * **Simple User**\n      * `name`: string or null\n      * `email`: string or null\n      * `login`: required, string\n      * `id`: required, integer, format: int64\n      * `node_id`: required, string\n      * `avatar_url`: required, string, format: uri\n      * `gravatar_id`: required, string or null\n      * `url`: required, string, format: uri\n      * `html_url`: required, string, format: uri\n      * `followers_url`: required, string, format: uri\n      * `following_url`: required, string\n      * `gists_url`: required, string\n      * `starred_url`: required, string\n      * `subscriptions_url`: required, string, format: uri\n      * `organizations_url`: required, string, format: uri\n      * `repos_url`: required, string, format: uri\n      * `events_url`: required, string\n      * `received_events_url`: required, string, format: uri\n      * `type`: required, string\n      * `site_admin`: required, boolean\n      * `starred_at`: string\n      * `user_view_type`: string\n  * `open_issues`: required, integer\n  * `closed_issues`: required, integer\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n  * `closed_at`: required, string or null, format: date-time\n  * `due_on`: required, string or null, format: date-time\n\n\n\n\n\n## Create a milestone\n\n```\nPOST /repos/{owner}/{repo}/milestones\n```\n\nCreates a milestone.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n\n\n\n#### Body parameters\n\n- **`title`** (string) (required)\n  The title of the milestone.\n\n- **`state`** (string)\n  The state of the milestone. Either open or closed.\n  Default: `open`\n  Can be one of: `open`, `closed`\n\n- **`description`** (string)\n  A description of the milestone.\n\n- **`due_on`** (string)\n  The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\n\n\n\n\n### HTTP response status codes\n\n\n- **201** - Created\n\n\n- **404** - Resource not found\n\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/repos/OWNER/REPO/milestones \\\n  -d '{\n  \"title\": \"v1.0\",\n  \"state\": \"open\",\n  \"description\": \"Tracking milestone for version 1.0\",\n  \"due_on\": \"2012-10-09T23:39:01Z\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `labels_url`: required, string, format: uri\n* `id`: required, integer\n* `node_id`: required, string\n* `number`: required, integer\n* `state`: required, string, enum: `open`, `closed`, default: `\"open\"`\n* `title`: required, string\n* `description`: required, string or null\n* `creator`: required, any of:\n  * **null**\n  * **Simple User**\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n* `open_issues`: required, integer\n* `closed_issues`: required, integer\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `closed_at`: required, string or null, format: date-time\n* `due_on`: required, string or null, format: date-time\n\n\n\n\n\n## Get a milestone\n\n```\nGET /repos/{owner}/{repo}/milestones/{milestone_number}\n```\n\nGets a milestone using the given milestone number.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`milestone_number`** (integer) (required)\n  The number that identifies the milestone.\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/milestones/MILESTONE_NUMBER\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a milestone](#create-a-milestone).\n\n\n\n\n\n## Update a milestone\n\n```\nPATCH /repos/{owner}/{repo}/milestones/{milestone_number}\n```\n\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`milestone_number`** (integer) (required)\n  The number that identifies the milestone.\n\n\n\n\n#### Body parameters\n\n- **`title`** (string)\n  The title of the milestone.\n\n- **`state`** (string)\n  The state of the milestone. Either open or closed.\n  Default: `open`\n  Can be one of: `open`, `closed`\n\n- **`description`** (string)\n  A description of the milestone.\n\n- **`due_on`** (string)\n  The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\n\n\n\n\n### HTTP response status codes\n\n\n- **200** - OK\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/repos/OWNER/REPO/milestones/MILESTONE_NUMBER \\\n  -d '{\n  \"title\": \"v1.0\",\n  \"state\": \"open\",\n  \"description\": \"Tracking milestone for version 1.0\",\n  \"due_on\": \"2012-10-09T23:39:01Z\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a milestone](#create-a-milestone).\n\n\n\n\n\n## Delete a milestone\n\n```\nDELETE /repos/{owner}/{repo}/milestones/{milestone_number}\n```\n\nDeletes a milestone using the given milestone number.\n\n\n### Parameters\n\n\n#### Headers\n\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n\n\n#### Path and query parameters\n\n- **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n- **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n- **`milestone_number`** (integer) (required)\n  The number that identifies the milestone.\n\n\n\n\n\n\n### HTTP response status codes\n\n\n- **204** - No Content\n\n\n- **404** - Resource not found\n\n\n\n\n### Code examples\n\n\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/repos/OWNER/REPO/milestones/MILESTONE_NUMBER\n```\n\n**Response schema (Status: 204):**"}