# app.thesocialwire.appview.markReadBefore

> Mark only unread indexed stories published before an exclusive cutoff in a viewer-owned feed scope. Returns the marked entryIds for client read-state reconciliation.

- 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.markReadBefore)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.appview.markReadBefore/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.appview.markReadBefore/analytics)

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

Type: procedure · POST

### Input (application/json)

- `before` (string · datetime, required): Exclusive publication-time cutoff from getReadAgeOptions.
- `scope` (ref, required)
  - Reference: `app.thesocialwire.appview.markAllRead#scope`

### Output (application/json)

- `entryIds` (array, required): Identifiers of stories marked by this request, for client read-state reconciliation.
  - `items` (string)
    - Constraints: maxLength: 2048
- `marked` (integer, required)
  - Constraints: minimum: 0
- `readAt` (string · datetime, required)
- `unreadCounts` (ref, required)
  - Reference: `#unreadCounts`

### Errors

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

## #unreadCounts (`app.thesocialwire.appview.markReadBefore#unreadCounts`)

Type: object

Publication identifier to nonnegative integer unread count. If recounting fails after read marks commit, the procedure still succeeds with marked entryIds and an empty object here. Missing keys mean unknown: preserve existing counts until a later refresh rather than replacing them with zero.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Mark only unread indexed stories published before an exclusive cutoff in a viewer-owned feed scope. Returns the marked entryIds for client read-state reconciliation.",
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "UpstreamUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "before": {
              "description": "Exclusive publication-time cutoff from getReadAgeOptions.",
              "format": "datetime",
              "type": "string"
            },
            "scope": {
              "ref": "app.thesocialwire.appview.markAllRead#scope",
              "type": "ref"
            }
          },
          "required": [
            "scope",
            "before"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "entryIds": {
              "description": "Identifiers of stories marked by this request, for client read-state reconciliation.",
              "items": {
                "maxLength": 2048,
                "type": "string"
              },
              "type": "array"
            },
            "marked": {
              "minimum": 0,
              "type": "integer"
            },
            "readAt": {
              "format": "datetime",
              "type": "string"
            },
            "unreadCounts": {
              "ref": "#unreadCounts",
              "type": "ref"
            }
          },
          "required": [
            "marked",
            "entryIds",
            "readAt",
            "unreadCounts"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "unreadCounts": {
      "description": "Publication identifier to nonnegative integer unread count. If recounting fails after read marks commit, the procedure still succeeds with marked entryIds and an empty object here. Missing keys mean unknown: preserve existing counts until a later refresh rather than replacing them with zero.",
      "type": "object"
    }
  },
  "id": "app.thesocialwire.appview.markReadBefore",
  "lexicon": 1
}
```
