# Create a self-hosted runner group for an enterprise

From **GitHub v3 REST API**.

`POST /enterprises/{enterprise}/actions/runner-groups`

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

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

## Parameters

### `enterprise`

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

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

## Request body

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

- Type: `object`

```json
{
  "name": "Expensive hardware runners",
  "runners": [
    9,
    2
  ],
  "selected_organization_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_organization_ids":{"description":"List of organization IDs that can access the runner group.","items":{"description":"Unique identifier of the organization.","type":"integer"},"type":"array"},"visibility":{"description":"Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: `all` or `selected`","enum":["selected","all"],"type":"string"}},"required":["name"],"type":"object"}
```

## Responses

### `201`

Response

### `application/json`

- Type: `object`

```json
{
  "allows_public_repositories": false,
  "default": false,
  "id": 2,
  "name": "octo-runner-group",
  "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners",
  "selected_organizations_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations",
  "visibility": "selected"
}
```

```json
{"properties":{"allows_public_repositories":{"type":"boolean"},"default":{"type":"boolean"},"id":{"type":"number"},"name":{"type":"string"},"runners_url":{"type":"string"},"selected_organizations_url":{"type":"string"},"visibility":{"type":"string"}},"required":["id","name","visibility","allows_public_repositories","default","runners_url"],"type":"object"}
```

## Request examples

### cURL

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