{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gen-pro/json-schema/gen-pro-watchlist-schema.json",
  "title": "Watchlist",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gen-pro-watchlists-api-openapi.yml#/components/schemas/Watchlist",
  "type": "object",
  "required": [
    "id",
    "user_id",
    "agent_id",
    "name",
    "intent_active",
    "sources"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "user_id": {
      "type": "string"
    },
    "agent_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "intent_active": {
      "type": "boolean"
    },
    "project_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "project_error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Read-only. Last project-link sync error, if any."
    },
    "conversation_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_by_run_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WatchSource"
      }
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "WatchSource": {
      "allOf": [
        {
          "$ref": "#/$defs/WatchSourceInput"
        },
        {
          "type": "object",
          "required": [
            "id",
            "watchlist_id",
            "agent_id",
            "intent_active"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "watchlist_id": {
              "type": "string"
            },
            "agent_id": {
              "type": "string"
            },
            "intent_active": {
              "type": "boolean"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        }
      ]
    },
    "WatchSourceInput": {
      "type": "object",
      "required": [
        "platform",
        "target_type",
        "target_value"
      ],
      "properties": {
        "platform": {
          "type": "string",
          "description": "e.g. \"tiktok\", \"instagram\", \"youtube\""
        },
        "target_type": {
          "type": "string",
          "enum": [
            "account",
            "hashtag",
            "keyword"
          ]
        },
        "target_value": {
          "type": "string",
          "description": "@handle, hashtag name (no #), or keyword text"
        },
        "original_display_value": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional original display form (e.g. \"#glassskin\" or \"@drunkelephant\")"
        }
      }
    }
  }
}