> ## 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 organization encoded in the client's private key.

**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

**name** `str | None`

Repository name. If omitted, the API generates a name.

**default\_bookmark** `str | None`

Default bookmark name. Defaults to `main` when omitted.

**upstream** `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.

## Response

**id** `str`

Repository ID.

**org** `str`

Organization slug.

**name** `str`

Repository name.

**default\_bookmark** `str`

Default bookmark name.

**head\_change\_id** `str`

Current change ID at the default bookmark tip.

**upstream** `UpstreamConfig | None`

Configured upstream remote, or null when no upstream is configured.

**created\_at** `datetime`

Creation time.

**tags** `dict[str, str]`

Repository tags.

### UpstreamConfig

**url** `str`

Upstream Git remote URL.

**auth\_kind** `'token' | 'username_password' | None`

Stored upstream authentication kind, or null when the upstream is public.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.