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.

Servers

Path parameters

Name Type Required Description
repo String Yes

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

owner String Yes

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

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
client_ip String No

IP for location auto-detection when proxying a request

working_directory String No

Working directory for this codespace

idle_timeout_minutes Integer No

Time in minutes before codespace stops from inactivity

location String No

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

devcontainer_path String No

Path to devcontainer.json config to use for this codespace

geo String No

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

Possible values:

  • "UsWest"
  • "UsEast"
  • "EuropeWest"
  • "SoutheastAsia"
multi_repo_permissions_opt_out Boolean No

Whether to authorize requested permissions from devcontainer.json

ref String No

Git ref (typically a branch name) for this codespace

display_name String No

Display name for this codespace

machine String No

Machine type to use for this codespace

retention_period_minutes Integer No

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

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.