# dev.knotless.putPreferences

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

✓ This is the authoritative definition for this NSID.

## Description

Changes the asking account's preferences.

## Links

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

## Definitions

### `dev.knotless.putPreferences`

**Type**: `procedure`

Changes the asking account's preferences, as the appview keeps them: each one given takes the place of the one of its kind, and the rest stay. Answers them all, as dev.knotless.getPreferences does. Requires authentication: a service token, or the session cookie the pages' login sets, from the pages themselves.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `preferences` | `array` | Yes | The preferences to set, at most one of each kind. |

#### Output

**Encoding**: `application/json`

#### Errors

- **InvalidRequest**: A kind of preference the appview does not keep, or one not as its kind says: a theme not named as the pages name theirs, or a reason the appview does not give.
- **AuthenticationRequired**: No account asks.
- **NotFound**: This appview keeps no index, so it keeps no preferences.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Changes the asking account's preferences, as the appview keeps them: each one given takes the place of the one of its kind, and the rest stay. Answers them all, as dev.knotless.getPreferences does. Requires authentication: a service token, or the session cookie the pages' login sets, from the pages themselves.",
      "errors": [
        {
          "description": "A kind of preference the appview does not keep, or one not as its kind says: a theme not named as the pages name theirs, or a reason the appview does not give.",
          "name": "InvalidRequest"
        },
        {
          "description": "No account asks.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "This appview keeps no index, so it keeps no preferences.",
          "name": "NotFound"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "preferences": {
              "description": "The preferences to set, at most one of each kind.",
              "items": {
                "refs": [
                  "dev.knotless.getPreferences#appearancePref",
                  "dev.knotless.getPreferences#notificationPref"
                ],
                "type": "union"
              },
              "maxLength": 32,
              "type": "array"
            }
          },
          "required": [
            "preferences"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "dev.knotless.getPreferences#preferences",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Changes the asking account's preferences.",
  "id": "dev.knotless.putPreferences",
  "lexicon": 1
}
```
