{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parallel-ai/json-schema/parallel-ai-update-monitor-request-schema.json",
  "title": "UpdateMonitorRequest",
  "description": "Request body to update a monitor.\n\nOnly fields that are explicitly included in the request body are updated.\nPass `null` for `webhook` or `metadata` to clear those fields. To update\ntype-specific settings on an `event_stream` monitor, include `type` and\n`settings`; pass `settings.query` to update the prompt, or `null` for\n`settings.advanced_settings` to clear it. If `settings` is provided, `type`\nis required to identify the settings shape. The request must still include\nat least one field to update; empty updates fail validation.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parallel-ai-monitor-api-openapi.yml#/components/schemas/UpdateMonitorRequest",
  "properties": {
    "type": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "event_stream",
            "snapshot"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Type",
      "description": "Type of the monitor being updated. Required when `settings` is provided; must be `event_stream` (snapshot monitors have no updatable type-specific settings)."
    },
    "frequency": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Frequency",
      "description": "Frequency of the monitor. Format: '<number><unit>' where unit is 'h' (hours), 'd' (days), or 'w' (weeks). Must be between 1h and 30d (inclusive)."
    },
    "webhook": {
      "anyOf": [
        {
          "$ref": "#/$defs/MonitorWebhook"
        },
        {
          "type": "null"
        }
      ],
      "description": "Webhook to receive notifications about the monitor's execution."
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata",
      "description": "User-provided metadata stored with the monitor and echoed back in webhook notifications and GET responses, so you can map events to objects in your application. Keys: max 16 chars; values: max 512 chars."
    },
    "settings": {
      "anyOf": [
        {
          "$ref": "#/$defs/UpdateMonitorEventStreamSettings"
        },
        {
          "type": "null"
        }
      ],
      "description": "Type-specific settings to update. Only valid when `type` is `event_stream`. Pass `settings.query` to update the prompt, or `null` for `settings.advanced_settings` to clear it."
    }
  },
  "type": "object",
  "$defs": {
    "AdvancedMonitorSettings": {
      "properties": {
        "source_policy": {
          "anyOf": [
            {
              "$ref": "#/$defs/SourcePolicy"
            },
            {
              "type": "null"
            }
          ],
          "description": "Domain filtering preferences: preferred and disallowed domains for monitor search results."
        },
        "location": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Location",
          "description": "ISO 3166-1 alpha-2 country code for geo-targeted monitor results."
        }
      },
      "type": "object",
      "title": "AdvancedMonitorSettings",
      "description": "Advanced monitor configuration."
    },
    "MonitorWebhook": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url",
          "description": "URL for the webhook."
        },
        "event_types": {
          "items": {
            "type": "string",
            "enum": [
              "monitor.event.detected",
              "monitor.execution.completed",
              "monitor.execution.failed"
            ]
          },
          "type": "array",
          "title": "Event Types",
          "description": "Event types to send the webhook notifications for."
        }
      },
      "type": "object",
      "required": [
        "url"
      ],
      "title": "MonitorWebhook",
      "description": "Webhook configuration for a monitor."
    },
    "SourcePolicy": {
      "properties": {
        "include_domains": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Include Domains",
          "description": "List of domains to restrict the results to. If specified, only sources from these domains will be included. Accepts plain domains (e.g., example.com, subdomain.example.gov) or bare domain extension starting with a period (e.g., .gov, .edu, .co.uk). The combined number of domains in include_domains and exclude_domains cannot exceed 200."
        },
        "exclude_domains": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Exclude Domains",
          "description": "List of domains to exclude from results. If specified, sources from these domains will be excluded. Accepts plain domains (e.g., example.com, subdomain.example.gov) or bare domain extension starting with a period (e.g., .gov, .edu, .co.uk). The combined number of domains in include_domains and exclude_domains cannot exceed 200."
        },
        "after_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "After Date",
          "description": "Optional start date for filtering search results. Results will be limited to content published on or after this date. Provided as an RFC 3339 date string (YYYY-MM-DD)."
        }
      },
      "type": "object",
      "title": "SourcePolicy",
      "description": "Source policy for web search results.\n\nThis policy governs which sources are allowed/disallowed in results."
    },
    "UpdateMonitorEventStreamSettings": {
      "properties": {
        "query": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Query",
          "description": "Updated search query for the monitor. Use this for minor updates to prompts and instructions only. Major changes to the query may lead to unexpected results in change detection, as the monitor compares new results with what was previously seen."
        },
        "advanced_settings": {
          "anyOf": [
            {
              "$ref": "#/$defs/AdvancedMonitorSettings"
            },
            {
              "type": "null"
            }
          ],
          "description": "Advanced monitor configuration."
        }
      },
      "type": "object",
      "title": "UpdateMonitorEventStreamSettings",
      "description": "Type-specific update settings for an `event_stream` monitor."
    }
  }
}