GitHub Codespaces API

Endpoints to manage Codespaces using the REST API.

GitHub OpenAPI

Operations 48

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

8 of 48 operations are conformant: apis.io called them with no credentials and the responses matched this contract. Checked 2026-11-12. how this works · status file

GET /orgs/{org}/codespaces List codespaces in an organization · List codespaces for the organization conformant #
Ask an LLM
“Which codespaces does my organization have provisioned?”
“Can I page through all codespaces across every repo in an org?”
Tell an agent
List codespaces for organization {org}.
Show page {page} of codespaces in {org}, {per_page} per page.
PUT /orgs/{org}/codespaces/access Set codespaces access for an organization · Manage access control for organization codespaces #
Ask an LLM
“How do I let only selected members use codespaces in my organization?”
“Can I turn off codespaces for everyone in an organization?”
Tell an agent
Set codespaces visibility in {org} to {visibility}.
Make codespaces in {org} available only to {selected_usernames}.
POST /orgs/{org}/codespaces/access/selected_users Grant codespaces billing to selected users · Add users to Codespaces access for an organization #
Ask an LLM
“How do I bill codespaces for specific organization members?”
“Can I add users to the codespaces billing list?”
Tell an agent
Add {selected_usernames} to codespaces billing in {org}.
Grant codespaces access to {selected_usernames} in organization {org}.
DELETE /orgs/{org}/codespaces/access/selected_users Remove users from codespaces billing · Remove users from Codespaces access for an organization #
Ask an LLM
“How do I stop billing codespaces for certain users?”
“Can I take users off the codespaces billing list?”
Tell an agent destructive · confirm first
Remove {selected_usernames} from codespaces billing in {org}.
Stop billing codespaces for {selected_usernames} in organization {org}.
GET /orgs/{org}/codespaces/secrets List organization codespaces secrets · List organization secrets conformant #
Ask an LLM
“What codespaces secrets are defined at the organization level?”
“Can I see which repositories a codespaces secret is visible to?”
Tell an agent
List organization codespaces secrets in {org}.
Show codespaces secrets in {org} with visibility {per_page} per page.
GET /orgs/{org}/codespaces/secrets/public-key Get the organization codespaces public key · Get an organization public key conformant #
Ask an LLM
“Where do I get the public key to encrypt a codespaces secret?”
“What key do I use to encrypt a codespaces secret for my organization?”
Tell an agent
Get the codespaces public key for organization {org}.
Fetch the public key used to encrypt codespaces secrets in {org}.
GET /orgs/{org}/codespaces/secrets/{secret_name} Get an organization codespaces secret · Get an organization secret #
Ask an LLM
“Can I read an organization codespaces secret without its value?”
“What visibility does a codespaces secret have?”
Tell an agent
Get codespaces secret {secret_name} in organization {org}.
Show the visibility of codespaces secret {secret_name} in {org}.
PUT /orgs/{org}/codespaces/secrets/{secret_name} Create or update an organization codespaces secret · Create or update an organization secret #
Ask an LLM
“How do I store an encrypted secret for codespaces in my organization?”
“Can I limit which repositories see a codespaces secret?”
Tell an agent
Create codespaces secret {secret_name} in {org} with visibility {visibility}.
Set encrypted value {encrypted_value} for codespaces secret {secret_name} in {org}, visibility {visibility}.
DELETE /orgs/{org}/codespaces/secrets/{secret_name} Delete an organization codespaces secret · Delete an organization secret #
Ask an LLM
“How do I remove a codespaces secret from my organization?”
“Can I delete a codespaces secret by name?”
Tell an agent destructive · confirm first
Delete codespaces secret {secret_name} from organization {org}.
Remove the codespaces secret {secret_name} in {org}.
GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories List repositories with a codespaces secret · List selected repositories for an organization secret #
Ask an LLM
“Which repositories have access to a codespaces secret?”
“Can I see the selected-repository list for a codespaces secret?”
Tell an agent
List repositories with codespaces secret {secret_name} in {org}.
Show the selected-repository list for codespaces secret {secret_name} in {org}.
PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories Replace repositories with a codespaces secret · Set selected repositories for an organization secret #
Ask an LLM
“How do I replace the repository list for a codespaces secret?”
“Can I set the selected repositories for a codespaces secret?”
Tell an agent
Set codespaces secret {secret_name} in {org} to only selected repositories {selected_repository_ids}.
Replace the repository list for codespaces secret {secret_name} in {org} with {selected_repository_ids}.
PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} Add a repository to a codespaces secret · Add selected repository to an organization secret #
Ask an LLM
“How do I let one more repository use a codespaces secret?”
“Can I add a single repository to a codespaces secret?”
Tell an agent
Add repository {repository_id} to codespaces secret {secret_name} in {org}.
Grant codespaces secret {secret_name} in {org} to repository {repository_id}.
DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} Remove a repository from a codespaces secret · Remove selected repository from an organization secret #
Ask an LLM
“How do I revoke a repository's access to a codespaces secret?”
“Can I take one repository off a codespaces secret?”
Tell an agent destructive · confirm first
Remove repository {repository_id} from codespaces secret {secret_name} in {org}.
Revoke codespaces secret {secret_name} in {org} for repository {repository_id}.
GET /orgs/{org}/members/{username}/codespaces List a user's codespaces in an organization · List codespaces for a user in organization conformant #
Ask an LLM
“Which codespaces does a specific organization member have?”
“Can I list one user's codespaces across the organization?”
Tell an agent
List codespaces for {username} in organization {org}.
Show organization {org} codespaces belonging to {username}.
DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name} Delete a user's codespace from an organization · Delete a codespace from the organization #
Ask an LLM
“How do I delete a user's codespace from my organization?”
“Can I remove a codespace a member owns in the organization?”
Tell an agent destructive · confirm first
Delete codespace {codespace_name} from {username} in organization {org}.
Remove organization {org} codespace {codespace_name} owned by {username}.
POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop Stop a user's codespace in an organization · Stop a codespace for an organization user #
Ask an LLM
“How do I stop a user's codespace in my organization?”
“Can I stop a codespace for an organization member?”
Tell an agent
Stop codespace {codespace_name} for {username} in organization {org}.
Stop the organization {org} codespace {codespace_name} belonging to {username}.
GET /repos/{owner}/{repo}/codespaces List codespaces in a repository · List codespaces in a repository for the authenticated user #
Ask an LLM
“Which codespaces exist in a repository I own?”
“Can I list the codespaces in a repository for the authenticated user?”
Tell an agent
List codespaces in repository {owner}/{repo}.
Show codespaces in {owner}/{repo} for the authenticated user.
POST /repos/{owner}/{repo}/codespaces Create a codespace in a repository · Create a codespace in a repository #
Ask an LLM
“How do I create a codespace in a repository I own?”
“Can I choose the machine type and idle timeout when creating a codespace?”
Tell an agent
Create a codespace in repository {owner}/{repo}.
Create a codespace in {owner}/{repo} on branch {ref} with machine {machine}.
GET /repos/{owner}/{repo}/codespaces/devcontainers List devcontainer configurations in a repository · List devcontainer configurations in a repository for the authenticated user conformant #
Ask an LLM
“Which devcontainer.json files exist in a repository?”
“Can I list the devcontainer configurations for a repository?”
Tell an agent
List devcontainer configurations in repository {owner}/{repo}.
Show the devcontainer.json files in {owner}/{repo} for the authenticated user.
GET /repos/{owner}/{repo}/codespaces/machines List available machine types for a repository · List available machine types for a repository conformant #
Ask an LLM
“What machine types are available for a repository?”
“Can I check machine availability for a branch before creating a codespace?”
Tell an agent
List available machine types for repository {owner}/{repo}.
Show machine types for {owner}/{repo} on branch {ref}.
GET /repos/{owner}/{repo}/codespaces/new Get default codespace attributes for a repo · Get default attributes for a codespace #
Ask an LLM
“What default attributes does a codespace get in a repository?”
“Can I check codespace defaults for a branch before creating one?”
Tell an agent
Get the default codespace attributes for {owner}/{repo}.
Show codespace defaults for {owner}/{repo} on branch {ref}.
GET /repos/{owner}/{repo}/codespaces/permissions_check Check if devcontainer permissions are accepted · Check if permissions defined by a devcontainer have been accepted by the… #
Ask an LLM
“Has the user accepted the permissions a devcontainer wants?”
“Can I verify a devcontainer's permissions before creating a codespace?”
Tell an agent
Check whether devcontainer permissions in {owner}/{repo} on {ref} are accepted.
Verify the permissions of {devcontainer_path} in {owner}/{repo} at {ref}.
GET /repos/{owner}/{repo}/codespaces/secrets List repository codespace secrets · List repository secrets conformant #
Ask an LLM
“Which secrets are available to codespaces in a repository?”
“Can I see a repository's codespace secrets without their values?”
Tell an agent
List the codespace secrets in {owner}/{repo}.
Show repository codespace secrets for {owner}/{repo} on page {page}.
GET /repos/{owner}/{repo}/codespaces/secrets/public-key Get the public key for codespaces secrets · Get a repository public key conformant #
Ask an LLM
“Where do I get the public key to encrypt a codespace secret?”
“How do I decrypt a codespace secret with the public key?”
Tell an agent
Get the codespace public key for repo {owner}/{repo}.
Fetch the public key so I can encrypt a secret for {owner}/{repo}.
GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name} Get a repository codespace secret · Get a repository secret #
Ask an LLM
“Can I read a single codespace secret in a repository?”
“What is the encrypted value of a repository codespace secret?”
Tell an agent
Get the codespace secret {secret_name} in {owner}/{repo}.
Show the encrypted value of {secret_name} in {owner}/{repo}.
PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} Create or update a repository codespace secret · Create or update a repository secret #
Ask an LLM
“How do I set a codespace secret in a repository?”
“Can I encrypt a secret with a key and save it for a repo's codespaces?”
Tell an agent
Create codespace secret {secret_name} in {owner}/{repo} with value {encrypted_value} and key {key_id}.
Set the {secret_name} codespace secret in {owner}/{repo}.
DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name} Delete a repository codespace secret · Delete a repository secret #
Ask an LLM
“Can I remove a codespace secret from a repository?”
“What happens to codespaces when a repo codespace secret is deleted?”
Tell an agent destructive · confirm first
Delete the codespace secret {secret_name} from {owner}/{repo}.
Remove {secret_name} as a codespace secret in {owner}/{repo}.
POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces Create a codespace from a pull request · Create a codespace from a pull request #
Ask an LLM
“Can I spin up a codespace from a pull request?”
“Is it possible to choose a location when creating a codespace on a PR?”
Tell an agent
Create a codespace for pull request {pull_number} in {owner}/{repo}.
Create a codespace for {pull_number} on {owner}/{repo} in location {location}.
GET /user/codespaces List my codespaces · List codespaces for the authenticated user #
Ask an LLM
“Which codespaces do I own?”
“Can I list only the codespaces in one repository?”
Tell an agent
List my codespaces.
Show my codespaces in repository {repository_id}.
POST /user/codespaces Create a codespace for the authenticated user · Create a codespace for the authenticated user #
Ask an LLM
“How do I create a new codespace for myself?”
“Can I create a codespace from a repository or a pull request?”
Tell an agent
Create a codespace for the authenticated user.
Create a codespace for me from a repository or pull request.
GET /user/codespaces/secrets List my codespace secrets · List secrets for the authenticated user #
Ask an LLM
“Which codespace secrets are available to my codespaces?”
“Can I see my user-level codespace secrets without their values?”
Tell an agent
List my codespace secrets.
Show my codespace secrets on page {page}.
GET /user/codespaces/secrets/public-key Get my codespace public key · Get public key for the authenticated user #
Ask an LLM
“Where do I get the public key to encrypt a codespace secret for my codespaces?”
“What public key do I use to encrypt a codespace secret?”
Tell an agent
Get my codespace public key.
Fetch the public key for encrypting codespace secrets.
GET /user/codespaces/secrets/{secret_name} Get a codespace secret for the authenticated user · Get a secret for the authenticated user #
Ask an LLM
“Can I read a single codespace secret I own?”
“What is the encrypted value of my codespace secret?”
Tell an agent
Get my codespace secret {secret_name}.
Show the encrypted value of codespace secret {secret_name}.
PUT /user/codespaces/secrets/{secret_name} Create or update a codespace secret · Create or update a secret for the authenticated user #
Ask an LLM
“How do I store a secret for my codespaces?”
“What do I need to encrypt a codespace secret?”
Tell an agent
Create codespace secret {secret_name} with values {encrypted_value} and key {key_id}.
Store codespace secret {secret_name} using key {key_id}.
DELETE /user/codespaces/secrets/{secret_name} Delete a codespace secret for the user · Delete a secret for the authenticated user #
Ask an LLM
“Can I remove a codespace secret from my codespaces?”
“What happens to codespaces when my codespace secret is deleted?”
Tell an agent destructive · confirm first
Delete my codespace secret {secret_name}.
Remove codespace secret {secret_name} from my codespaces.
GET /user/codespaces/secrets/{secret_name}/repositories List repositories using a user codespace secret · List selected repositories for a user secret #
Ask an LLM
“Which repositories use a particular codespace secret of mine?”
“Can I see the selected repositories for a user codespace secret?”
Tell an agent
List the repositories using my codespace secret {secret_name}.
Show which repositories have access to codespace secret {secret_name}.
PUT /user/codespaces/secrets/{secret_name}/repositories Set repositories using a user codespace secret · Set selected repositories for a user secret #
Ask an LLM
“How do I choose which repositories can use a codespace secret of mine?”
“Can I replace the selected repositories for a user codespace secret?”
Tell an agent
Set the repositories using my codespace secret {secret_name} to {selected_repository_ids}.
Replace the selected repositories for codespace secret {secret_name}.
PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} Add a repository to a user codespace secret · Add a selected repository to a user secret #
Ask an LLM
“Can I grant one more repository access to a codespace secret of mine?”
“How do I add a single repository to a user codespace secret?”
Tell an agent
Add repository {repository_id} to my codespace secret {secret_name}.
Grant codespace secret {secret_name} to repository {repository_id}.
DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} Remove a repository from a user codespace secret · Remove a selected repository from a user secret #
Ask an LLM
“Can I revoke a repository's access to a codespace secret of mine?”
“How do I remove one repository from a user codespace secret?”
Tell an agent destructive · confirm first
Remove repository {repository_id} from my codespace secret {secret_name}.
Revoke codespace secret {secret_name} from repository {repository_id}.
GET /user/codespaces/{codespace_name} Get one of my codespaces · Get a codespace for the authenticated user #
Ask an LLM
“What are the details of a codespace I own?”
“Can I look up a single codespace by name?”
Tell an agent
Get my codespace {codespace_name}.
Show the details of codespace {codespace_name}.
PATCH /user/codespaces/{codespace_name} Change a codespace's machine type or name · Update a codespace for the authenticated user #
Ask an LLM
“Can I change the machine type my codespace runs on?”
“How do I rename a codespace?”
Tell an agent
Change codespace {codespace_name} to machine type {machine}.
Rename codespace {codespace_name} to {display_name}.
DELETE /user/codespaces/{codespace_name} Delete a codespace · Delete a codespace for the authenticated user #
Ask an LLM
“How do I delete a codespace I no longer use?”
“Can I remove a codespace by name?”
Tell an agent destructive · confirm first
Delete codespace {codespace_name}.
Remove the codespace {codespace_name} I stopped.
POST /user/codespaces/{codespace_name}/exports Export a codespace · Export a codespace for the authenticated user #
Ask an LLM
“How do I export my codespace to a repository?”
“Where do I get the export URL for a codespace?”
Tell an agent
Export codespace {codespace_name}.
Start an export of codespace {codespace_name} and show the export ID.
GET /user/codespaces/{codespace_name}/exports/{export_id} Check a codespace export · Get details about a codespace export #
Ask an LLM
“Has my codespace export finished?”
“What's the status of a codespace export?”
Tell an agent
Get export {export_id} of codespace {codespace_name}.
Check the status of codespace {codespace_name} export {export_id}.
GET /user/codespaces/{codespace_name}/machines List machine types a codespace can use · List machine types for a codespace #
Ask an LLM
“Which machine types can my codespace run on?”
“What hardware options exist for a codespace?”
Tell an agent
List machine types for codespace {codespace_name}.
Show the hardware options codespace {codespace_name} can use.
POST /user/codespaces/{codespace_name}/publish Publish an unpublished codespace as a repository · Create a repository from an unpublished codespace #
Ask an LLM
“How do I turn my unpublished codespace into a repository?”
“Can I publish a codespace as a private repository?”
Tell an agent
Publish codespace {codespace_name} as a repository.
Publish codespace {codespace_name} as a private repository named {name}.
POST /user/codespaces/{codespace_name}/start Start a codespace · Start a codespace for the authenticated user #
Ask an LLM
“How do I start a codespace I stopped?”
“Can I bring a codespace back online?”
Tell an agent
Start codespace {codespace_name}.
Bring codespace {codespace_name} back online.
POST /user/codespaces/{codespace_name}/stop Stop a codespace · Stop a codespace for the authenticated user #
Ask an LLM
“How do I stop a codespace to save resources?”
“Can I pause a codespace temporarily?”
Tell an agent
Stop codespace {codespace_name}.
Pause codespace {codespace_name} until I start it again.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations
📖
Documentation
https://docs.github.com/en/rest/codespaces

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/github:github-codespaces-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

github-codespaces-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: GitHub v3 REST Codespaces API
  description: GitHub's v3 REST API.
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: api.github.com
servers:
- url: https://api.github.com
tags:


# --- truncated at 32 KB (298 KB total) ---
# Full source: https://artifacts.apis.io/github/openapi/github-codespaces-api-openapi.yml