Skip to main content

codespaces

Overview

Namecodespaces
TypeResource
Idgithub.codespaces.codespaces

Fields

NameDatatype
codespacesarray
total_countinteger

Methods

NameAccessible byRequired ParamsDescription
get_for_authenticated_userSELECTcodespace_nameGets information about a user's codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have read access to the codespaces repository permission to use this endpoint.
list_for_authenticated_userSELECTLists the authenticated user's codespaces.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have read access to the codespaces repository permission to use this endpoint.
list_in_repository_for_authenticated_userSELECTowner, repoLists the codespaces associated to a specified repository and the authenticated user.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have read access to the codespaces repository permission to use this endpoint.
create_for_authenticated_userINSERTCreates a new codespace, owned by the authenticated user.

This endpoint requires either a repository_id OR a pull_request but not both.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
delete_for_authenticated_userDELETEcodespace_nameDeletes a user's codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
create_with_pr_for_authenticated_userEXECowner, pull_number, repoCreates a codespace owned by the authenticated user for the specified pull request.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
create_with_repo_for_authenticated_userEXECowner, repoCreates a codespace owned by the authenticated user in the specified repository.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
export_for_authenticated_userEXECcodespace_nameTriggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.

If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead.

You must authenticate using a personal access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint.
list_devcontainers_in_repository_for_authenticated_userEXECowner, repoLists the devcontainer.json files associated with a specified repository and the authenticated user. These files
specify launchpoint configurations for codespaces created within the repository.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have read access to the codespaces_metadata repository permission to use this endpoint.
pre_flight_with_repo_for_authenticated_userEXECowner, repoGets the default attributes for codespaces created by the user with the repository.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
publish_for_authenticated_userEXECcodespace_namePublishes an unpublished codespace, creating a new repository and assigning it to the codespace.

The codespace's token is granted write permissions to the repository, allowing the user to push their changes.

This will fail for a codespace that is already published, meaning it has an associated repository.

You must authenticate using a personal access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
start_for_authenticated_userEXECcodespace_nameStarts a user's codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint.
stop_for_authenticated_userEXECcodespace_nameStops a user's codespace.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint.
update_for_authenticated_userEXECcodespace_nameUpdates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.

If you specify a new machine type it will be applied the next time your codespace is started.

You must authenticate using an access token with the codespace scope to use this endpoint.

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.