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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Permission check result for a given devcontainer config. |
accepted | boolean | Required within parent | Whether the user has accepted the permissions defined by the devcontainer config |
Create a repository from an unpublished codespace — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A codespace. |
billable_owner | Model | Required within parent | Expand List users — response body — item |
created_at | string | Required within parent | Format: date-time |
devcontainer_path | JSON | Optional | |
devcontainer_path (anyOf 1) | string | Alternative | Path to devcontainer.json from repo root used to create Codespace. |
devcontainer_path (anyOf 2) | null | Alternative | |
display_name | JSON | Optional | |
display_name (anyOf 1) | string | Alternative | Display name for this codespace. |
display_name (anyOf 2) | null | Alternative | |
environment_id | JSON | Required within parent | |
environment_id (anyOf 1) | string | Alternative | UUID identifying this codespace's environment. |
environment_id (anyOf 2) | null | Alternative | |
git_status | Model | Required within parent | Expand Stop a codespace for an organization user — response body — git status |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | Format: int64 |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
idle_timeout_minutes | JSON | Required within parent | |
idle_timeout_minutes (anyOf 1) | JSON | Alternative | |
idle_timeout_minutes (anyOf 1) (anyOf 1) | integer | Alternative | The number of minutes of inactivity after which this codespace will be automatically stopped. |
idle_timeout_minutes (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
idle_timeout_minutes (anyOf 2) | null | Alternative | |
idle_timeout_notice | JSON | Optional | |
idle_timeout_notice (anyOf 1) | string | Alternative | Text to show user when codespace idle timeout minutes has been overriden by an organization policy |
idle_timeout_notice (anyOf 2) | null | Alternative | |
last_used_at | string | Required within parent | Last known time this codespace was started. Format: date-time |
location | string | Required within parent | The initally assigned location of a new codespace. Known values: EastUs, SouthEastAsia, WestEurope, WestUs2 |
machine | Model | Required within parent | Expand Stop a codespace for an organization user — response body — machine |
machines_url | string | Required within parent | API URL to access available alternate machine types for this codespace. Format: uri |
name | string | Required within parent | Automatically generated name of this codespace. |
owner | Model | Required within parent | Expand List users — response body — item |
pending_operation | JSON | Optional | |
pending_operation (anyOf 1) | boolean | Alternative | Whether 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) | null | Alternative | |
pending_operation_disabled_reason | JSON | Optional | |
pending_operation_disabled_reason (anyOf 1) | string | Alternative | Text to show user when codespace is disabled by a pending operation |
pending_operation_disabled_reason (anyOf 2) | null | Alternative | |
prebuild | JSON | Required within parent | |
prebuild (anyOf 1) | boolean | Alternative | Whether the codespace was created from a prebuild. |
prebuild (anyOf 2) | null | Alternative | |
publish_url | JSON | Optional | |
publish_url (anyOf 1) | string | Alternative | API URL to publish this codespace to a new repository. Format: uri |
publish_url (anyOf 2) | null | Alternative | |
pulls_url | JSON | Required within parent | |
pulls_url (anyOf 1) | string | Alternative | API URL for the Pull Request associated with this codespace, if any. Format: uri |
pulls_url (anyOf 2) | null | Alternative | |
recent_folders | array | Required within parent | |
recent_folders[] | string | Each item | |
repository | Model | Required within parent | Expand Create a fork — response body |
retention_expires_at | JSON | Optional | |
retention_expires_at (anyOf 1) | string | Alternative | When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" Format: date-time |
retention_expires_at (anyOf 2) | null | Alternative | |
retention_period_minutes | JSON | Optional | |
retention_period_minutes (anyOf 1) | JSON | Alternative | |
retention_period_minutes (anyOf 1) (anyOf 1) | integer | Alternative | Duration 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) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
retention_period_minutes (anyOf 2) | null | Alternative | |
runtime_constraints | object | Optional | |
runtime_constraints.allowed_port_privacy_settings | JSON | Optional | |
runtime_constraints.allowed_port_privacy_settings (anyOf 1) | array | Alternative | The privacy settings a user can select from when forwarding a port. |
runtime_constraints.allowed_port_privacy_settings (anyOf 1)[] | string | Each item | |
runtime_constraints.allowed_port_privacy_settings (anyOf 2) | null | Alternative | |
start_url | string | Required within parent | API URL to start this codespace. Format: uri |
state | string | Required within parent | State of this codespace. Known values: Unknown, Created, Queued, Provisioning, Available, Awaiting, Unavailable, Deleted, Moved, Shutdown, Archived, Starting, ShuttingDown, Failed, Exporting, Updating, Rebuilding |
stop_url | string | Required within parent | API URL to stop this codespace. Format: uri |
updated_at | string | Required within parent | Format: date-time |
url | string | Required within parent | API URL for this codespace. Format: uri |
web_url | string | Required within parent | URL 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The public key used for setting Codespaces secrets. |
created_at | string | Optional | |
id | JSON | Optional | |
id (anyOf 1) | integer | Alternative | |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
key | string | Required within parent | The Base64 encoded public key. |
key_id | string | Required within parent | The identifier for the key. |
title | string | Optional | |
url | string | Optional |
Get a repository secret — codespaces codespaces Get Repo Secret — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Set repository secrets for GitHub Codespaces. |
created_at | string | Required within parent | Format: date-time |
name | string | Required within parent | The name of the secret. |
updated_at | string | Required within parent | Format: date-time |
Get a secret for the authenticated user — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Secrets for a GitHub Codespace. |
created_at | string | Required within parent | The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Format: date-time |
name | string | Required within parent | The name of the secret |
selected_repositories_url | string | Required within parent | The API URL at which the list of repositories this secret is visible to can be retrieved Format: uri |
updated_at | string | Required within parent | The date and time at which the secret was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Format: date-time |
visibility | string | Required within parent | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Secrets for a GitHub Codespace. |
created_at | string | Required within parent | The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Format: date-time |
name | string | Required within parent | The name of the secret |
selected_repositories_url | string | Optional | The API URL at which the list of repositories this secret is visible to can be retrieved Format: uri |
updated_at | string | Required within parent | The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Format: date-time |
visibility | string | Required within parent | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An export of a codespace. Also, latest export details for a codespace can be fetched with id = latest |
branch | JSON | Optional | |
branch (anyOf 1) | string | Alternative | Name of the exported branch |
branch (anyOf 2) | null | Alternative | |
completed_at | JSON | Optional | |
completed_at (anyOf 1) | string | Alternative | Completion time of the last export operation Format: date-time |
completed_at (anyOf 2) | null | Alternative | |
export_url | string | Optional | Url for fetching export details |
html_url | JSON | Optional | |
html_url (anyOf 1) | string | Alternative | Web url for the exported branch |
html_url (anyOf 2) | null | Alternative | |
id | string | Optional | Id for the export details |
sha | JSON | Optional | |
sha (anyOf 1) | string | Alternative | Git commit SHA of the exported branch |
sha (anyOf 2) | null | Alternative | |
state | JSON | Optional | |
state (anyOf 1) | string | Alternative | State of the latest export |
state (anyOf 2) | null | Alternative |
Get public key for the authenticated user — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The public key used for setting user Codespaces' Secrets. |
key | string | Required within parent | The Base64 encoded public key. |
key_id | string | Required within parent | The identifier for the key. |
List machine types for a codespace — response body — machines item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A description of the machine powering a codespace. |
cpus | JSON | Required within parent | |
cpus (anyOf 1) | integer | Alternative | How many cores are available to the codespace. |
cpus (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
display_name | string | Required within parent | The display name of the machine includes cores, memory, and storage. |
memory_in_bytes | JSON | Required within parent | |
memory_in_bytes (anyOf 1) | integer | Alternative | How much memory is available to the codespace. |
memory_in_bytes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
name | string | Required within parent | The name of the machine. |
operating_system | string | Required within parent | The operating system of the machine. |
prebuild_availability | JSON | Required within parent | |
prebuild_availability (anyOf 1) | string | Alternative | Whether 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) | null | Alternative | |
storage_in_bytes | JSON | Required within parent | |
storage_in_bytes (anyOf 1) | integer | Alternative | How much storage is available to the codespace. |
storage_in_bytes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Stop a codespace for an organization user — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A codespace. |
billable_owner | Model | Required within parent | Expand List users — response body — item |
created_at | string | Required within parent | Format: date-time |
devcontainer_path | JSON | Optional | |
devcontainer_path (anyOf 1) | string | Alternative | Path to devcontainer.json from repo root used to create Codespace. |
devcontainer_path (anyOf 2) | null | Alternative | |
display_name | JSON | Optional | |
display_name (anyOf 1) | string | Alternative | Display name for this codespace. |
display_name (anyOf 2) | null | Alternative | |
environment_id | JSON | Required within parent | |
environment_id (anyOf 1) | string | Alternative | UUID identifying this codespace's environment. |
environment_id (anyOf 2) | null | Alternative | |
git_status | Model | Required within parent | Expand Stop a codespace for an organization user — response body — git status |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | Format: int64 |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
idle_timeout_minutes | JSON | Required within parent | |
idle_timeout_minutes (anyOf 1) | JSON | Alternative | |
idle_timeout_minutes (anyOf 1) (anyOf 1) | integer | Alternative | The number of minutes of inactivity after which this codespace will be automatically stopped. |
idle_timeout_minutes (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
idle_timeout_minutes (anyOf 2) | null | Alternative | |
idle_timeout_notice | JSON | Optional | |
idle_timeout_notice (anyOf 1) | string | Alternative | Text to show user when codespace idle timeout minutes has been overriden by an organization policy |
idle_timeout_notice (anyOf 2) | null | Alternative | |
last_known_stop_notice | JSON | Optional | |
last_known_stop_notice (anyOf 1) | string | Alternative | The text to display to a user when a codespace has been stopped for a potentially actionable reason. |
last_known_stop_notice (anyOf 2) | null | Alternative | |
last_used_at | string | Required within parent | Last known time this codespace was started. Format: date-time |
location | string | Required within parent | The initally assigned location of a new codespace. Known values: EastUs, SouthEastAsia, WestEurope, WestUs2 |
machine | Model | Required within parent | Expand Stop a codespace for an organization user — response body — machine |
machines_url | string | Required within parent | API URL to access available alternate machine types for this codespace. Format: uri |
name | string | Required within parent | Automatically generated name of this codespace. |
owner | Model | Required within parent | Expand List users — response body — item |
pending_operation | JSON | Optional | |
pending_operation (anyOf 1) | boolean | Alternative | Whether 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) | null | Alternative | |
pending_operation_disabled_reason | JSON | Optional | |
pending_operation_disabled_reason (anyOf 1) | string | Alternative | Text to show user when codespace is disabled by a pending operation |
pending_operation_disabled_reason (anyOf 2) | null | Alternative | |
prebuild | JSON | Required within parent | |
prebuild (anyOf 1) | boolean | Alternative | Whether the codespace was created from a prebuild. |
prebuild (anyOf 2) | null | Alternative | |
publish_url | JSON | Optional | |
publish_url (anyOf 1) | string | Alternative | API URL to publish this codespace to a new repository. Format: uri |
publish_url (anyOf 2) | null | Alternative | |
pulls_url | JSON | Required within parent | |
pulls_url (anyOf 1) | string | Alternative | API URL for the Pull Request associated with this codespace, if any. Format: uri |
pulls_url (anyOf 2) | null | Alternative | |
recent_folders | array | Required within parent | |
recent_folders[] | string | Each item | |
repository | Model | Required within parent | Expand Transfer a repository — response body |
retention_expires_at | JSON | Optional | |
retention_expires_at (anyOf 1) | string | Alternative | When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" Format: date-time |
retention_expires_at (anyOf 2) | null | Alternative | |
retention_period_minutes | JSON | Optional | |
retention_period_minutes (anyOf 1) | JSON | Alternative | |
retention_period_minutes (anyOf 1) (anyOf 1) | integer | Alternative | Duration 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) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
retention_period_minutes (anyOf 2) | null | Alternative | |
runtime_constraints | object | Optional | |
runtime_constraints.allowed_port_privacy_settings | JSON | Optional | |
runtime_constraints.allowed_port_privacy_settings (anyOf 1) | array | Alternative | The privacy settings a user can select from when forwarding a port. |
runtime_constraints.allowed_port_privacy_settings (anyOf 1)[] | string | Each item | |
runtime_constraints.allowed_port_privacy_settings (anyOf 2) | null | Alternative | |
start_url | string | Required within parent | API URL to start this codespace. Format: uri |
state | string | Required within parent | State of this codespace. Known values: Unknown, Created, Queued, Provisioning, Available, Awaiting, Unavailable, Deleted, Moved, Shutdown, Archived, Starting, ShuttingDown, Failed, Exporting, Updating, Rebuilding |
stop_url | string | Required within parent | API URL to stop this codespace. Format: uri |
updated_at | string | Required within parent | Format: date-time |
url | string | Required within parent | API URL for this codespace. Format: uri |
web_url | string | Required within parent | URL 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details about the codespace's git repository. |
ahead | JSON | Optional | |
ahead (anyOf 1) | integer | Alternative | The number of commits the local repository is ahead of the remote. |
ahead (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
behind | JSON | Optional | |
behind (anyOf 1) | integer | Alternative | The number of commits the local repository is behind the remote. |
behind (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
has_uncommitted_changes | boolean | Optional | Whether the local repository has uncommitted changes. |
has_unpushed_changes | boolean | Optional | Whether the local repository has unpushed changes. |
ref | string | Optional | The current branch (or SHA if in detached HEAD state) of the local repository. |
Stop a codespace for an organization user — response body — machine
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Stop a codespace for an organization user — response body — machine A description of the machine powering a codespace |
$ (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A description of the machine powering a codespace. |
cpus | JSON | Required within parent | |
cpus (anyOf 1) | integer | Alternative | How many cores are available to the codespace. |
cpus (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
display_name | string | Required within parent | The display name of the machine includes cores, memory, and storage. |
memory_in_bytes | JSON | Required within parent | |
memory_in_bytes (anyOf 1) | integer | Alternative | How much memory is available to the codespace. |
memory_in_bytes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
name | string | Required within parent | The name of the machine. |
operating_system | string | Required within parent | The operating system of the machine. |
prebuild_availability | JSON | Required within parent | |
prebuild_availability (anyOf 1) | string | Alternative | Whether 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) | null | Alternative | |
storage_in_bytes | JSON | Required within parent | |
storage_in_bytes (anyOf 1) | integer | Alternative | How much storage is available to the codespace. |
storage_in_bytes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |