# fyi.opensocial.getUnread

> What's new for the caller in each tab that says what's new in it (its news), in every group on this host they're in: when someone else last added something there, and how much there is for them that they haven't seen. Whether the newest is new to them is theirs to say, from how far they've read, which only they keep.

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

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getUnread)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getUnread/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getUnread/analytics)

## Query (`fyi.opensocial.getUnread`)

Type: query · GET

### Parameters (query string)

- `group` (string · did): That group's only.

### Output (application/json)

- `groups` (array, required)
  - `items` (ref)
    - Reference: `#groupUnread`

## #groupUnread (`fyi.opensocial.getUnread#groupUnread`)

Type: object

### Properties

- `group` (string · did, required)
- `joinedAt` (string · datetime, required): When the caller joined: in a place they've never read, what came after it is new.
- `places` (array, required)
  - `items` (ref)
    - Reference: `#placeUnread`

## #placeUnread (`fyi.opensocial.getUnread#placeUnread`)

Type: object

### Properties

- `channel` (string, required): The channel's slug.
- `forYou` (integer, required): How many things there that answer something of the caller's, or name them, they haven't seen.
  - Constraints: minimum: 0
- `newest` (string · datetime): When the host had the newest thing someone else added there.
- `room` (string · at-uri): In a chat, the record its room is about. Without one, the space as a whole.
- `space` (string · at-uri, required)
- `tab` (string, required): The tab's slug.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "groupUnread": {
      "properties": {
        "group": {
          "format": "did",
          "type": "string"
        },
        "joinedAt": {
          "description": "When the caller joined: in a place they've never read, what came after it is new.",
          "format": "datetime",
          "type": "string"
        },
        "places": {
          "items": {
            "ref": "#placeUnread",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "group",
        "joinedAt",
        "places"
      ],
      "type": "object"
    },
    "main": {
      "description": "What's new for the caller in each tab that says what's new in it (its news), in every group on this host they're in: when someone else last added something there, and how much there is for them that they haven't seen. Whether the newest is new to them is theirs to say, from how far they've read, which only they keep.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "groups": {
              "items": {
                "ref": "#groupUnread",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "groups"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "group": {
            "description": "That group's only.",
            "format": "did",
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    },
    "placeUnread": {
      "properties": {
        "channel": {
          "description": "The channel's slug.",
          "type": "string"
        },
        "forYou": {
          "description": "How many things there that answer something of the caller's, or name them, they haven't seen.",
          "minimum": 0,
          "type": "integer"
        },
        "newest": {
          "description": "When the host had the newest thing someone else added there.",
          "format": "datetime",
          "type": "string"
        },
        "room": {
          "description": "In a chat, the record its room is about. Without one, the space as a whole.",
          "format": "at-uri",
          "type": "string"
        },
        "space": {
          "format": "at-uri",
          "type": "string"
        },
        "tab": {
          "description": "The tab's slug.",
          "type": "string"
        }
      },
      "required": [
        "channel",
        "tab",
        "space",
        "forYou"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.getUnread",
  "lexicon": 1
}
```
