{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-create-event-request-schema.json",
  "title": "CreateEventRequest",
  "description": "Body of `POST /v1/calendar/events`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-calendar-api-openapi.yml#/components/schemas/CreateEventRequest",
  "type": "object",
  "required": [
    "title",
    "starts_at",
    "ends_at",
    "tz"
  ],
  "properties": {
    "all_day": {
      "type": "boolean",
      "description": "Whole days. `starts_at` / `ends_at` are then local midnights in `tz`."
    },
    "attendees": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttendeeInput"
      },
      "description": "People to invite."
    },
    "body": {
      "type": [
        "string",
        "null"
      ],
      "description": "Notes."
    },
    "conference_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Video-call link (`http(s)`)."
    },
    "ends_at": {
      "type": "string",
      "description": "End, RFC3339."
    },
    "kind": {
      "type": [
        "string",
        "null"
      ],
      "description": "`meeting` (default), `focus` or `personal`."
    },
    "location": {
      "type": [
        "string",
        "null"
      ],
      "description": "Where."
    },
    "reminder_minutes": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Remind the owner this many minutes before each occurrence (`0..=10080`);\nomitted or `null` for no reminder."
    },
    "rrule": {
      "type": [
        "string",
        "null"
      ],
      "description": "RRULE (`FREQ=WEEKLY;BYDAY=MO`), for a series."
    },
    "send_invites": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Send the invitations now (default `true`)."
    },
    "starts_at": {
      "type": "string",
      "description": "Start, RFC3339."
    },
    "target": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/EventTargetView",
          "description": "Attached object."
        }
      ]
    },
    "title": {
      "type": "string",
      "description": "Title (1..=300 characters)."
    },
    "tz": {
      "type": "string",
      "description": "IANA zone the times were entered in (e.g. `Europe/Paris`)."
    },
    "visibility": {
      "type": [
        "string",
        "null"
      ],
      "description": "`org` (default) or `private`."
    }
  },
  "$defs": {
    "AttendeeInput": {
      "type": "object",
      "description": "An attendee to invite.",
      "required": [
        "email"
      ],
      "properties": {
        "contact_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Matching contact, when picked from the CRM."
        },
        "display_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display name."
        },
        "email": {
          "type": "string",
          "description": "Address."
        }
      }
    },
    "EventTargetView": {
      "type": "object",
      "description": "The object an event is attached to, on the wire.",
      "required": [
        "kind",
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Id of the object in its own schema."
        },
        "kind": {
          "type": "string",
          "description": "`contact`, `deal`, `invoice_document` or `envelope`."
        }
      }
    }
  }
}