{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alphaai/json-schema/alphaai-ticker-insider-trades-schema.json",
  "title": "TickerInsiderTrades",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alphaai-symbols-api-openapi.yml#/components/schemas/TickerInsiderTrades",
  "type": "object",
  "required": [
    "ticker",
    "events",
    "next_cursor"
  ],
  "properties": {
    "ticker": {
      "type": "string"
    },
    "coverage_start": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Earliest recorded transaction date for this ticker; charts should not claim history from before it. `null` when nothing is recorded."
    },
    "summary": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/InsiderTradesSummary"
        }
      ],
      "description": "First page only; `null` on cursor pages."
    },
    "series": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/InsiderTradesMonthBucket"
      },
      "description": "Calendar-month buckets, zero-filled up to the current month and capped to the trailing 12 months. First page only; `null` on cursor pages."
    },
    "series_weekly": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/InsiderTradesWeekBucket"
      },
      "description": "ISO-week buckets keyed by their Monday, zero-filled up to the current week over the same 12-month horizon. First page only; `null` on cursor pages."
    },
    "chart_events": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/InsiderTradeEvent"
      },
      "description": "Every event of the trailing 12 months, both sides, independent of the paginated list below — a chart never shows a bar without its marks. First page only; `null` on cursor pages."
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InsiderTradeEvent"
      },
      "description": "One page of the event history, newest first; honors `side`."
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next (older) page; `null` at the end of the recorded history."
    }
  },
  "$defs": {
    "InsiderTradeEvent": {
      "type": "object",
      "description": "One Form 4 economic event, same folding as the feed's `InsiderEvent` (a filing's whole tranche group: `shares` and `total_value_usd` are group sums, `avg_price_usd` is value-weighted over priced tranches, money and share fields are decimal STRINGS). Differences from the feed block: `side` here is only `buy` or `sell` (D counts as sell, see the endpoint description), and each event adds its stake impact, tranche count and the link to our enriched article.",
      "required": [
        "side",
        "transaction_code",
        "ownership_form",
        "shares",
        "tranche_count",
        "is_10b5_1",
        "late_filing",
        "insider_name",
        "insider_title",
        "is_officer",
        "is_director",
        "is_ten_percent_owner",
        "transaction_date",
        "filed_at",
        "news_uid",
        "news_title",
        "news_published",
        "has_article"
      ],
      "properties": {
        "side": {
          "type": "string",
          "enum": [
            "buy",
            "sell"
          ],
          "description": "Value-flow label; `transaction_code` carries the raw code."
        },
        "transaction_code": {
          "type": "string",
          "description": "Raw SEC Form 4 transaction code (`P`, `S`, `D`)."
        },
        "ownership_form": {
          "type": "string",
          "enum": [
            "D",
            "I"
          ],
          "description": "Direct or indirect holding pool."
        },
        "security_title": {
          "type": "string",
          "description": "Security class from the filing; empty when unreported."
        },
        "shares": {
          "type": "string",
          "description": "Total shares across the event's tranches (decimal string)."
        },
        "avg_price_usd": {
          "type": [
            "string",
            "null"
          ],
          "description": "Value-weighted average price per share over priced tranches. `null` when the filing prices no tranche."
        },
        "total_value_usd": {
          "type": [
            "string",
            "null"
          ],
          "description": "Total USD value across priced tranches (a lower bound when some tranches are unpriced). `null` when no tranche is priced."
        },
        "tranche_count": {
          "type": "integer",
          "description": "Fills folded into this event (a 10b5-1 ladder files many)."
        },
        "stake_change_pct": {
          "type": [
            "string",
            "null"
          ],
          "description": "Percent of the pre-event position this event moved, as a decimal string; sells are negative (\"-26.0\" = sold 26% of the stake). `null` when the pre-event position cannot be reconstructed."
        },
        "is_10b5_1": {
          "type": "boolean",
          "description": "True when any tranche executed under a pre-arranged 10b5-1 plan."
        },
        "late_filing": {
          "type": "boolean",
          "description": "The filing missed the SEC's two-business-day deadline, computed the same way as the feed's `InsiderEvent.late_filing`."
        },
        "insider_name": {
          "type": "string"
        },
        "insider_title": {
          "type": "string"
        },
        "is_officer": {
          "type": "boolean"
        },
        "is_director": {
          "type": "boolean"
        },
        "is_ten_percent_owner": {
          "type": "boolean"
        },
        "transaction_date": {
          "type": "string",
          "format": "date",
          "description": "Date of the group's last fill (a ladder can span days)."
        },
        "filed_at": {
          "type": "string",
          "format": "date-time",
          "description": "When EDGAR accepted the filing (UTC)."
        },
        "news_uid": {
          "type": "string",
          "description": "Uid of the enriched news row fronting this event; matches `original.uid` in the feeds."
        },
        "news_title": {
          "type": "string"
        },
        "news_published": {
          "type": "string",
          "format": "date-time",
          "description": "Publish time of the fronting news row."
        },
        "has_article": {
          "type": "boolean",
          "description": "Whether the alphai.io article page for `news_uid` exists. Events ingested by the historical backfill have no enriched article; render those without a link."
        }
      }
    },
    "InsiderTradesMonthBucket": {
      "type": "object",
      "required": [
        "month",
        "buy_count",
        "sell_count",
        "buy_value_usd",
        "sell_value_usd"
      ],
      "properties": {
        "month": {
          "type": "string",
          "description": "Calendar month, `YYYY-MM`."
        },
        "buy_count": {
          "type": "integer"
        },
        "sell_count": {
          "type": "integer"
        },
        "buy_value_usd": {
          "type": "string",
          "description": "Decimal string in USD; `\"0\"` for a quiet side."
        },
        "sell_value_usd": {
          "type": "string"
        }
      }
    },
    "InsiderTradesSummary": {
      "type": "object",
      "required": [
        "last_3m",
        "last_12m",
        "all_time",
        "top_insiders"
      ],
      "properties": {
        "last_3m": {
          "$ref": "#/$defs/InsiderTradesWindow"
        },
        "last_12m": {
          "$ref": "#/$defs/InsiderTradesWindow"
        },
        "all_time": {
          "$ref": "#/$defs/InsiderTradesWindow"
        },
        "top_insiders": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InsiderTradesTopInsider"
          },
          "description": "Most active reporters of the last 12 months, at most five."
        }
      }
    },
    "InsiderTradesTopInsider": {
      "type": "object",
      "required": [
        "name",
        "title",
        "event_count"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "title": {
          "type": "string",
          "description": "Officer title from the filing; empty when the filer reports as a director only."
        },
        "event_count": {
          "type": "integer"
        },
        "net_value_usd": {
          "type": [
            "string",
            "null"
          ],
          "description": "Buys minus sells in USD over the last 12 months, as a decimal string; positive means a net buyer."
        }
      }
    },
    "InsiderTradesWeekBucket": {
      "type": "object",
      "required": [
        "week_start",
        "buy_count",
        "sell_count",
        "buy_value_usd",
        "sell_value_usd"
      ],
      "properties": {
        "week_start": {
          "type": "string",
          "format": "date",
          "description": "Monday of the ISO week."
        },
        "buy_count": {
          "type": "integer"
        },
        "sell_count": {
          "type": "integer"
        },
        "buy_value_usd": {
          "type": "string"
        },
        "sell_value_usd": {
          "type": "string"
        }
      }
    },
    "InsiderTradesWindow": {
      "type": "object",
      "description": "Event-level aggregates over one rolling window. Counts here are grouped EVENTS, not tranches, so they run lower than the transaction counts of `/api/symbols/{ticker}/insider-summary/`.",
      "required": [
        "buy_count",
        "sell_count",
        "unique_insiders",
        "pct_10b5_1"
      ],
      "properties": {
        "buy_count": {
          "type": "integer"
        },
        "sell_count": {
          "type": "integer"
        },
        "buy_value_usd": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal string in USD; null when the window has no priced buys."
        },
        "sell_value_usd": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal string in USD; null when the window has no priced sells."
        },
        "unique_insiders": {
          "type": "integer",
          "description": "Distinct reporting owners in the window."
        },
        "pct_10b5_1": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Share of the window's events executed under a pre-arranged 10b5-1 plan, in percent."
        }
      }
    }
  }
}