# GitHub Enterprise Codespaces API

**Canonical:** https://apis.io/apis/github-enterprise/github-enterprise-codespaces-api/  
**Provider:** GitHub Enterprise — https://apis.io/providers/github-enterprise/  
**Base URL:** https://api.github.com  
**Documentation:** https://docs.github.com/en/enterprise-cloud@latest/rest

GitHub Enterprise Codespaces API is one of 58 APIs that [GitHub Enterprise](https://apis.io/providers/github-enterprise/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. This API exposes 8 JSON Schema definitions. Tagged areas include codespaces. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, rate-limit docs, authentication docs, and 8 JSON Schemas.

Endpoints to manage Codespaces using the REST API.

## Operations (48)

| Method | Path | Summary |
|---|---|---|
| GET | `/orgs/{org}/codespaces` | List codespaces for the organization |
| PUT | `/orgs/{org}/codespaces/access` | Manage access control for organization codespaces |
| POST | `/orgs/{org}/codespaces/access/selected_users` | Add users to Codespaces access for an organization |
| DELETE | `/orgs/{org}/codespaces/access/selected_users` | Remove users from Codespaces access for an organization |
| GET | `/orgs/{org}/codespaces/secrets` | List organization secrets |
| GET | `/orgs/{org}/codespaces/secrets/public-key` | Get an organization public key |
| GET | `/orgs/{org}/codespaces/secrets/{secret_name}` | Get an organization secret |
| PUT | `/orgs/{org}/codespaces/secrets/{secret_name}` | Create or update an organization secret |
| DELETE | `/orgs/{org}/codespaces/secrets/{secret_name}` | Delete an organization secret |
| GET | `/orgs/{org}/codespaces/secrets/{secret_name}/repositories` | List selected repositories for an organization secret |
| PUT | `/orgs/{org}/codespaces/secrets/{secret_name}/repositories` | Set selected repositories for an organization secret |
| PUT | `/orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}` | Add selected repository to an organization secret |
| DELETE | `/orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}` | Remove selected repository from an organization secret |
| GET | `/orgs/{org}/members/{username}/codespaces` | List codespaces for a user in organization |
| DELETE | `/orgs/{org}/members/{username}/codespaces/{codespace_name}` | Delete a codespace from the organization |
| POST | `/orgs/{org}/members/{username}/codespaces/{codespace_name}/stop` | Stop a codespace for an organization user |
| GET | `/repos/{owner}/{repo}/codespaces` | List codespaces in a repository for the authenticated user |
| POST | `/repos/{owner}/{repo}/codespaces` | Create a codespace in a repository |
| GET | `/repos/{owner}/{repo}/codespaces/devcontainers` | List devcontainer configurations in a repository for the authenticated user |
| GET | `/repos/{owner}/{repo}/codespaces/machines` | List available machine types for a repository |
| GET | `/repos/{owner}/{repo}/codespaces/new` | Get default attributes for a codespace |
| GET | `/repos/{owner}/{repo}/codespaces/permissions_check` | Check if permissions defined by a devcontainer have been accepted by the… |
| GET | `/repos/{owner}/{repo}/codespaces/secrets` | List repository secrets |
| GET | `/repos/{owner}/{repo}/codespaces/secrets/public-key` | Get a repository public key |
| GET | `/repos/{owner}/{repo}/codespaces/secrets/{secret_name}` | Get a repository secret |
| PUT | `/repos/{owner}/{repo}/codespaces/secrets/{secret_name}` | Create or update a repository secret |
| DELETE | `/repos/{owner}/{repo}/codespaces/secrets/{secret_name}` | Delete a repository secret |
| POST | `/repos/{owner}/{repo}/pulls/{pull_number}/codespaces` | Create a codespace from a pull request |
| GET | `/user/codespaces` | List codespaces for the authenticated user |
| POST | `/user/codespaces` | Create a codespace for the authenticated user |
| GET | `/user/codespaces/secrets` | List secrets for the authenticated user |
| GET | `/user/codespaces/secrets/public-key` | Get public key for the authenticated user |
| GET | `/user/codespaces/secrets/{secret_name}` | Get a secret for the authenticated user |
| PUT | `/user/codespaces/secrets/{secret_name}` | Create or update a secret for the authenticated user |
| DELETE | `/user/codespaces/secrets/{secret_name}` | Delete a secret for the authenticated user |
| GET | `/user/codespaces/secrets/{secret_name}/repositories` | List selected repositories for a user secret |
| PUT | `/user/codespaces/secrets/{secret_name}/repositories` | Set selected repositories for a user secret |
| PUT | `/user/codespaces/secrets/{secret_name}/repositories/{repository_id}` | Add a selected repository to a user secret |
| DELETE | `/user/codespaces/secrets/{secret_name}/repositories/{repository_id}` | Remove a selected repository from a user secret |
| GET | `/user/codespaces/{codespace_name}` | Get a codespace for the authenticated user |
| PATCH | `/user/codespaces/{codespace_name}` | Update a codespace for the authenticated user |
| DELETE | `/user/codespaces/{codespace_name}` | Delete a codespace for the authenticated user |
| POST | `/user/codespaces/{codespace_name}/exports` | Export a codespace for the authenticated user |
| GET | `/user/codespaces/{codespace_name}/exports/{export_id}` | Get details about a codespace export |
| GET | `/user/codespaces/{codespace_name}/machines` | List machine types for a codespace |
| POST | `/user/codespaces/{codespace_name}/publish` | Create a repository from an unpublished codespace |
| POST | `/user/codespaces/{codespace_name}/start` | Start a codespace for the authenticated user |
| POST | `/user/codespaces/{codespace_name}/stop` | Stop a codespace for the authenticated user |

## Machine-readable artifacts (16)

- **OpenAPI** — https://artifacts.apis.io/github-enterprise/openapi/github-enterprise-codespaces-api-openapi.yml
- **Documentation** — https://docs.github.com/en/enterprise-cloud@latest/rest
- **RateLimits** — https://docs.github.com/en/enterprise-cloud@latest/rest/using-the-rest-api/rate-limits-for-the-rest-api
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-repository-schema.json
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-full-repository-schema.json
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-app-permissions-schema.json
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-team-repository-schema.json
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-organization-full-schema.json
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-minimal-repository-schema.json
- **Authentication** — https://docs.github.com/en/enterprise-cloud@latest/rest/overview/authenticating-to-the-rest-api
- **Documentation** — https://docs.github.com/en/enterprise-cloud@latest/graphql
- **GraphQL** — https://artifacts.apis.io/github-enterprise/graphql/github-enterprise-graphql.md
- **Documentation** — https://docs.github.com/en/enterprise-server@latest/rest
- **Documentation** — https://docs.github.com/en/enterprise-server@latest/graphql
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-organization-schema.json
- **JSONSchema** — https://artifacts.apis.io/github-enterprise/json-schema/github-enterprise-pull-request-schema.json

## Other GitHub Enterprise APIs (12)

- [GitHub Enterprise Cloud GraphQL API](https://apis.io/apis/github-enterprise/github-enterprise-graphql-api/)
- [GitHub MCP Server](https://apis.io/apis/github-enterprise/github-mcp-server/)
- [GitHub Enterprise Actions API](https://apis.io/apis/github-enterprise/github-enterprise-actions-api/)
- [GitHub Enterprise Code Scanning API](https://apis.io/apis/github-enterprise/github-enterprise-code-scanning-api/)
- [GitHub Enterprise Admin API](https://apis.io/apis/github-enterprise/github-enterprise-enterprise-admin-api/)
- [GitHub Enterprise Issues API](https://apis.io/apis/github-enterprise/github-enterprise-issues-api/)
- [GitHub Enterprise SCIM API](https://apis.io/apis/github-enterprise/github-enterprise-scim-api/)
- [GitHub Enterprise Users API](https://apis.io/apis/github-enterprise/github-enterprise-users-api/)
- [GitHub Enterprise Activity API](https://apis.io/apis/github-enterprise/github-enterprise-activity-api/)
- [GitHub Enterprise Agent Automations API](https://apis.io/apis/github-enterprise/github-enterprise-agent-automations-api/)
- [GitHub Enterprise Agent Merge API](https://apis.io/apis/github-enterprise/github-enterprise-agent-merge-api/)
- [GitHub Enterprise Agent Tasks API](https://apis.io/apis/github-enterprise/github-enterprise-agent-tasks-api/)

## Tags

codespaces

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/github-enterprise/github-enterprise-codespaces-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/github-enterprise/.
