# dev.knotless.renameRepo

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

✓ This is the authoritative definition for this NSID.

## Description

Gives a repository a new name.

## Links

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

## Definitions

### `dev.knotless.renameRepo`

**Type**: `procedure`

Moves the repository's dev.knotless.repo record to the new name, as `knotless rename` does, leaving a dev.knotless.redirect under the old one, so links and clones by it still lead there. Only its owner, logged in to this appview's web pages, can: the appview writes with the session it keeps for that account, which the pages' session cookie names.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Its new name. |
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |

#### Output

**Encoding**: `application/json`

#### Errors

- **NotFound**: No such repository.
- **InvalidRequest**: The name is not one a repository can have, is the one it has, or another repository has it.
- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.
- **Forbidden**: The account logged in is not the repository's owner.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Moves the repository's dev.knotless.repo record to the new name, as `knotless rename` does, leaving a dev.knotless.redirect under the old one, so links and clones by it still lead there. Only its owner, logged in to this appview's web pages, can: the appview writes with the session it keeps for that account, which the pages' session cookie names.",
      "errors": [
        {
          "description": "No such repository.",
          "name": "NotFound"
        },
        {
          "description": "The name is not one a repository can have, is the one it has, or another repository has it.",
          "name": "InvalidRequest"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "The account logged in is not the repository's owner.",
          "name": "Forbidden"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "name": {
              "description": "Its new name.",
              "maxLength": 100,
              "type": "string"
            },
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "name"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "dev.knotless.defs#repoMade",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Gives a repository a new name.",
  "id": "dev.knotless.renameRepo",
  "lexicon": 1
}
```
