{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/akeda-ru/json-schema/akeda-ru-calendar-event-create-schema.json",
  "title": "CalendarEventCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akeda-ru-calendar-api-openapi.yml#/components/schemas/CalendarEventCreate",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "title",
    "starts_at",
    "ends_at"
  ],
  "properties": {
    "owner": {
      "type": "integer",
      "format": "int64",
      "minimum": 1
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string"
    },
    "location": {
      "type": "string"
    },
    "starts_at": {
      "type": "string"
    },
    "ends_at": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "default": "Europe/Moscow"
    },
    "all_day": {
      "type": "boolean",
      "default": false
    },
    "important": {
      "type": "boolean",
      "default": false
    },
    "visibility": {
      "type": "string",
      "enum": [
        "private",
        "public"
      ],
      "default": "private"
    },
    "busy_status": {
      "type": "string",
      "enum": [
        "busy",
        "free"
      ],
      "default": "busy"
    },
    "recurrence_freq": {
      "type": "string",
      "enum": [
        "none",
        "daily",
        "weekly",
        "monthly",
        "yearly"
      ],
      "default": "none"
    },
    "recurrence_interval": {
      "type": "integer",
      "minimum": 1,
      "default": 1
    },
    "recurrence_days": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 6
      }
    },
    "recurrence_month_day": {
      "type": "integer",
      "minimum": 1,
      "maximum": 31
    },
    "recurrence_until": {
      "type": "string"
    },
    "recurrence_count": {
      "type": "integer",
      "minimum": 1
    },
    "status": {
      "type": "string",
      "enum": [
        "confirmed",
        "cancelled",
        "tentative"
      ],
      "default": "confirmed"
    },
    "participants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CalendarParticipantInput"
      }
    },
    "payload": {
      "type": "object",
      "additionalProperties": true
    },
    "export_target": {
      "type": "string",
      "description": "local либо `<UUID подключения>/<календарь>`: календарь — его адрес (url) или id из selected_calendars подключения (GET /api/v1/calendar/connectors), можно с кодированием, как в форме, или коротким последним сегментом адреса (UUID коллекции iCloud). Сервер хранит каноничную запись формы. Подключение должно выгружать события (direction both или export), календарь — быть включён и доступен для записи; иначе 400 calendar.export_target_unavailable, нераспознанная запись — 400 calendar.export_target_format."
    },
    "calendar_source": {
      "type": "string"
    },
    "conference_url": {
      "type": "string",
      "maxLength": 2048,
      "description": "Ссылка на видеовстречу: пусто либо абсолютный https:// без пробелов. Если поля видеовстречи не переданы, сервер применяет личную настройку «Для новых встреч»: новая комната Яндекс Телемоста или постоянная ссылка."
    },
    "conference_provider": {
      "type": "string",
      "enum": [
        "",
        "telemost",
        "personal",
        "link"
      ],
      "description": "Источник ссылки. telemost без ссылки — сервер заводит комнату Яндекс Телемоста от имени человека; Телемост должен быть подключён в настройках календаря. Пусто при непустой ссылке означает link."
    },
    "conference_id": {
      "type": "string",
      "maxLength": 200,
      "description": "Идентификатор конференции Телемоста; для других источников сбрасывается."
    }
  },
  "$defs": {
    "CalendarParticipantInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "user": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "external_name": {
          "type": "string"
        },
        "external_email": {
          "type": "string",
          "format": "email"
        },
        "role": {
          "type": "string",
          "enum": [
            "required",
            "optional",
            "organizer"
          ],
          "default": "required"
        },
        "response_status": {
          "type": "string",
          "enum": [
            "needs_action",
            "accepted",
            "declined",
            "tentative"
          ],
          "default": "needs_action"
        }
      }
    }
  }
}