provider codespaces POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces
@utdk/github /repos/{owner}/{repo}/pulls/{pull_number}/codespaces
Create a codespace from a pull request
Creates a codespace owned by the authenticated user for the specified pull request. 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
pull_number path required
The number that identifies the pull request.
integer

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.createWithPrForAuthenticatedUser
POST/repos/{owner}/{repo}/pulls/{pull_number}/codespaces
Creates a codespace owned by the authenticated user for the specified pull request. 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.

required

The number that identifies the pull request.

Input

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.createWithPrForAuthenticatedUser()