# dev.knotless.getPreferences

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

✓ This is the authoritative definition for this NSID.

## Description

The asking account's preferences, of how knotless is shown to it.

## Links

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

## Definitions

### `dev.knotless.getPreferences#appearancePref`

**Type**: `object`

How the pages are drawn for the account.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `theme` | `string` | No | The colours the pages are drawn in, as their Appearance settings name them. Absent, or one the pages do not know, they follow the system's light or dark. |

### `dev.knotless.getPreferences`

**Type**: `query`

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.

#### Output

**Encoding**: `application/json`

#### Errors

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

### `dev.knotless.getPreferences#notificationPref`

**Type**: `object`

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

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `followedOnly` | `boolean` | No | Whether it hears only of what accounts it follows on knotless did. Not, when absent. |
| `reasons` | `array` | No | Reasons a notification is given for, each on or off. Given back, every one dev.knotless.listNotifications gives; set, one not named is on. |

### `dev.knotless.getPreferences#notificationReason`

**Type**: `object`

Whether an account hears of one reason's notifications.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `enabled` | `boolean` | Yes | Whether it hears of them. |
| `reason` | `string` | Yes | A reason, as dev.knotless.listNotifications#notification gives it. |

### `dev.knotless.getPreferences#preferences`

**Type**: `object`

An account's preferences, each of a kind.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `preferences` | `array` | Yes | At most one of each kind. Kinds unknown to a reader are passed over. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "appearancePref": {
      "description": "How the pages are drawn for the account.",
      "properties": {
        "theme": {
          "description": "The colours the pages are drawn in, as their Appearance settings name them. 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"
          ],
          "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"
          ],
          "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"
            ],
            "type": "union"
          },
          "maxLength": 32,
          "type": "array"
        }
      },
      "required": [
        "preferences"
      ],
      "type": "object"
    }
  },
  "description": "The asking account's preferences, of how knotless is shown to it.",
  "id": "dev.knotless.getPreferences",
  "lexicon": 1
}
```
