{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-webhook-update-v3-schema.json",
  "title": "WebhookUpdateV3",
  "description": "Изменение подписки – передавайте только изменяемые поля.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-webhooks-api-openapi.yml#/components/schemas/WebhookUpdateV3",
  "properties": {
    "target": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Target",
      "description": "Новый адрес доставки."
    },
    "object_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "maxItems": 200,
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Object Ids",
      "description": "Новый список объектов."
    },
    "event_types": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "enum": [
              "reviews.new",
              "replies.new",
              "scrape.run.finished"
            ]
          },
          "type": "array",
          "maxItems": 10,
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Types",
      "description": "Новый набор событий."
    },
    "bucket_window": {
      "anyOf": [
        {
          "type": "string",
          "description": "Delivery cadence. `immediate` – one POST shortly after each scrape batch; `daily_<hour>` – one digest per day at the given UTC hour (0–23), e.g. `daily_9` = 09:00 UTC, `daily_14` = 14:00 UTC."
        },
        {
          "type": "null"
        }
      ],
      "title": "Bucket Window",
      "description": "Новое окно группировки."
    },
    "filters": {
      "anyOf": [
        {
          "$ref": "#/$defs/FiltersV2"
        },
        {
          "type": "null"
        }
      ],
      "description": "Новые фильтры."
    },
    "is_active": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Active",
      "description": "Включить или выключить подписку."
    }
  },
  "type": "object",
  "$defs": {
    "FiltersV2": {
      "properties": {
        "allowed_ratings": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Allowed Ratings"
        },
        "allowed_sources": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Allowed Sources"
        },
        "has_text": {
          "type": "boolean",
          "title": "Has Text",
          "default": false
        },
        "has_images": {
          "type": "boolean",
          "title": "Has Images",
          "default": false
        }
      },
      "type": "object",
      "title": "FiltersV2",
      "description": "Фильтры доставки; условия объединяются по AND."
    }
  }
}