{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/viralnote-app/json-schema/viralnote-app-ai-visibility-action-schema.json",
  "title": "AiVisibilityAction",
  "description": "One fix in the queue: a page to publish, a Reddit thread to reply to, or a site to pitch",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viralnote-app-openapi.json#/components/schemas/AiVisibilityAction",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "page",
        "reddit",
        "outreach"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "drafted",
        "done",
        "dismissed"
      ]
    },
    "title": {
      "type": "string"
    },
    "promptIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "evidence": {
      "type": "object",
      "properties": {
        "competitorsNamed": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "count": {
                "type": "integer"
              }
            }
          }
        },
        "engines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "brandRate": {
          "type": [
            "number",
            "null"
          ]
        },
        "citedCount": {
          "type": "integer"
        },
        "severity": {
          "type": "number"
        }
      }
    },
    "target": {
      "type": "object",
      "properties": {
        "promptText": {
          "type": "string"
        },
        "cluster": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "urlTitle": {
          "type": "string"
        }
      }
    },
    "draft": {
      "description": "A page draft (title, slug, metaDescription, markdown, faqJsonLd) or a Reddit reply (text)",
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "title": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "metaDescription": {
          "type": "string"
        },
        "markdown": {
          "type": "string"
        },
        "faqJsonLd": {
          "type": "string"
        },
        "text": {
          "type": "string"
        }
      }
    },
    "draftedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "liveUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "baselineBrandRate": {
      "type": [
        "number",
        "null"
      ],
      "description": "Pages: the brand's rate on the question when the fix was found"
    },
    "currentBrandRate": {
      "type": [
        "number",
        "null"
      ],
      "description": "Pages: the brand's rate on the question in the latest check"
    },
    "citation": {
      "type": [
        "object",
        "null"
      ],
      "description": "Set once a check finds the fix cited: a page by its liveUrl, or a pitched site or Reddit thread cited in an answer that names the brand",
      "properties": {
        "firstCitedAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastCitedRunId": {
          "type": "string"
        },
        "lastCitedCount": {
          "type": "integer"
        },
        "lastCitedEngines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "liveSince": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the fix went live: its liveUrl was saved (pages) or it was marked done (pitches and Reddit replies)"
    },
    "checksSinceLive": {
      "type": "integer",
      "description": "Checks since liveSince that looked for the fix, cited or not"
    },
    "firstSeenRunId": {
      "type": "string"
    },
    "lastSeenRunId": {
      "type": "string"
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}