provider codespaces POST /repos/{owner}/{repo}/codespaces
@utdk/github /repos/{owner}/{repo}/codespaces
Create a codespace in a repository
Creates a codespace owned by the authenticated user in the specified repository. OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
owner path required
The account owner of the repository. The name is not case sensitive.
string
repo path required
The name of the repository without the `.git` extension. The name is not case sensitive.
string

Try it

Authentication
Configure credentials for GitHub v3 REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

codespaces.createWithRepoForAuthenticatedUser
POST/repos/{owner}/{repo}/codespaces
Creates a codespace owned by the authenticated user in the specified repository. OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.

Parameters

required

The account owner of the repository. The name is not case sensitive.

required

The name of the repository without the `.git` extension. The name is not case sensitive.

Input

Git ref (typically a branch name) for this codespace

The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided.

The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is closing down.

IP for location auto-detection when proxying a request

Machine type to use for this codespace

Path to devcontainer.json config to use for this codespace

Whether to authorize requested permissions from devcontainer.json

Working directory for this codespace

Time in minutes before codespace stops from inactivity

Display name for this codespace

Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days).

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import github from '@utdk/github';

await github.codespaces.createWithRepoForAuthenticatedUser()