# dev.knotless.forkRepo

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

✓ This is the authoritative definition for this NSID.

## Description

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

## Links

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

## Definitions

### `dev.knotless.forkRepo`

**Type**: `procedure`

Copies a repository, every branch and tag, into a new dev.knotless.repo in the account logged in to this appview's web pages, naming it as forked from the first, as `knotless fork` does. Requires the session cookie the pages' login sets: the appview writes with the session it keeps for that account.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | No | The fork's name: the repository's own when absent. |
| `repo` | `string` (at-uri) | Yes | The repository to fork: its dev.knotless.repo record, as dev.knotless.getRepo takes it. |

#### Output

**Encoding**: `application/json`

#### Errors

- **NotFound**: No such repository.
- **InvalidRequest**: The account owns the repository, has a repository by that name already, or the name is not one a repository can have.
- **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": "Copies a repository, every branch and tag, into a new dev.knotless.repo in the account logged in to this appview's web pages, naming it as forked from the first, as `knotless fork` does. Requires the session cookie the pages' login sets: the appview writes with the session it keeps for that account.",
      "errors": [
        {
          "description": "No such repository.",
          "name": "NotFound"
        },
        {
          "description": "The account owns the repository, has a repository by that name already, or the name is not one a repository can have.",
          "name": "InvalidRequest"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "name": {
              "description": "The fork's name: the repository's own when absent.",
              "maxLength": 100,
              "type": "string"
            },
            "repo": {
              "description": "The repository to fork: its dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "repo"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "dev.knotless.defs#repoMade",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Forks a repository into the account logged in to this appview's pages.",
  "id": "dev.knotless.forkRepo",
  "lexicon": 1
}
```
