# dev.knotless.createRepo

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

Creates a repository in the account logged in to this appview's pages.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.createRepo)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.createRepo/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.createRepo/examples)

## Definitions

### `dev.knotless.createRepo`

**Type**: `procedure`

Writes a dev.knotless.repo record under the name given in the account logged in to this appview's web pages, as `knotless create` does: public unless asked for private, naming the runners the appview offers for new repositories, and with no branches until the first push. Requires the session cookie the pages' login sets: the appview writes with the session it keeps for that account. Clients holding their own session write the record themselves.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `defaultBranch` | `string` | No | The branch its HEAD names, without refs/heads/: main when absent. |
| `description` | `string` | No | What the repository is, shown under its name. |
| `name` | `string` | Yes | The repository's name, its record key. |
| `private` | `boolean` | No | Whether to make it private, as `knotless create --private` does: a space of its own on the account's PDS, which only its members read, its runners among them. Public when absent. |

#### Output

**Encoding**: `application/json`

#### Errors

- **InvalidRequest**: The name is not one a repository can have, or the account has a repository by it already.
- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Writes a dev.knotless.repo record under the name given in the account logged in to this appview's web pages, as `knotless create` does: public unless asked for private, naming the runners the appview offers for new repositories, and with no branches until the first push. Requires the session cookie the pages' login sets: the appview writes with the session it keeps for that account. Clients holding their own session write the record themselves.",
      "errors": [
        {
          "description": "The name is not one a repository can have, or the account has a repository by it already.",
          "name": "InvalidRequest"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "defaultBranch": {
              "description": "The branch its HEAD names, without refs/heads/: main when absent.",
              "maxLength": 255,
              "type": "string"
            },
            "description": {
              "description": "What the repository is, shown under its name.",
              "maxGraphemes": 300,
              "maxLength": 3000,
              "type": "string"
            },
            "name": {
              "description": "The repository's name, its record key.",
              "maxLength": 100,
              "type": "string"
            },
            "private": {
              "description": "Whether to make it private, as `knotless create --private` does: a space of its own on the account's PDS, which only its members read, its runners among them. Public when absent.",
              "type": "boolean"
            }
          },
          "required": [
            "name"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "dev.knotless.defs#repoMade",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Creates a repository in the account logged in to this appview's pages.",
  "id": "dev.knotless.createRepo",
  "lexicon": 1
}
```
