{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-bulk-links-response-v3-schema.json",
  "title": "BulkLinksResponseV3",
  "description": "Итог массового добавления ссылок в объект.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-links-api-openapi.yml#/components/schemas/BulkLinksResponseV3",
  "properties": {
    "object_id": {
      "type": "integer",
      "title": "Object Id",
      "description": "Объект, в который добавлялись ссылки."
    },
    "link_results": {
      "items": {
        "$ref": "#/$defs/LinkResultV3"
      },
      "type": "array",
      "title": "Link Results",
      "description": "Итог по каждой переданной ссылке."
    }
  },
  "type": "object",
  "required": [
    "object_id",
    "link_results"
  ],
  "$defs": {
    "LinkResultV3": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url",
          "description": "URL ссылки, к которой относится результат."
        },
        "link_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Link Id",
          "description": "Идентификатор созданной ссылки. `null` при ошибке."
        },
        "source_slug": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Slug",
          "description": "Машинное имя площадки, определённой по URL (`2gis`, `yandex_travel`). `null`, если определить не удалось."
        },
        "link_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Link Name",
          "description": "Название ссылки, как оно сохранено."
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error",
          "description": "Причина, по которой ссылка не добавлена. `null` при успехе."
        },
        "error_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Code",
          "description": "Машинная причина отказа – по ней и следует ветвиться: `source_not_detected`, `source_url_invalid`, `source_requires_upgrade`, `source_already_linked` (площадка в объекте может быть только одна), `link_already_added`. `null` при успехе."
        }
      },
      "type": "object",
      "required": [
        "url"
      ],
      "title": "LinkResultV3",
      "description": "Итог добавления одной ссылки – успех с `link_id` либо `error`."
    }
  }
}