# dev.knotless.getPreferences

> The asking account's preferences, as the appview keeps them, apart from any record: one of each kind, of those it has set, and always its notifications, which dev.knotless.listNotifications and getUnreadCount follow. A kind it has not set a reader takes as its default. The pages' login copies what they act on into the browser. Requires authentication: a service token, or the session cookie the pages' login sets.

- Kind: query
- Authority: knotless.dev
- Lexicon: 1
- Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.getPreferences)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.getPreferences/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.getPreferences/analytics)

## Query (`dev.knotless.getPreferences`)

Type: query · GET

### Output (application/json)

- `schema` (ref)
  - Reference: `#preferences`

### Errors

- `AuthenticationRequired`: No account asks.
- `NotFound`: This appview keeps no index, so it keeps no preferences.

## #addedTheme (`dev.knotless.getPreferences#addedTheme`)

Type: object

A theme someone made, as the account added it.

### Properties

- `addedAt` (string · datetime): When the account added it, which orders its themes, the latest first, beside those it made.
- `creator` (string · did): The account that made it.
- `name` (string): What the theme was called when it was added.
  - Constraints: maxLength: 640, maxGraphemes: 64
- `palette` (ref, required)
  - Reference: `dev.knotless.theme#palette`
- `uri` (string · at-uri, required): The dev.knotless.theme it was copied from.

## #appearancePref (`dev.knotless.getPreferences#appearancePref`)

Type: object

How the pages are drawn for the account: in one theme, or with night, in this one by day and night's at night, as the system's light or dark says.

### Properties

- `night` (ref): The theme the pages are drawn in at night, while the system is dark; this preference's own theme by day. Absent, the pages are drawn in one theme.
  - Reference: `#themeChoice`
- `palette` (ref): The colours of a theme of the account's own, which theme custom draws the pages in: a copy of a dev.knotless.theme's, or made only for itself.
  - Reference: `dev.knotless.theme#palette`
- `source` (string · at-uri): The dev.knotless.theme palette was copied from, if it was.
- `theme` (string): The colours the pages are drawn in, as their Appearance settings name them: custom for those of palette. Absent, or one the pages do not know, they follow the system's light or dark.
  - Constraints: maxLength: 64, knownValues: light | dark | latte | mocha | dracula | pckt | plyr | blacksky | custom

## #notificationPref (`dev.knotless.getPreferences#notificationPref`)

Type: object

Which notifications the account hears of. Until it says, every reason, from anyone.

### Properties

- `followedOnly` (boolean): Whether it hears only of what accounts it follows on knotless did. Not, when absent.
- `reasons` (array): Reasons a notification is given for, each on or off. Given back, every one dev.knotless.listNotifications gives; set, one not named is on.
  - Constraints: maxLength: 64
  - `items` (ref)
    - Reference: `#notificationReason`

## #notificationReason (`dev.knotless.getPreferences#notificationReason`)

Type: object

Whether an account hears of one reason's notifications.

### Properties

- `enabled` (boolean, required): Whether it hears of them.
- `reason` (string, required): A reason, as dev.knotless.listNotifications#notification gives it.
  - Constraints: maxLength: 64, knownValues: star | follow | pull | issue | comment | mention | review-requested | assigned | checks-failed | ejected | subscribed | watching

## #preferences (`dev.knotless.getPreferences#preferences`)

Type: object

An account's preferences, each of a kind.

### Properties

- `preferences` (array, required): At most one of each kind. Kinds unknown to a reader are passed over.
  - Constraints: maxLength: 32
  - `items` (union)
    - One of: `#appearancePref`, `#notificationPref`, `#themesPref`

## #themeChoice (`dev.knotless.getPreferences#themeChoice`)

Type: object

A theme the pages are drawn in, as appearancePref names its own.

### Properties

- `palette` (ref): The colours theme custom draws the pages in.
  - Reference: `dev.knotless.theme#palette`
- `source` (string · at-uri): The dev.knotless.theme palette was copied from, if it was.
- `theme` (string): The colours the pages are drawn in, as their Appearance settings name them: custom for those of palette. Absent, or one the pages do not know, they follow the system's light or dark.
  - Constraints: maxLength: 64, knownValues: light | dark | latte | mocha | dracula | pckt | plyr | blacksky | custom

## #themesPref (`dev.knotless.getPreferences#themesPref`)

Type: object

The themes people made that the account added to its own, to choose from on Appearance: each a copy, so a theme changed or deleted later leaves the account's as it was. Set whole, as each kind is.

### Properties

