{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/octolens-com/json-schema/octolens-com-mention-schema.json",
  "title": "Mention",
  "description": "A single mention collected from a social platform. Canonical shape shared by `list_mentions` (MCP), `GET /api/v2/mentions` (REST), and the tRPC feed.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/octolens-com-openapi.json#/components/schemas/Mention",
  "type": "object",
  "properties": {
    "id": {
      "description": "Internal post id (numeric). Pass as `postId` to `PATCH /api/v2/mentions/{sourceId}`.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "sourceId": {
      "description": "Stable composite key for the mention across the collection pipeline (e.g. `reddit_t3_1abc234`). Use this as the path parameter for `PATCH /api/v2/mentions/{sourceId}` and as the `sourceId` field on `POST /api/v2/feedback`.",
      "type": "string"
    },
    "url": {
      "description": "Canonical URL to the original post.",
      "type": "string"
    },
    "title": {
      "description": "Post title. `null` for platforms that don't have titles (tweets, etc.).",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "body": {
      "description": "Post body / content. May be empty or `null` for posts with no text.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source": {
      "$ref": "#/$defs/MentionSource"
    },
    "timestamp": {
      "description": "When the mention was posted. Tinybird-style datetime string (`YYYY-MM-DD HH:mm:ss.SSS`, UTC, no `Z` suffix).",
      "type": "string"
    },
    "author": {
      "description": "Handle/username of the mention's author. `null` if not captured.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "authorName": {
      "description": "Display name of the author, when distinct from the handle.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "authorAvatar": {
      "description": "URL to the author's avatar image. `null` if not captured.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "authorUrl": {
      "description": "URL to the author's profile page. `null` if not captured.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "authorFollowers": {
      "description": "Author's follower count at collection time. `null` if not available.",
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "relevance": {
      "description": "Relevance classification. Always one of `relevant` / `not_relevant` (unscored posts collapse to `not_relevant`).",
      "$ref": "#/$defs/MentionRelevance"
    },
    "relevanceComment": {
      "description": "Free-text justification the AI produced for its relevance verdict, when available.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "sentiment": {
      "description": "Sentiment classification. `null` until the AI has scored this mention. Workspaces on the new relevance engine (gradual rollout) receive sentiment for the company: `Positive` = good news for your company, e.g. a competitor criticised.",
      "anyOf": [
        {
          "$ref": "#/$defs/MentionSentiment"
        },
        {
          "type": "null"
        }
      ]
    },
    "emotion": {
      "description": "The author's emotion. `null` until the AI has scored this mention, for mentions scored before emotion detection existed, and for workspaces not yet on the new relevance engine (gradual rollout).",
      "anyOf": [
        {
          "$ref": "#/$defs/MentionEmotion"
        },
        {
          "type": "null"
        }
      ]
    },
    "language": {
      "description": "Detected language as a full lowercase English name (`english`, `spanish`, …; `undetermined` when detection fails) — never an ISO 639-1 code.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "tags": {
      "description": "AI-assigned topic tags applied to the mention.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/MentionTag"
      }
    },
    "keywords": {
      "description": "Monitored keywords this mention matched, with id + display text.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/MentionKeyword"
      }
    },
    "engaged": {
      "description": "Whether a workspace member has marked this mention as engaged-with (replied, liked on-platform, etc.).",
      "type": "boolean"
    },
    "review": {
      "description": "Direct-review metadata. Omitted for ordinary social/web mentions and present for Trustpilot, Google Reviews, App Store, and Google Play reviews.",
      "$ref": "#/$defs/MentionReview"
    },
    "isReply": {
      "description": "`true` for a detected reply or comment on a supported threaded platform (X, Reddit, Bluesky, or Hacker News). Legacy mentions default to `false` because there was no backfill.",
      "type": "boolean"
    },
    "relevanceScore": {
      "description": "Raw internal relevance score (0 = high, 1 = medium, 2 = low). The public `relevance` field is derived from this. Optional; not all consumers populate it.",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "feedbackRelevant": {
      "description": "User feedback on this mention's relevance: `1` for thumbs up, `-1` for thumbs down, `0` for no feedback. Optional.",
      "type": "number"
    },
    "imageUrl": {
      "description": "URL to a preview image attached to the post, when present.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "keywordId": {
      "description": "Denormalized first-matched keyword id. Convenience for callers that need a single keyword reference without scanning `keywords[]`.",
      "type": "number"
    },
    "engagementMetrics": {
      "description": "Latest public engagement counters for this platform. Metric names are source-specific; unavailable counters are omitted rather than reported as zero.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      }
    },
    "engagementObservedAt": {
      "description": "UTC time at which the public engagement counters were last observed.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "sourceId",
    "url",
    "title",
    "body",
    "source",
    "timestamp",
    "author",
    "authorName",
    "authorAvatar",
    "authorUrl",
    "authorFollowers",
    "relevance",
    "relevanceComment",
    "sentiment",
    "emotion",
    "language",
    "tags",
    "keywords",
    "engaged",
    "isReply"
  ],
  "additionalProperties": false,
  "$defs": {
    "MentionEmotion": {
      "description": "AI-judged emotion of the author in the post, independent of `sentiment`: on the new relevance engine, a post furious at a competitor is `Positive` for you and `angry` here. Low-relevance mentions carry `neutral`.",
      "type": "string",
      "enum": [
        "excited",
        "satisfied",
        "curious",
        "confused",
        "frustrated",
        "angry",
        "disappointed",
        "concerned",
        "neutral"
      ]
    },
    "MentionKeyword": {
      "description": "Keyword the mention matched, with its display text.",
      "type": "object",
      "properties": {
        "id": {
          "description": "Tracked keyword id.",
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "keyword": {
          "description": "Keyword text.",
          "type": "string"
        },
        "keywordTag": {
          "description": "Keyword's classification tag (e.g. `own_brand`, `competitor`, `industry_term`). Internal; ignored by external consumers.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "keyword"
      ],
      "additionalProperties": false
    },
    "MentionRelevance": {
      "description": "AI-judged relevance classification. `relevant` = high or medium confidence (score 0 or 1). `not_relevant` = low confidence or not yet scored.",
      "type": "string",
      "enum": [
        "relevant",
        "not_relevant"
      ]
    },
    "MentionReview": {
      "description": "Provider metadata present when this mention is a direct review.",
      "type": "object",
      "properties": {
        "rating": {
          "description": "Rating left by the reviewer.",
          "type": "number",
          "minimum": 0
        },
        "ratingMax": {
          "description": "Maximum value of the provider's rating scale.",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "verified": {
          "description": "Whether the provider marks the review as verified.",
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "response": {
          "description": "Latest owner/developer response, when supplied by the provider.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "responseAt": {
          "description": "UTC timestamp of the latest owner/developer response.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "targetName": {
          "description": "Configured business or app name this review belongs to.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "rating",
        "ratingMax",
        "verified",
        "response",
        "responseAt",
        "targetName"
      ],
      "additionalProperties": false
    },
    "MentionSentiment": {
      "description": "AI-judged sentiment of the mention. Workspaces on the new relevance engine (gradual rollout) receive sentiment for the company: `Positive` = good news for your company, e.g. a competitor criticised.",
      "type": "string",
      "enum": [
        "Positive",
        "Neutral",
        "Negative"
      ]
    },
    "MentionSource": {
      "description": "Platform the mention was collected from. Lowercase values like `reddit`, `twitter`, `linkedin`. Historical rows may be uppercase.",
      "type": "string"
    },
    "MentionTag": {
      "description": "AI-assigned topic tag. Applied by the relevance worker during scoring. A post can carry multiple tags.",
      "type": "string",
      "enum": [
        "buy_intent",
        "competitor_mention",
        "customer_testimonial",
        "promotional_post",
        "own_brand_mention",
        "industry_insights",
        "hiring",
        "event",
        "product_question",
        "pricing",
        "churn_intent",
        "launch_announcement",
        "bug_report",
        "user_feedback",
        "ai_generated"
      ]
    }
  }
}