{
  "lexicon": 1,
  "id": "chat.bsky.convo.getUnreadCounts",
  "defs": {
    "main": {
      "type": "query",
      "description": "Returns unread conversation counts for conversations that are unlocked, not muted, split by convo status. Direct convos are excluded when a block relationship exists between the actor and the other member, or when the other member's account is deleted or deactivated. Group convos are considered unread if they have unread join request counts.",
      "parameters": {
        "type": "params",
        "properties": {
          "includeGroupChats": {
            "type": "boolean",
            "default": true,
            "description": "When false, group convos are excluded from the counts."
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["unreadAcceptedConvos", "unreadRequestConvos"],
          "properties": {
            "unreadAcceptedConvos": {
              "type": "integer",
              "description": "Number of unread, unlocked accepted convos. Counts convos with unread messages and unread join requests. Capped at 100, where 100 means more than 99."
            },
            "unreadRequestConvos": {
              "type": "integer",
              "description": "Number of unread, unlocked request convos. Includes convos with unread messages, but not with unread join request, since only the owner of a group has join requests to read, and the group would necessarily be accepted. Capped at 100, where 100 means more than 99."
            }
          }
        }
      }
    }
  }
}

