{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-update-connector-filters-sync-request-schema.json",
  "title": "UpdateConnectorFiltersSyncRequest",
  "description": "Request to update filters and sync config (connector must be authenticated and inactive)",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-connector-configuration-api-openapi.yml#/components/schemas/UpdateConnectorFiltersSyncRequest",
  "type": "object",
  "properties": {
    "sync": {
      "$ref": "#/$defs/ConnectorSyncConfig"
    },
    "filters": {
      "$ref": "#/$defs/ConnectorFiltersConfig"
    },
    "baseUrl": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "ConnectorFiltersConfig": {
      "type": "object",
      "description": "Filter configuration to control what data is synced (sync filters and indexing filters)",
      "properties": {
        "sync": {
          "type": "object",
          "description": "Sync filter selections",
          "properties": {
            "values": {
              "type": "object",
              "description": "Selected filter values (keys are filter field names)",
              "additionalProperties": true
            }
          }
        },
        "indexing": {
          "type": "object",
          "description": "Indexing filter selections",
          "properties": {
            "values": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "ConnectorSyncConfig": {
      "type": "object",
      "description": "Synchronization configuration for a connector instance",
      "properties": {
        "selectedStrategy": {
          "type": "string",
          "enum": [
            "MANUAL",
            "SCHEDULED",
            "WEBHOOK",
            "REALTIME"
          ],
          "description": "Sync strategy: MANUAL (user-triggered), SCHEDULED (interval/cron), WEBHOOK (event-driven), REALTIME (WebSocket)",
          "default": "MANUAL"
        },
        "scheduledConfig": {
          "type": "object",
          "description": "Configuration for scheduled sync strategy",
          "properties": {
            "intervalMinutes": {
              "type": "integer",
              "description": "Sync interval in minutes",
              "minimum": 5,
              "default": 60
            },
            "cronExpression": {
              "type": "string",
              "description": "Cron expression for advanced scheduling"
            },
            "timezone": {
              "type": "string",
              "description": "Timezone for scheduled sync",
              "default": "UTC"
            }
          }
        },
        "webhookConfig": {
          "type": "object",
          "description": "Configuration for webhook-based sync",
          "properties": {
            "webhookUrl": {
              "type": "string",
              "description": "URL to receive webhook events (auto-generated)"
            },
            "events": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Subscribed event types"
            }
          }
        },
        "values": {
          "type": "object",
          "description": "Sync setting values specific to the connector",
          "additionalProperties": true
        },
        "customValues": {
          "type": "object",
          "description": "Custom sync values",
          "additionalProperties": true
        }
      }
    }
  }
}