{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ploid/json-schema/ploid-monitor-item-schema.json",
  "title": "MonitorItem",
  "description": "Webhook events: monitor.run.completed, monitor.run.failed, monitor.run.skipped. monitor.run.completed is sent only when a run emits items and carries up to 100 of them.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ploid-monitors-api-openapi.yml#/components/schemas/MonitorItem",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "monitor_item"
    },
    "id": {
      "type": "string"
    },
    "monitor_id": {
      "type": "string"
    },
    "run_id": {
      "type": "string"
    },
    "platform": {
      "type": "string",
      "enum": [
        "linkedin",
        "x",
        "instagram",
        "tiktok"
      ]
    },
    "event": {
      "type": "string",
      "enum": [
        "post.created",
        "engagement.created",
        "profile.changed",
        "company.changed",
        "job.posted"
      ]
    },
    "target": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": [
            "string",
            "null"
          ]
        },
        "identifier": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "url": {
      "type": [
        "string",
        "null"
      ]
    },
    "occurred_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "relevance": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "score": {
          "type": "number"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "output": {
      "description": "Object matching the monitor's output schema, or null when extraction failed."
    },
    "output_error": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": "object",
      "additionalProperties": true,
      "description": "Normalized text, author, metrics and event details."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}