Search + K

Command Palette

Search for a command to run...

Sign In

List codespaces for a user in organization

GET /orgs/{org}/members/{username}/codespaces
Copy endpoint
https://api.github.com

Lists the codespaces that a member of an organization has for repositories in that organization.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

path Path Parameters

Name Type
org required

The organization name. The name is not case sensitive.

string
username required

The handle for the GitHub user account.

string

query Query Parameters

Name Type
per_page

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

number
page

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

number

Responses

200 application/json

Response

{ total_count: number;codespaces: Codespace

A codespace.

interface Codespace {
id: number;
name: string;
display_name?: string | null;
environment_id: string | null;
owner: SimpleUser;
billable_owner: SimpleUser;
repository: MinimalRepository;
machine: CodespaceMachine | null;
devcontainer_path?: string | null;
prebuild: boolean | null;
created_at: string;
updated_at: string;
last_used_at: string;
state: "Unknown" | "Created" | "Queued" | "Provisioning" | "Available" | "Awaiting" | "Unavailable" | "Deleted" | "Moved" | "Shutdown" | "Archived" | "Starting" | "ShuttingDown" | "Failed" | "Exporting" | "Updating" | "Rebuilding";
url: string;
git_status: {
ahead?: number;
behind?: number;
has_unpushed_changes?: boolean;
has_uncommitted_changes?: boolean;
ref?: string;
}
;
location: "EastUs" | "SouthEastAsia" | "WestEurope" | "WestUs2";
idle_timeout_minutes: number | null;
web_url: string;
machines_url: string;
start_url: string;
stop_url: string;
publish_url?: string | null;
pulls_url: string | null;
recent_folders: string[];
runtime_constraints?: { allowed_port_privacy_settings?: string[] | null; };
pending_operation?: boolean | null;
pending_operation_disabled_reason?: string | null;
idle_timeout_notice?: string | null;
retention_period_minutes?: number | null;
retention_expires_at?: string | null;
last_known_stop_notice?: string | null;
}
[]
; }

Redirects

304

Not modified

unknown

Client Errors

401 application/json

Requires authentication

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
403 application/json

Forbidden

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
404 application/json

Resource not found

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}

Server Errors

500 application/json

Internal Error

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}