{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/socialbu-com/json-schema/socialbu-com-listening-stream-schema.json",
  "title": "ListeningStream",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/socialbu-com-openapi.yml#/components/schemas/ListeningStream",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique SocialBu listening stream ID."
    },
    "name": {
      "type": "string",
      "description": "Stream name."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional stream description."
    },
    "query": {
      "type": "array",
      "description": "Shared query terms used across sources unless a source-specific query is configured.",
      "items": {
        "type": "string"
      }
    },
    "sources": {
      "type": "array",
      "description": "Source keys enabled for this stream.",
      "items": {
        "type": "string"
      }
    },
    "platform_queries": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "Source-specific query terms keyed by source. Instagram keywords and phrases become one hashtag per query."
    },
    "is_active": {
      "type": "boolean",
      "description": "Whether scheduled fetching is enabled for the stream."
    },
    "can_view": {
      "type": "boolean",
      "description": "Whether the authenticated user can view the stream."
    },
    "can_manage": {
      "type": "boolean",
      "description": "Whether the authenticated user can manage the stream, including changing sharing."
    },
    "team": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "notify_daily_digest": {
      "type": "boolean",
      "description": "Whether daily digest notifications are enabled."
    },
    "digest_recipient_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "ai_analysis": {
      "type": "object",
      "additionalProperties": true
    },
    "rss_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "embed_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "embed_urls": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ],
        "format": "uri"
      }
    },
    "last_fetched_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Start time of the last completed collection. Null until a collection completes."
    },
    "next_fetch_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Next scheduled collection check. An active stream with null is due for scheduling."
    },
    "last_item_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "total_items_found": {
      "type": "integer"
    },
    "item_count": {
      "type": [
        "integer",
        "null"
      ]
    },
    "active_count": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}