---
title: "Get default attributes for a codespace"
method: GET
path: "/repos/{owner}/{repo}/codespaces/new"
tags: ["codespaces"]
---

# Get default attributes for a codespace

`GET /repos/{owner}/{repo}/codespaces/new`

Gets the default attributes for codespaces created by the user with the repository.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.

## Path parameters

- `owner` string, required
- `repo` string, required

## Query parameters

- `ref` string
- `client_ip` string

## Response `200`

Response when a user is able to create codespaces from the repository.

- object
  - `billable_owner` SimpleUser — A GitHub user.
    - `name` string, nullable
    - `email` string, nullable
    - `login` string, required
    - `id` integer, required
    - `node_id` string, required
    - `avatar_url` string, uri, required
    - `gravatar_id` string, nullable, required
    - `url` string, uri, required
    - `html_url` string, uri, required
    - `followers_url` string, uri, required
    - `following_url` string, required
    - `gists_url` string, required
    - `starred_url` string, required
    - `subscriptions_url` string, uri, required
    - `organizations_url` string, uri, required
    - `repos_url` string, uri, required
    - `events_url` string, required
    - `received_events_url` string, uri, required
    - `type` string, required
    - `site_admin` boolean, required
    - `starred_at` string
    - `user_view_type` string
  - `defaults` object
    - `location` string, required
    - `devcontainer_path` string, nullable, required

## Other responses

- `401` — Requires authentication
- `403` — Forbidden
- `404` — Resource not found

---

[API](https://skmtc.net/github/apis/rest-api.md) · [All operations](https://skmtc.net/github/apis/rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/rest-api/versions/80850db290cd/schema)
