# Create a self-hosted runner group for an organization

From **GitHub v3 REST API**.

`POST /orgs/{org}/actions/runner-groups`

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)."

Creates a new self-hosted runner group for an organization.

You must authenticate using an access token with the `admin:org` scope to use this endpoint.

## Parameters

### `org`

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

## Request body

- Required: true
### `application/json`

- Type: `object`

```json
{
  "name": "Expensive hardware runners",
  "runners": [
    9,
    2
  ],
  "selected_repository_ids": [
    32,
    91
  ],
  "visibility": "selected"
}
```

```json
{"properties":{"allows_public_repositories":{"default":false,"description":"Whether the runner group can be used by `public` repositories.","type":"boolean"},"name":{"description":"Name of the runner group.","type":"string"},"runners":{"description":"List of runner IDs to add to the runner group.","items":{"description":"Unique identifier of the runner.","type":"integer"},"type":"array"},"selected_repository_ids":{"description":"List of repository IDs that can access the runner group.","items":{"description":"Unique identifier of the repository.","type":"integer"},"type":"array"},"visibility":{"default":"all","description":"Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: `all`, `selected`, or `private`.","enum":["selected","all","private"],"type":"string"}},"required":["name"],"type":"object"}
```

## Responses

### `201`

Response

### `application/json`

- Type: `object`

```json
{
  "allows_public_repositories": true,
  "default": false,
  "id": 2,
  "inherited": false,
  "name": "octo-runner-group",
  "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories",
  "visibility": "selected"
}
```

```json
{"properties":{"allows_public_repositories":{"type":"boolean"},"default":{"type":"boolean"},"id":{"type":"number"},"inherited":{"type":"boolean"},"inherited_allows_public_repositories":{"type":"boolean"},"name":{"type":"string"},"runners_url":{"type":"string"},"selected_repositories_url":{"description":"Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected`","type":"string"},"visibility":{"type":"string"}},"required":["id","name","visibility","default","runners_url","inherited","allows_public_repositories"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url {protocol}://{hostname}/api/v3/orgs/{org}/actions/runner-groups \
  --header 'content-type: application/json' \
  --data '{
  "name": "Expensive hardware runners",
  "runners": [
    9,
    2
  ],
  "selected_repository_ids": [
    32,
    91
  ],
  "visibility": "selected"
}'
```
