Эта версия GitHub Enterprise Server была прекращена 2025-06-19. Исправления выпускаться не будут даже при критических проблемах безопасности. Для повышения производительности, повышения безопасности и новых функций выполните обновление до последней версии GitHub Enterprise Server. Чтобы получить справку по обновлению, обратитесь в службу поддержки GitHub Enterprise.
Конечные точки REST API для вех
Используйте REST API для управления вехами.
List milestones
Lists milestones for a repository.
Подробные маркеры доступа для "List milestones
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь по крайней мере один из следующих наборов разрешений.:
- "Issues" repository permissions (read)
 - "Pull requests" repository permissions (read)
 
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "List milestones"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
| Имя., Тип, Description | 
|---|
state string The state of the milestone. Either  По умолчанию.:  Возможные значения:   | 
sort string What to sort results by. Either  По умолчанию.:  Возможные значения:   | 
direction string The direction of the sort. Either  По умолчанию.:  Возможные значения:   | 
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.:   | 
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.:   | 
Коды состояния http-ответа для "List milestones"
| Код состояния | Описание | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
Примеры кода для "List milestones"
Пример запроса
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestonesResponse
Status: 200[
  {
    "url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1",
    "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
    "labels_url": "https://HOSTNAME/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://HOSTNAME/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://HOSTNAME/users/octocat/followers",
      "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
      "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
      "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
      "organizations_url": "https://HOSTNAME/users/octocat/orgs",
      "repos_url": "https://HOSTNAME/users/octocat/repos",
      "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
      "received_events_url": "https://HOSTNAME/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
Creates a milestone.
Подробные маркеры доступа для "Create a milestone
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь по крайней мере один из следующих наборов разрешений.:
- "Issues" repository permissions (write)
 - "Pull requests" repository permissions (write)
 
Параметры для "Create a milestone"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
| Имя., Тип, Description | 
|---|
title string Обязательное полеThe title of the milestone.  | 
state string The state of the milestone. Either  По умолчанию.:  Возможные значения:   | 
description string A description of the milestone.  | 
due_on string The milestone due date. This is a timestamp in ISO 8601 format:   | 
Коды состояния http-ответа для "Create a milestone"
| Код состояния | Описание | 
|---|---|
201 | Created  | 
404 | Resource not found  | 
422 | Validation failed, or the endpoint has been spammed.  | 
Примеры кода для "Create a milestone"
Пример запроса
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  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://HOSTNAME/repos/octocat/Hello-World/milestones/1",
  "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
  "labels_url": "https://HOSTNAME/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://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/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
Gets a milestone using the given milestone number.
Подробные маркеры доступа для "Get a milestone
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь по крайней мере один из следующих наборов разрешений.:
- "Issues" repository permissions (read)
 - "Pull requests" repository permissions (read)
 
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "Get a milestone"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
milestone_number integer Обязательное полеThe number that identifies the milestone.  | 
Коды состояния http-ответа для "Get a milestone"
| Код состояния | Описание | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
Примеры кода для "Get a milestone"
Пример запроса
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones/MILESTONE_NUMBERResponse
Status: 200{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1",
  "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
  "labels_url": "https://HOSTNAME/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://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/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
Подробные маркеры доступа для "Update a milestone
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь по крайней мере один из следующих наборов разрешений.:
- "Issues" repository permissions (write)
 - "Pull requests" repository permissions (write)
 
Параметры для "Update a milestone"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
milestone_number integer Обязательное полеThe number that identifies the milestone.  | 
| Имя., Тип, Description | 
|---|
title string The title of the milestone.  | 
state string The state of the milestone. Either  По умолчанию.:  Возможные значения:   | 
description string A description of the milestone.  | 
due_on string The milestone due date. This is a timestamp in ISO 8601 format:   | 
Коды состояния http-ответа для "Update a milestone"
| Код состояния | Описание | 
|---|---|
200 | OK  | 
Примеры кода для "Update a milestone"
Пример запроса
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  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://HOSTNAME/repos/octocat/Hello-World/milestones/1",
  "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
  "labels_url": "https://HOSTNAME/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://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/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
Deletes a milestone using the given milestone number.
Подробные маркеры доступа для "Delete a milestone
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь по крайней мере один из следующих наборов разрешений.:
- "Issues" repository permissions (write)
 - "Pull requests" repository permissions (write)
 
Параметры для "Delete a milestone"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
milestone_number integer Обязательное полеThe number that identifies the milestone.  | 
Коды состояния http-ответа для "Delete a milestone"
| Код состояния | Описание | 
|---|---|
204 | No Content  | 
404 | Resource not found  | 
Примеры кода для "Delete a milestone"
Пример запроса
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones/MILESTONE_NUMBERResponse
Status: 204