# List check suites for a Git reference

From **GitHub v3 REST API**.

`GET /repos/{owner}/{repo}/commits/{ref}/check-suites`

**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.

Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.

## Parameters

### `owner`

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

### `repo`

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

### `ref`

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

ref parameter

### `app_id`

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

Filters check suites by GitHub App `id`.

### `check_name`

- Location: query
- Required: false
- Type: `string`

Returns check runs with the specified `name`.

### `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: `object`

```json
{
  "check_suites": [
    {
      "after": "d6fde92930d4715a2b49857d24b940956b26d2d3",
      "app": {
        "created_at": "2017-07-08T16:18:44-04:00",
        "description": "",
        "events": [
          "push",
          "pull_request"
        ],
        "external_url": "https://example.com",
        "html_url": "https://github.com/apps/octoapp",
        "id": 1,
        "name": "Octocat App",
        "node_id": "MDExOkludGVncmF0aW9uMQ==",
        "owner": {
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "events_url": "https://api.github.com/orgs/github/events",
          "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": "github",
          "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
          "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/orgs/github/repos",
          "site_admin": true,
          "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/orgs/github"
        },
        "permissions": {
          "contents": "read",
          "issues": "write",
          "metadata": "read",
          "single_file": "write"
        },
        "slug": "octoapp",
        "updated_at": "2017-07-08T16:18:44-04:00"
      },
      "before": "146e867f55c26428e5f9fade55a9bbf5e95a7912",
      "check_runs_url": "https://api.github.com/repos/octocat/Hello-World/check-suites/5/check-runs",
      "conclusion": "neutral",
      "created_at": "2011-01-26T19:01:12Z",
      "head_branch": "master",
      "head_commit": {
        "author": {
          "email": "octocat@nowhere.com",
          "name": "The Octocat"
        },
        "committer": {
          "email": "octocat@nowhere.com",
          "name": "The Octocat"
        },
        "id": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d",
        "message": "Merge pull request #6 from Spaceghost/patch-1\n\nNew line at end of file.",
        "timestamp": "2016-10-10T00:00:00Z",
        "tree_id": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"
      },
      "head_sha": "d6fde92930d4715a2b49857d24b940956b26d2d3",
      "id": 5,
      "latest_check_runs_count": 1,
      "node_id": "MDEwOkNoZWNrU3VpdGU1",
      "pull_requests": [],
      "repository": {
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "archived": false,
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "clone_url": "https://github.com/octocat/Hello-World.git",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "created_at": "2011-01-26T19:01:12Z",
        "default_branch": "master",
        "delete_branch_on_merge": true,
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "description": "This your first repo!",
        "disabled": false,
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "fork": false,
        "forks_count": 9,
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "full_name": "octocat/Hello-World",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "has_downloads": true,
        "has_issues": true,
        "has_pages": false,
        "has_projects": true,
        "has_wiki": true,
        "homepage": "https://github.com",
        "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
        "html_url": "https://github.com/octocat/Hello-World",
        "id": 1296269,
        "is_template": true,
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "language": null,
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "mirror_url": "git:git.example.com/octocat/Hello-World",
        "name": "Hello-World",
        "network_count": 0,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "open_issues_count": 0,
        "owner": {
          "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"
        },
        "permissions": {
          "admin": false,
          "pull": true,
          "push": false
        },
        "private": false,
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "pushed_at": "2011-01-26T19:06:43Z",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "size": 108,
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_count": 80,
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_count": 42,
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "svn_url": "https://svn.github.com/octocat/Hello-World",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
        "topics": [
          "octocat",
          "atom",
          "electron",
          "api"
        ],
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "updated_at": "2011-01-26T19:14:43Z",
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "visibility": "public",
        "watchers_count": 80
      },
      "status": "completed",
      "updated_at": "2011-01-26T19:14:43Z",
      "url": "https://api.github.com/repos/github/hello-world/check-suites/5"
    }
  ],
  "total_count": 1
}
```

```json
{"properties":{"check_suites":{"items":{"$ref":"#/components/schemas/check-suite"},"type":"array"},"total_count":{"type":"integer"}},"required":["total_count","check_suites"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/commits/{ref}/check-suites
```
