# dev.knotless.getAccountData

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

✓ This is the authoritative definition for this NSID.

## Description

What knotless data the asking account holds, before it deletes it.

## Links

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

## Definitions

### `dev.knotless.getAccountData#collectionCount`

**Type**: `object`

How many records the account holds in one collection.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `collection` | `string` (nsid) | Yes | The collection, as dev.knotless.issue. |
| `count` | `integer` | Yes | How many records it holds there. |

### `dev.knotless.getAccountData`

**Type**: `query`

Counts the records the asking account holds in each dev.knotless.* collection, read from its PDS rather than the index, and names its repositories, public and private, with how many other accounts push to or read each: what dev.knotless.deleteAccountData would delete, as `knotless delete-data` lists it. A private repository's records are in its space, counted as one space. Only the account itself, logged in to this appview's web pages, can ask: the appview reads its spaces with the session it keeps for it, which the pages' session cookie names.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `collections` | `array` | Yes | Each dev.knotless.* collection the account holds records in, in the order of their names. |
| `did` | `string` (did) | Yes | The account. |
| `repos` | `array` | Yes | The account's repositories, public ones first, each by name. |
| `spaces` | `integer` | Yes | The spaces the account owns for private repositories: one for each, and one for each name a rename of one left. |

#### Errors

- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.

### `dev.knotless.getAccountData#repoData`

**Type**: `object`

One of the account's repositories, and how many other accounts it concerns.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `collaborators` | `integer` | Yes | The other accounts its record lets push to it. |
| `members` | `integer` | No | For a private one, the other accounts that read it, its runners left out. |
| `name` | `string` | Yes | Its name, its dev.knotless.repo record's key. |
| `private` | `boolean` | Yes | Whether it is private, in a space of its own. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "collectionCount": {
      "description": "How many records the account holds in one collection.",
      "properties": {
        "collection": {
          "description": "The collection, as dev.knotless.issue.",
          "format": "nsid",
          "type": "string"
        },
        "count": {
          "description": "How many records it holds there.",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "collection",
        "count"
      ],
      "type": "object"
    },
    "main": {
      "description": "Counts the records the asking account holds in each dev.knotless.* collection, read from its PDS rather than the index, and names its repositories, public and private, with how many other accounts push to or read each: what dev.knotless.deleteAccountData would delete, as `knotless delete-data` lists it. A private repository's records are in its space, counted as one space. Only the account itself, logged in to this appview's web pages, can ask: the appview reads its spaces with the session it keeps for it, which the pages' session cookie names.",
      "errors": [
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "collections": {
              "description": "Each dev.knotless.* collection the account holds records in, in the order of their names.",
              "items": {
                "ref": "#collectionCount",
                "type": "ref"
              },
              "type": "array"
            },
            "did": {
              "description": "The account.",
              "format": "did",
              "type": "string"
            },
            "repos": {
              "description": "The account's repositories, public ones first, each by name.",
              "items": {
                "ref": "#repoData",
                "type": "ref"
              },
              "type": "array"
            },
            "spaces": {
              "description": "The spaces the account owns for private repositories: one for each, and one for each name a rename of one left.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "did",
            "collections",
            "repos",
            "spaces"
          ],
          "type": "object"
        }
      },
      "type": "query"
    },
    "repoData": {
      "description": "One of the account's repositories, and how many other accounts it concerns.",
      "properties": {
        "collaborators": {
          "description": "The other accounts its record lets push to it.",
          "minimum": 0,
          "type": "integer"
        },
        "members": {
          "description": "For a private one, the other accounts that read it, its runners left out.",
          "minimum": 0,
          "type": "integer"
        },
        "name": {
          "description": "Its name, its dev.knotless.repo record's key.",
          "maxLength": 100,
          "type": "string"
        },
        "private": {
          "description": "Whether it is private, in a space of its own.",
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "private",
        "collaborators"
      ],
      "type": "object"
    }
  },
  "description": "What knotless data the asking account holds, before it deletes it.",
  "id": "dev.knotless.getAccountData",
  "lexicon": 1
}
```
