Skip to content

GitHub: Codespaces schemas

13 GitHub schemas with complete fields and constraints.

← Codespaces operations · All schemas

Check if permissions defined by a devcontainer have been accepted by the authenticated user — response body

FieldTypePresenceDescription and constraints
$objectRootPermission check result for a given devcontainer config.
acceptedbooleanRequired within parentWhether the user has accepted the permissions defined by the devcontainer config

Create a repository from an unpublished codespace — response body

FieldTypePresenceDescription and constraints
$objectRootA codespace.
billable_ownerModelRequired within parentExpand List users — response body — item
created_atstringRequired within parentFormat: date-time
devcontainer_pathJSONOptional
devcontainer_path (anyOf 1)stringAlternativePath to devcontainer.json from repo root used to create Codespace.
devcontainer_path (anyOf 2)nullAlternative
display_nameJSONOptional
display_name (anyOf 1)stringAlternativeDisplay name for this codespace.
display_name (anyOf 2)nullAlternative
environment_idJSONRequired within parent
environment_id (anyOf 1)stringAlternativeUUID identifying this codespace's environment.
environment_id (anyOf 2)nullAlternative
git_statusModelRequired within parentExpand Stop a codespace for an organization user — response body — git status
idJSONRequired within parent
id (anyOf 1)integerAlternativeFormat: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idle_timeout_minutesJSONRequired within parent
idle_timeout_minutes (anyOf 1)JSONAlternative
idle_timeout_minutes (anyOf 1) (anyOf 1)integerAlternativeThe number of minutes of inactivity after which this codespace will be automatically stopped.
idle_timeout_minutes (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idle_timeout_minutes (anyOf 2)nullAlternative
idle_timeout_noticeJSONOptional
idle_timeout_notice (anyOf 1)stringAlternativeText to show user when codespace idle timeout minutes has been overriden by an organization policy
idle_timeout_notice (anyOf 2)nullAlternative
last_used_atstringRequired within parentLast known time this codespace was started.
Format: date-time
locationstringRequired within parentThe initally assigned location of a new codespace.
Known values: EastUs, SouthEastAsia, WestEurope, WestUs2
machineModelRequired within parentExpand Stop a codespace for an organization user — response body — machine
machines_urlstringRequired within parentAPI URL to access available alternate machine types for this codespace.
Format: uri
namestringRequired within parentAutomatically generated name of this codespace.
ownerModelRequired within parentExpand List users — response body — item
pending_operationJSONOptional
pending_operation (anyOf 1)booleanAlternativeWhether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it.
pending_operation (anyOf 2)nullAlternative
pending_operation_disabled_reasonJSONOptional
pending_operation_disabled_reason (anyOf 1)stringAlternativeText to show user when codespace is disabled by a pending operation
pending_operation_disabled_reason (anyOf 2)nullAlternative
prebuildJSONRequired within parent
prebuild (anyOf 1)booleanAlternativeWhether the codespace was created from a prebuild.
prebuild (anyOf 2)nullAlternative
publish_urlJSONOptional
publish_url (anyOf 1)stringAlternativeAPI URL to publish this codespace to a new repository.
Format: uri
publish_url (anyOf 2)nullAlternative
pulls_urlJSONRequired within parent
pulls_url (anyOf 1)stringAlternativeAPI URL for the Pull Request associated with this codespace, if any.
Format: uri
pulls_url (anyOf 2)nullAlternative
recent_foldersarrayRequired within parent
recent_folders[]stringEach item
repositoryModelRequired within parentExpand Create a fork — response body
retention_expires_atJSONOptional
retention_expires_at (anyOf 1)stringAlternativeWhen a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at"
Format: date-time
retention_expires_at (anyOf 2)nullAlternative
retention_period_minutesJSONOptional
retention_period_minutes (anyOf 1)JSONAlternative
retention_period_minutes (anyOf 1) (anyOf 1)integerAlternativeDuration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days).
retention_period_minutes (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
retention_period_minutes (anyOf 2)nullAlternative
runtime_constraintsobjectOptional
runtime_constraints.allowed_port_privacy_settingsJSONOptional
runtime_constraints.allowed_port_privacy_settings (anyOf 1)arrayAlternativeThe privacy settings a user can select from when forwarding a port.
runtime_constraints.allowed_port_privacy_settings (anyOf 1)[]stringEach item
runtime_constraints.allowed_port_privacy_settings (anyOf 2)nullAlternative
start_urlstringRequired within parentAPI URL to start this codespace.
Format: uri
statestringRequired within parentState of this codespace.
Known values: Unknown, Created, Queued, Provisioning, Available, Awaiting, Unavailable, Deleted, Moved, Shutdown, Archived, Starting, ShuttingDown, Failed, Exporting, Updating, Rebuilding
stop_urlstringRequired within parentAPI URL to stop this codespace.
Format: uri
updated_atstringRequired within parentFormat: date-time
urlstringRequired within parentAPI URL for this codespace.
Format: uri
web_urlstringRequired within parentURL to access this codespace on the web.
Format: uri

Referenced models: Create a fork — response body, Stop a codespace for an organization user — response body — machine, List users — response body — item, Stop a codespace for an organization user — response body — git status

Get a repository public key — codespaces codespaces Get Repo Public Key — response body

FieldTypePresenceDescription and constraints
$objectRootThe public key used for setting Codespaces secrets.
created_atstringOptional
idJSONOptional
id (anyOf 1)integerAlternative
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
keystringRequired within parentThe Base64 encoded public key.
key_idstringRequired within parentThe identifier for the key.
titlestringOptional
urlstringOptional

Get a repository secret — codespaces codespaces Get Repo Secret — response body

FieldTypePresenceDescription and constraints
$objectRootSet repository secrets for GitHub Codespaces.
created_atstringRequired within parentFormat: date-time
namestringRequired within parentThe name of the secret.
updated_atstringRequired within parentFormat: date-time

Get a secret for the authenticated user — response body

FieldTypePresenceDescription and constraints
$objectRootSecrets for a GitHub Codespace.
created_atstringRequired within parentThe date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
namestringRequired within parentThe name of the secret
selected_repositories_urlstringRequired within parentThe API URL at which the list of repositories this secret is visible to can be retrieved
Format: uri
updated_atstringRequired within parentThe date and time at which the secret was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
visibilitystringRequired within parentThe type of repositories in the organization that the secret is visible to
Known values: all, private, selected

Get an organization secret — codespaces codespaces Get Org Secret — response body

FieldTypePresenceDescription and constraints
$objectRootSecrets for a GitHub Codespace.
created_atstringRequired within parentThe date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
namestringRequired within parentThe name of the secret
selected_repositories_urlstringOptionalThe API URL at which the list of repositories this secret is visible to can be retrieved
Format: uri
updated_atstringRequired within parentThe date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
Format: date-time
visibilitystringRequired within parentThe type of repositories in the organization that the secret is visible to
Known values: all, private, selected

Get details about a codespace export — response body

FieldTypePresenceDescription and constraints
$objectRootAn export of a codespace. Also, latest export details for a codespace can be fetched with id = latest
branchJSONOptional
branch (anyOf 1)stringAlternativeName of the exported branch
branch (anyOf 2)nullAlternative
completed_atJSONOptional
completed_at (anyOf 1)stringAlternativeCompletion time of the last export operation
Format: date-time
completed_at (anyOf 2)nullAlternative
export_urlstringOptionalUrl for fetching export details
html_urlJSONOptional
html_url (anyOf 1)stringAlternativeWeb url for the exported branch
html_url (anyOf 2)nullAlternative
idstringOptionalId for the export details
shaJSONOptional
sha (anyOf 1)stringAlternativeGit commit SHA of the exported branch
sha (anyOf 2)nullAlternative
stateJSONOptional
state (anyOf 1)stringAlternativeState of the latest export
state (anyOf 2)nullAlternative

Get public key for the authenticated user — response body

FieldTypePresenceDescription and constraints
$objectRootThe public key used for setting user Codespaces' Secrets.
keystringRequired within parentThe Base64 encoded public key.
key_idstringRequired within parentThe identifier for the key.

List machine types for a codespace — response body — machines item

FieldTypePresenceDescription and constraints
$objectRootA description of the machine powering a codespace.
cpusJSONRequired within parent
cpus (anyOf 1)integerAlternativeHow many cores are available to the codespace.
cpus (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
display_namestringRequired within parentThe display name of the machine includes cores, memory, and storage.
memory_in_bytesJSONRequired within parent
memory_in_bytes (anyOf 1)integerAlternativeHow much memory is available to the codespace.
memory_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringRequired within parentThe name of the machine.
operating_systemstringRequired within parentThe operating system of the machine.
prebuild_availabilityJSONRequired within parent
prebuild_availability (anyOf 1)stringAlternativeWhether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status.
Known values: none, ready, in_progress
prebuild_availability (anyOf 2)nullAlternative
storage_in_bytesJSONRequired within parent
storage_in_bytes (anyOf 1)integerAlternativeHow much storage is available to the codespace.
storage_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Stop a codespace for an organization user — response body

FieldTypePresenceDescription and constraints
$objectRootA codespace.
billable_ownerModelRequired within parentExpand List users — response body — item
created_atstringRequired within parentFormat: date-time
devcontainer_pathJSONOptional
devcontainer_path (anyOf 1)stringAlternativePath to devcontainer.json from repo root used to create Codespace.
devcontainer_path (anyOf 2)nullAlternative
display_nameJSONOptional
display_name (anyOf 1)stringAlternativeDisplay name for this codespace.
display_name (anyOf 2)nullAlternative
environment_idJSONRequired within parent
environment_id (anyOf 1)stringAlternativeUUID identifying this codespace's environment.
environment_id (anyOf 2)nullAlternative
git_statusModelRequired within parentExpand Stop a codespace for an organization user — response body — git status
idJSONRequired within parent
id (anyOf 1)integerAlternativeFormat: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idle_timeout_minutesJSONRequired within parent
idle_timeout_minutes (anyOf 1)JSONAlternative
idle_timeout_minutes (anyOf 1) (anyOf 1)integerAlternativeThe number of minutes of inactivity after which this codespace will be automatically stopped.
idle_timeout_minutes (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idle_timeout_minutes (anyOf 2)nullAlternative
idle_timeout_noticeJSONOptional
idle_timeout_notice (anyOf 1)stringAlternativeText to show user when codespace idle timeout minutes has been overriden by an organization policy
idle_timeout_notice (anyOf 2)nullAlternative
last_known_stop_noticeJSONOptional
last_known_stop_notice (anyOf 1)stringAlternativeThe text to display to a user when a codespace has been stopped for a potentially actionable reason.
last_known_stop_notice (anyOf 2)nullAlternative
last_used_atstringRequired within parentLast known time this codespace was started.
Format: date-time
locationstringRequired within parentThe initally assigned location of a new codespace.
Known values: EastUs, SouthEastAsia, WestEurope, WestUs2
machineModelRequired within parentExpand Stop a codespace for an organization user — response body — machine
machines_urlstringRequired within parentAPI URL to access available alternate machine types for this codespace.
Format: uri
namestringRequired within parentAutomatically generated name of this codespace.
ownerModelRequired within parentExpand List users — response body — item
pending_operationJSONOptional
pending_operation (anyOf 1)booleanAlternativeWhether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it.
pending_operation (anyOf 2)nullAlternative
pending_operation_disabled_reasonJSONOptional
pending_operation_disabled_reason (anyOf 1)stringAlternativeText to show user when codespace is disabled by a pending operation
pending_operation_disabled_reason (anyOf 2)nullAlternative
prebuildJSONRequired within parent
prebuild (anyOf 1)booleanAlternativeWhether the codespace was created from a prebuild.
prebuild (anyOf 2)nullAlternative
publish_urlJSONOptional
publish_url (anyOf 1)stringAlternativeAPI URL to publish this codespace to a new repository.
Format: uri
publish_url (anyOf 2)nullAlternative
pulls_urlJSONRequired within parent
pulls_url (anyOf 1)stringAlternativeAPI URL for the Pull Request associated with this codespace, if any.
Format: uri
pulls_url (anyOf 2)nullAlternative
recent_foldersarrayRequired within parent
recent_folders[]stringEach item
repositoryModelRequired within parentExpand Transfer a repository — response body
retention_expires_atJSONOptional
retention_expires_at (anyOf 1)stringAlternativeWhen a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at"
Format: date-time
retention_expires_at (anyOf 2)nullAlternative
retention_period_minutesJSONOptional
retention_period_minutes (anyOf 1)JSONAlternative
retention_period_minutes (anyOf 1) (anyOf 1)integerAlternativeDuration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days).
retention_period_minutes (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
retention_period_minutes (anyOf 2)nullAlternative
runtime_constraintsobjectOptional
runtime_constraints.allowed_port_privacy_settingsJSONOptional
runtime_constraints.allowed_port_privacy_settings (anyOf 1)arrayAlternativeThe privacy settings a user can select from when forwarding a port.
runtime_constraints.allowed_port_privacy_settings (anyOf 1)[]stringEach item
runtime_constraints.allowed_port_privacy_settings (anyOf 2)nullAlternative
start_urlstringRequired within parentAPI URL to start this codespace.
Format: uri
statestringRequired within parentState of this codespace.
Known values: Unknown, Created, Queued, Provisioning, Available, Awaiting, Unavailable, Deleted, Moved, Shutdown, Archived, Starting, ShuttingDown, Failed, Exporting, Updating, Rebuilding
stop_urlstringRequired within parentAPI URL to stop this codespace.
Format: uri
updated_atstringRequired within parentFormat: date-time
urlstringRequired within parentAPI URL for this codespace.
Format: uri
web_urlstringRequired within parentURL to access this codespace on the web.
Format: uri

Referenced models: Transfer a repository — response body, Stop a codespace for an organization user — response body — machine, List users — response body — item, Stop a codespace for an organization user — response body — git status

Stop a codespace for an organization user — response body — git status

FieldTypePresenceDescription and constraints
$objectRootDetails about the codespace's git repository.
aheadJSONOptional
ahead (anyOf 1)integerAlternativeThe number of commits the local repository is ahead of the remote.
ahead (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
behindJSONOptional
behind (anyOf 1)integerAlternativeThe number of commits the local repository is behind the remote.
behind (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
has_uncommitted_changesbooleanOptionalWhether the local repository has uncommitted changes.
has_unpushed_changesbooleanOptionalWhether the local repository has unpushed changes.
refstringOptionalThe current branch (or SHA if in detached HEAD state) of the local repository.

Stop a codespace for an organization user — response body — machine

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Stop a codespace for an organization user — response body — machine A description of the machine powering a codespace
$ (anyOf 2)nullAlternative

Referenced models: Stop a codespace for an organization user — response body — machine A description of the machine powering a codespace

Stop a codespace for an organization user — response body — machine A description of the machine powering a codespace

FieldTypePresenceDescription and constraints
$objectRootA description of the machine powering a codespace.
cpusJSONRequired within parent
cpus (anyOf 1)integerAlternativeHow many cores are available to the codespace.
cpus (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
display_namestringRequired within parentThe display name of the machine includes cores, memory, and storage.
memory_in_bytesJSONRequired within parent
memory_in_bytes (anyOf 1)integerAlternativeHow much memory is available to the codespace.
memory_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringRequired within parentThe name of the machine.
operating_systemstringRequired within parentThe operating system of the machine.
prebuild_availabilityJSONRequired within parent
prebuild_availability (anyOf 1)stringAlternativeWhether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status.
Known values: none, ready, in_progress
prebuild_availability (anyOf 2)nullAlternative
storage_in_bytesJSONRequired within parent
storage_in_bytes (anyOf 1)integerAlternativeHow much storage is available to the codespace.
storage_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.