{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-object-v3-schema.json",
  "title": "ObjectV3",
  "description": "Объект – единица бизнеса, отзывы по которой собираются со всех площадок.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-openapi.json#/components/schemas/ObjectV3",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id",
      "description": "Идентификатор объекта."
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Название объекта."
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active",
      "description": "Включён ли объект. Выключенный не отдаёт отзывы и аналитику и не собирается, но остаётся у вас и продолжает занимать место в тарифе."
    },
    "scrape_status": {
      "$ref": "#/$defs/ObjectScrapeStatus",
      "description": "Сводный статус сбора по включённым ссылкам объекта: `pending` / `in_progress` / `success` / `partial` / `failed`."
    },
    "last_scraped_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Scraped At",
      "description": "Последний сбор по объекту (UTC, ISO 8601)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Момент создания объекта (UTC, ISO 8601)."
    },
    "links": {
      "items": {
        "$ref": "#/$defs/LinkV3"
      },
      "type": "array",
      "title": "Links",
      "description": "Ссылки объекта на разных площадках.",
      "default": []
    },
    "is_demo": {
      "type": "boolean",
      "title": "Is Demo",
      "description": "Пример, который мы положили в кабинет при регистрации. Место в тарифе не занимает; исчезает с первым своим объектом или первой оплатой, удалить можно как обычный объект.",
      "default": false
    },
    "review_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Review Count",
      "description": "Сколько отзывов объекта доступно вам сейчас: по включённым ссылкам, без удалённых на площадке, в пробном периоде – в пределах его окна. Скрытые и закреплённые через API здесь не вычитаются, поэтому `total` у `GET /v3/reviews?object_id=…` может быть меньше на их число. Есть в списке объектов и в `GET /v3/objects/{object_id}`; в ответах на изменение – `null`."
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "is_active",
    "scrape_status",
    "created_at"
  ],
  "$defs": {
    "LinkV3": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id",
          "description": "Идентификатор ссылки."
        },
        "url": {
          "type": "string",
          "title": "Url",
          "description": "URL страницы объекта на площадке."
        },
        "source_id": {
          "type": "integer",
          "title": "Source Id",
          "description": "Идентификатор площадки ссылки (см. `GET /v3/sources`)."
        },
        "link_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Link Name",
          "description": "Своё название ссылки внутри объекта, если задано."
        },
        "auto_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Auto Name",
          "description": "Название, определённое нами по ссылке, с подписью площадки через двоеточие. Показывать стоит `link_name`, если задано, иначе `auto_name`."
        },
        "is_active": {
          "type": "boolean",
          "title": "Is Active",
          "description": "Включена ли ссылка в автосбор отзывов."
        },
        "scrape_status": {
          "$ref": "#/$defs/ScrapeStatus",
          "description": "Статус последнего сбора: `pending` / `in_progress` / `success` / `failed`."
        },
        "scrape_error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scrape Error",
          "description": "Текст ошибки последнего неудачного сбора. `null`, когда сбор успешен."
        },
        "last_scraped_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Scraped At",
          "description": "Момент последнего сбора по ссылке (UTC, ISO 8601)."
        },
        "last_scraped_review_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Scraped Review Date",
          "description": "Дата публикации самого свежего собранного отзыва по ссылке."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "Момент добавления ссылки в объект (UTC, ISO 8601)."
        }
      },
      "type": "object",
      "required": [
        "id",
        "url",
        "source_id",
        "is_active",
        "scrape_status",
        "created_at"
      ],
      "title": "LinkV3",
      "description": "Ссылка объекта на одной площадке."
    },
    "ObjectScrapeStatus": {
      "type": "string",
      "enum": [
        "pending",
        "in_progress",
        "success",
        "partial",
        "failed"
      ],
      "title": "ObjectScrapeStatus",
      "description": "Сводный статус сбора по включённым ссылкам объекта."
    },
    "ScrapeStatus": {
      "type": "string",
      "enum": [
        "pending",
        "in_progress",
        "success",
        "failed"
      ],
      "title": "ScrapeStatus",
      "description": "Статус последнего сбора отзывов по ссылке.\n\n    \n    "
    }
  }
}