REST API endpoints for Codespaces machines

Use the REST API to manage availability of machine types for a codespace.

About Codespaces machines

You can determine which machine types are available to create a codespace, either on a given repository or as an authenticated user. For more information, see Changing the machine type for your codespace.

You can also use this information when changing the machine of an existing codespace by updating its machine property. The machine update will take place the next time the codespace is restarted. For more information, see Changing the machine type for your codespace.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List available machine types for a repository

GET /repos/{owner}/{repo}/codespaces/machines

List the machine types available for a given repository based on its configuration.
OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/codespaces/machines

Response schema (Status: 200):

List machine types for a codespace

GET /user/codespaces/{codespace_name}/machines

List the machine types a codespace can transition to use.
OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/codespaces/CODESPACE_NAME/machines

Response schema (Status: 200):

Same response schema as List available machine types for a repository.