# List milestones

From **GitHub v3 REST API**.

`GET /repos/{owner}/{repo}/milestones`

List milestones

## Parameters

### `owner`

- Location: path
- Required: true
- Type: `string`

### `repo`

- Location: path
- Required: true
- Type: `string`

### `state`

- Location: query
- Required: false
- Type: `string`
- Default: `open`
- Allowed values: `"open"`, `"closed"`, `"all"`

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

### `sort`

- Location: query
- Required: false
- Type: `string`
- Default: `due_on`
- Allowed values: `"due_on"`, `"completeness"`

What to sort results by. Either `due_on` or `completeness`.

### `direction`

- Location: query
- Required: false
- Type: `string`
- Default: `asc`
- Allowed values: `"asc"`, `"desc"`

The direction of the sort. Either `asc` or `desc`.

### `per_page`

- Location: query
- Required: false
- Type: `integer`
- Default: `30`

Results per page (max 100)

### `page`

- Location: query
- Required: false
- Type: `integer`
- Default: `1`

Page number of the results to fetch.

## Responses

### `200`

Response

#### Headers

##### `Link`

- Type: `string`

- Example: `<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"`

### `application/json`

- Type: `array`

```json
[
  {
    "closed_at": "2013-02-12T13:22:01Z",
    "closed_issues": 8,
    "created_at": "2011-04-10T20:09:31Z",
    "creator": {
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "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}",
      "gravatar_id": "",
      "html_url": "https://github.com/octocat",
      "id": 1,
      "login": "octocat",
      "node_id": "MDQ6VXNlcjE=",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "site_admin": false,
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "type": "User",
      "url": "https://api.github.com/users/octocat"
    },
    "description": "Tracking milestone for version 1.0",
    "due_on": "2012-10-09T23:39:01Z",
    "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
    "id": 1002604,
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels",
    "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==",
    "number": 1,
    "open_issues": 4,
    "state": "open",
    "title": "v1.0",
    "updated_at": "2014-03-03T18:58:10Z",
    "url": "https://api.github.com/repos/octocat/Hello-World/milestones/1"
  }
]
```

```json
{"items":{"$ref":"#/components/schemas/milestone"},"type":"array"}
```

### `404`

Resource not found

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/milestones
```
