{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentio-dev/json-schema/mentio-dev-feed-schema.json",
  "title": "Feed",
  "description": "An RSS or Atom feed every keyword of the workspace reads.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentio-dev-feeds-api-openapi.yml#/components/schemas/Feed",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Feed id (fd_...)."
    },
    "url": {
      "type": "string",
      "description": "The feed itself (after redirects, or the one the page advertised): what is polled."
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "The feed's own title, when it has one."
    },
    "connectedAt": {
      "type": "string",
      "description": "When the workspace connected it."
    },
    "readingSince": {
      "type": "string",
      "description": "Nothing published before this is a live mention: the connection, or the last time its sign-in was added or removed (signed in and signed out, a post is read as two different posts, so the switch starts over rather than bill one twice)."
    },
    "auth": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "cookie",
            "header"
          ],
          "description": "cookie or header. The value is never shown."
        }
      },
      "required": [
        "type"
      ],
      "description": "The sign-in the feed is read with, or null for a public feed. PATCH { auth } replaces it, { auth: null } removes it."
    },
    "health": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ok",
            "failing"
          ],
          "description": "failing: the last 3 hourly reads or more failed (a feed.failing event went out); ok otherwise."
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "login_required",
            "login_expired",
            "blocked",
            "not_found",
            "not_a_feed",
            "unreachable",
            null
          ],
          "description": "Why the last read failed; null when it read well."
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "What the last failed read saw."
        },
        "failures": {
          "type": "integer",
          "minimum": 0,
          "description": "Failed hourly reads in a row."
        },
        "since": {
          "type": [
            "string",
            "null"
          ],
          "description": "While failing: since when."
        }
      },
      "required": [
        "status",
        "reason",
        "detail",
        "failures",
        "since"
      ],
      "description": "Whether the hourly read works."
    },
    "stats": {
      "type": "object",
      "properties": {
        "lastPolledAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "When the feed was last read; null until its first poll (within the hour)."
        },
        "emptyPolls": {
          "type": "integer",
          "minimum": 0,
          "description": "Polls in a row that brought nothing new; a feed that keeps reading empty may have moved."
        }
      },
      "required": [
        "lastPolledAt",
        "emptyPolls"
      ],
      "description": "How the hourly poll of this feed is going."
    }
  },
  "required": [
    "id",
    "url",
    "title",
    "connectedAt",
    "readingSince",
    "auth",
    "health",
    "stats"
  ]
}