---
title: "Create a GitHub-hosted runner for an enterprise"
method: POST
path: "/enterprises/{enterprise}/actions/hosted-runners"
tags: ["actions"]
---

# Create a GitHub-hosted runner for an enterprise

`POST /enterprises/{enterprise}/actions/hosted-runners`

Creates a GitHub-hosted runner for an enterprise.
OAuth tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint.

## Path parameters

- `enterprise` string, required

## Request body

- object
  - `name` string, required — Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.
  - `image` object, required — The image of runner. To list all available images, use `GET /actions/hosted-runners/images/github-owned` or `GET /actions/hosted-runners/images/partner`.
    - `id` string — The unique identifier of the runner image.
    - `source` 'github' | 'partner' | 'custom' — The source of the runner image.
    - `version` string, nullable — The version of the runner image to deploy. This is relevant only for runners using custom images.
  - `size` string, required — The machine size of the runner. To list available sizes, use `GET actions/hosted-runners/machine-sizes`
  - `runner_group_id` integer, required — The existing runner group to add this runner to.
  - `maximum_runners` integer — The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.
  - `enable_static_ip` boolean — Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits`
  - `image_gen` boolean — Whether this runner should be used to generate custom images.

## Response `201`

Response

- ActionsHostedRunner — A Github-hosted hosted runner.
  - `id` integer, required — The unique identifier of the hosted runner.
  - `name` string, required — The name of the hosted runner.
  - `runner_group_id` integer — The unique identifier of the group that the hosted runner belongs to.
  - `image_details` NullableActionsHostedRunnerPoolImage, nullable, required — Provides details of a hosted runner image
    - `id` string, required — The ID of the image. Use this ID for the `image` parameter when creating a new larger runner.
    - `size_gb` integer, required — Image size in GB.
    - `display_name` string, required — Display name for this image.
    - `source` 'github' | 'partner' | 'custom', required — The image provider.
    - `version` string — The image version of the hosted runner pool.
  - `machine_size_details` ActionsHostedRunnerMachineSpec, required — Provides details of a particular machine spec.
    - `id` string, required — The ID used for the `size` parameter when creating a new runner.
    - `cpu_cores` integer, required — The number of cores.
    - `memory_gb` integer, required — The available RAM for the machine spec.
    - `storage_gb` integer, required — The available SSD storage for the machine spec.
  - `status` 'Ready' | 'Provisioning' | 'Shutdown' | 'Deleting' | 'Stuck', required — The status of the runner.
  - `platform` string, required — The operating system of the image.
  - `maximum_runners` integer — The maximum amount of hosted runners. Runners will not scale automatically above this number. Use this setting to limit your cost.
  - `public_ip_enabled` boolean, required — Whether public IP is enabled for the hosted runners.
  - `public_ips` PublicIp[] — The public IP ranges when public IP is enabled for the hosted runners.
    - `enabled` boolean — Whether public IP is enabled.
    - `prefix` string — The prefix for the public IP.
    - `length` integer — The length of the IP prefix.
  - `last_active_on` string, date-time, nullable — The time at which the runner was last used, in ISO 8601 format.
  - `image_gen` boolean — Whether custom image generation is enabled for the hosted runners.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