- `themes` (array, required): The themes added, the latest first.
  - Constraints: maxLength: 50
  - `items` (ref)
    - Reference: `#addedTheme`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "addedTheme": {
      "description": "A theme someone made, as the account added it.",
      "properties": {
        "addedAt": {
          "description": "When the account added it, which orders its themes, the latest first, beside those it made.",
          "format": "datetime",
          "type": "string"
        },
        "creator": {
          "description": "The account that made it.",
          "format": "did",
          "type": "string"
        },
        "name": {
          "description": "What the theme was called when it was added.",
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "palette": {
          "ref": "dev.knotless.theme#palette",
          "type": "ref"
        },
        "uri": {
          "description": "The dev.knotless.theme it was copied from.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "palette"
      ],
      "type": "object"
    },
    "appearancePref": {
      "description": "How the pages are drawn for the account: in one theme, or with night, in this one by day and night's at night, as the system's light or dark says.",
      "properties": {
        "night": {
          "description": "The theme the pages are drawn in at night, while the system is dark; this preference's own theme by day. Absent, the pages are drawn in one theme.",
          "ref": "#themeChoice",
          "type": "ref"
        },
        "palette": {
          "description": "The colours of a theme of the account's own, which theme custom draws the pages in: a copy of a dev.knotless.theme's, or made only for itself.",
          "ref": "dev.knotless.theme#palette",
          "type": "ref"
        },
        "source": {
          "description": "The dev.knotless.theme palette was copied from, if it was.",
          "format": "at-uri",
          "type": "string"
        },
        "theme": {
          "description": "The colours the pages are drawn in, as their Appearance settings name them: custom for those of palette. Absent, or one the pages do not know, they follow the system's light or dark.",
          "knownValues": [
            "light",
            "dark",
            "latte",
            "mocha",
            "dracula",
            "pckt",
            "plyr",
            "blacksky",
            "custom"
          ],
          "maxLength": 64,
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "The asking account's preferences, as the appview keeps them, apart from any record: one of each kind, of those it has set, and always its notifications, which dev.knotless.listNotifications and getUnreadCount follow. A kind it has not set a reader takes as its default. The pages' login copies what they act on into the browser. Requires authentication: a service token, or the session cookie the pages' login sets.",
      "errors": [
        {
          "description": "No account asks.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "This appview keeps no index, so it keeps no preferences.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "#preferences",
          "type": "ref"
        }
      },
      "type": "query"
    },
    "notificationPref": {
      "description": "Which notifications the account hears of. Until it says, every reason, from anyone.",
      "properties": {
        "followedOnly": {
          "description": "Whether it hears only of what accounts it follows on knotless did. Not, when absent.",
          "type": "boolean"
        },
        "reasons": {
          "description": "Reasons a notification is given for, each on or off. Given back, every one dev.knotless.listNotifications gives; set, one not named is on.",
          "items": {
            "ref": "#notificationReason",
            "type": "ref"
          },
          "maxLength": 64,
          "type": "array"
        }
      },
      "type": "object"
    },
    "notificationReason": {
      "description": "Whether an account hears of one reason's notifications.",
      "properties": {
        "enabled": {
          "description": "Whether it hears of them.",
          "type": "boolean"
        },
        "reason": {
          "description": "A reason, as dev.knotless.listNotifications#notification gives it.",
          "knownValues": [
            "star",
            "follow",
            "pull",
            "issue",
            "comment",
            "mention",
            "review-requested",
            "assigned",
            "checks-failed",
            "ejected",
            "subscribed",
            "watching"
          ],
          "maxLength": 64,
          "type": "string"
        }
      },
      "required": [
        "reason",
        "enabled"
      ],
      "type": "object"
    },
    "preferences": {
      "description": "An account's preferences, each of a kind.",
      "properties": {
        "preferences": {
          "description": "At most one of each kind. Kinds unknown to a reader are passed over.",
          "items": {
            "refs": [
              "#appearancePref",
              "#notificationPref",
              "#themesPref"
            ],
            "type": "union"
          },
          "maxLength": 32,
          "type": "array"
        }
      },
      "required": [
        "preferences"
      ],
      "type": "object"
    },
    "themeChoice": {
      "description": "A theme the pages are drawn in, as appearancePref names its own.",
      "properties": {
        "palette": {
          "description": "The colours theme custom draws the pages in.",
          "ref": "dev.knotless.theme#palette",
          "type": "ref"
        },
        "source": {
          "description": "The dev.knotless.theme palette was copied from, if it was.",
          "format": "at-uri",
          "type": "string"
        },
        "theme": {
          "description": "The colours the pages are drawn in, as their Appearance settings name them: custom for those of palette. Absent, or one the pages do not know, they follow the system's light or dark.",
          "knownValues": [
            "light",
            "dark",
            "latte",
            "mocha",
            "dracula",
            "pckt",
            "plyr",
            "blacksky",
            "custom"
          ],
          "maxLength": 64,
          "type": "string"
        }
      },
      "type": "object"
    },
    "themesPref": {
      "description": "The themes people made that the account added to its own, to choose from on Appearance: each a copy, so a theme changed or deleted later leaves the account's as it was. Set whole, as each kind is.",
      "properties": {
        "themes": {
          "description": "The themes added, the latest first.",
          "items": {
            "ref": "#addedTheme",
            "type": "ref"
          },
          "maxLength": 50,
          "type": "array"
        }
      },
      "required": [
        "themes"
      ],
      "type": "object"
    }
  },
  "description": "The asking account's preferences, of how knotless is shown to it.",
  "id": "dev.knotless.getPreferences",
  "lexicon": 1
}
```
