{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-webhook-create-v3-schema.json",
  "title": "WebhookCreateV3",
  "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/WebhookCreateV3",
  "properties": {
    "target": {
      "type": "string",
      "maxLength": 500,
      "title": "Target",
      "description": "HTTPS-адрес, на который приходят события."
    },
    "object_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "maxItems": 200,
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Object Ids",
      "description": "Присылать события только по этим объектам. Не передано – по всем вашим."
    },
    "event_types": {
      "items": {
        "type": "string",
        "enum": [
          "reviews.new",
          "replies.new",
          "scrape.run.finished"
        ]
      },
      "type": "array",
      "maxItems": 10,
      "minItems": 1,
      "title": "Event Types",
      "description": "Какие события присылать."
    },
    "bucket_window": {
      "type": "string",
      "title": "Bucket Window",
      "description": "Как часто собирать события в одну доставку.",
      "default": "immediate"
    },
    "filters": {
      "$ref": "#/$defs/FiltersV2",
      "description": "Что именно присылать: оценки, площадки, наличие текста и картинок."
    }
  },
  "type": "object",
  "required": [
    "target",
    "event_types"
  ],
  "$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."
    }
  }
}