# dev.knotless.archiveRepo

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

✓ This is the authoritative definition for this NSID.

## Description

Archives a repository, making it read only, or unarchives it.

## Links

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

## Definitions

### `dev.knotless.archiveRepo`

**Type**: `procedure`

Sets or drops `archivedAt` on the repository's dev.knotless.repo record, as `knotless archive` does. While it is archived, pushes and commits to it are refused, and so is anything more said about it, and runners leave it. 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 |
|----------|------|----------|-------------|
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |
| `unarchive` | `boolean` | No | True to unarchive it, making it writable again. Absent is false. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `archivedAt` | `string` (datetime) | No | When it was archived; absent once unarchived. |

#### Errors

- **NotFound**: No such repository.
- **InvalidRequest**: It is already archived, or already not.
- **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": "Sets or drops `archivedAt` on the repository's dev.knotless.repo record, as `knotless archive` does. While it is archived, pushes and commits to it are refused, and so is anything more said about it, and runners leave it. 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": "It is already archived, or already not.",
          "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": {
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            },
            "unarchive": {
              "description": "True to unarchive it, making it writable again. Absent is false.",
              "type": "boolean"
            }
          },
          "required": [
            "repo"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "archivedAt": {
              "description": "When it was archived; absent once unarchived.",
              "format": "datetime",
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Archives a repository, making it read only, or unarchives it.",
  "id": "dev.knotless.archiveRepo",
  "lexicon": 1
}
```
