# app.thesocialwire.appview.prepareReadState

> Freeze a bulk-read selection without changing state. No cutoff returns publication boundaries; an age cutoff returns exact existing unread subject IDs plus calendar metadata. Clients split the selection into immutable PDS chunks. An excessive selection fails, never truncates.

- Kind: procedure
- Authority: appview.thesocialwire.app
- Lexicon: 1
- Published by [samclemente.me](https://lexicon.garden/identity/did:plc:qy5pluw2bsuq2x6albsgkvx3), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.appview.prepareReadState)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.appview.prepareReadState/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.appview.prepareReadState/analytics)

## Procedure (`app.thesocialwire.appview.prepareReadState`)

Type: procedure · POST

### Input (application/json)

- `before` (string · datetime)
  - Constraints: maxLength: 2048
- `previewSubjectUris` (array): Cached subject IDs for an optional server-verified local preview; never part of canonical PDS operations.
  - Constraints: maxLength: 1000
  - `items` (string)
    - Constraints: maxLength: 2048
- `referenceDate` (string)
  - Constraints: maxLength: 10
- `scope` (object, required)
- `timeZone` (string)
  - Constraints: maxLength: 128

### Output (application/json)

- `actedAt` (string · datetime, required)
  - Constraints: maxLength: 2048
- `boundaries` (array)
  - Constraints: maxLength: 100000
  - `items` (ref)
    - Reference: `app.thesocialwire.readStateDefs#boundary`
- `calendar` (ref)
  - Reference: `app.thesocialwire.readStateDefs#calendar`
- `legacyRevision` (integer, required)
  - Constraints: minimum: 0, maximum: 9007199254740991
- `manifestCid` (string · cid)
  - Constraints: maxLength: 256
- `previewSubjectUris` (array): Cached subject IDs for an optional server-verified local preview; never part of canonical PDS operations.
  - Constraints: maxLength: 1000
  - `items` (string)
    - Constraints: maxLength: 2048
- `selection` (string, required)
  - Constraints: maxLength: 10, enum: boundaries | exact
- `subjectUris` (array)
  - Constraints: maxLength: 100000
  - `items` (string)
    - Constraints: maxLength: 2048

### Errors

- `InvalidRequest`: No description in schema.
- `Conflict`: No description in schema.
- `UpstreamUnavailable`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Freeze a bulk-read selection without changing state. No cutoff returns publication boundaries; an age cutoff returns exact existing unread subject IDs plus calendar metadata. Clients split the selection into immutable PDS chunks. An excessive selection fails, never truncates.",
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "Conflict"
        },
        {
          "name": "UpstreamUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "before": {
              "format": "datetime",
              "maxLength": 2048,
              "type": "string"
            },
            "previewSubjectUris": {
              "description": "Cached subject IDs for an optional server-verified local preview; never part of canonical PDS operations.",
              "items": {
                "maxLength": 2048,
                "type": "string"
              },
              "maxLength": 1000,
              "type": "array"
            },
            "referenceDate": {
              "maxLength": 10,
              "type": "string"
            },
            "scope": {
              "properties": {
                "folderRkey": {
                  "maxLength": 512,
                  "type": "string"
                },
                "kind": {
                  "knownValues": [
                    "publication",
                    "folder",
                    "subscribed",
                    "following"
                  ],
                  "maxLength": 32,
                  "type": "string"
                },
                "publicationId": {
                  "maxLength": 2048,
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "type": "object"
            },
            "timeZone": {
              "maxLength": 128,
              "type": "string"
            }
          },
          "required": [
            "scope"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "actedAt": {
              "format": "datetime",
              "maxLength": 2048,
              "type": "string"
            },
            "boundaries": {
              "items": {
                "ref": "app.thesocialwire.readStateDefs#boundary",
                "type": "ref"
              },
              "maxLength": 100000,
              "type": "array"
            },
            "calendar": {
              "ref": "app.thesocialwire.readStateDefs#calendar",
              "type": "ref"
            },
            "legacyRevision": {
              "maximum": 9007199254740991,
              "minimum": 0,
              "type": "integer"
            },
            "manifestCid": {
              "format": "cid",
              "maxLength": 256,
              "type": "string"
            },
            "previewSubjectUris": {
              "description": "Cached subject IDs for an optional server-verified local preview; never part of canonical PDS operations.",
              "items": {
                "maxLength": 2048,
                "type": "string"
              },
              "maxLength": 1000,
              "type": "array"
            },
            "selection": {
              "enum": [
                "boundaries",
                "exact"
              ],
              "maxLength": 10,
              "type": "string"
            },
            "subjectUris": {
              "items": {
                "maxLength": 2048,
                "type": "string"
              },
              "maxLength": 100000,
              "type": "array"
            }
          },
          "required": [
            "actedAt",
            "selection",
            "legacyRevision"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "app.thesocialwire.appview.prepareReadState",
  "lexicon": 1
}
```
