> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# repos.create()

> Create a Mesa repository, optionally with a default bookmark or upstream remote.

Create a repository in the current or specified organization.

**Required scope: `write`**

```python theme={null}
repo = await mesa.repos.create(name="app")
print(repo.name)
print(repo.head_change_id)
```

Create with an upstream Git remote:

```python theme={null}
from mesa_sdk.types import TokenAuth, UpstreamConfig

repo = await mesa.repos.create(
    name="app",
    default_bookmark="main",
    upstream=UpstreamConfig(
        url="https://github.com/acme/app.git",
        auth=TokenAuth(token="github_pat_...", token_username="bot"),
    ),
)
```

## Options

<ParamField path="org" type="str | None">
  Organization override.
</ParamField>

<ParamField path="name" type="str | None">
  Repository name. If omitted, the API generates a name.
</ParamField>

<ParamField path="default_bookmark" type="str | None">
  Default bookmark name. Defaults to `main` when omitted.
</ParamField>

<ParamField path="upstream" type="UpstreamConfig | None">
  Optional upstream Git remote to attach at create time. On create, `auth=UNSET` and `auth=None` both create a public upstream. Pass `TokenAuth` or `UsernamePasswordAuth` to store credentials.
</ParamField>

## Response

<ResponseField name="id" type="str">
  Repository ID.
</ResponseField>

<ResponseField name="org" type="str">
  Organization slug.
</ResponseField>

<ResponseField name="name" type="str">
  Repository name.
</ResponseField>

<ResponseField name="default_bookmark" type="str">
  Default bookmark name.
</ResponseField>

<ResponseField name="head_change_id" type="str">
  Current change ID at the default bookmark tip.
</ResponseField>

<ResponseField name="upstream" type="UpstreamConfig | None">
  Configured upstream remote, or null when no upstream is configured.
</ResponseField>

<ResponseField name="created_at" type="datetime">
  Creation time.
</ResponseField>

<ResponseField name="tags" type="dict[str, str]">
  Repository tags.
</ResponseField>

### UpstreamConfig

<ResponseField name="url" type="str">
  Upstream Git remote URL.
</ResponseField>

<ResponseField name="auth_kind" type="'token' | 'username_password' | None">
  Stored upstream authentication kind, or null when the upstream is public.
</ResponseField>
