Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

124 KB
Raw Blame
{
  "openapi": "3.1.0",
  "info": {
    "title": "calendar_service",
    "description": "",
    "license": {
      "name": ""
    },
    "version": "0.1.0"
  },
  "paths": {
    "/availability-calendars": {
      "get": {
        "tags": ["calendar_events"],
        "summary": "List calendars and their personal-availability inclusion.",
        "operationId": "get_availability_calendars",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityCalendarsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/availability-calendars/{calendar_id}": {
      "put": {
        "tags": ["calendar_events"],
        "summary": "Change which source calendars normally occupy this user's time.",
        "operationId": "set_availability_calendar",
        "parameters": [
          {
            "name": "calendar_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvailabilityCalendarBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          }
        }
      }
    },
    "/calendars": {
      "get": {
        "tags": ["calendar_events"],
        "summary": "List the requester's visible calendars for pickers and filters.",
        "operationId": "list_calendars",
        "responses": {
          "200": {
            "description": "Calendars visible to the requester",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCalendarsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "503": {
            "description": "Transient failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "post": {
        "tags": ["calendar_events"],
        "summary": "Create a calendar event and return its synced entity.",
        "operationId": "create_calendar_event",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCalendarEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The created calendar event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEvent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid event fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only or needs reauthorization, or an agent's program asked to create without a review or confirmation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "No writable calendar or the provider rejected the event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure, or the Macro call could not be created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}": {
      "delete": {
        "tags": ["calendar_events"],
        "summary": "Delete a calendar event at its provider.",
        "operationId": "delete_calendar_event",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Calendar event entity id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "calendarId",
            "in": "query",
            "description": "Calendar whose copy of the event is deleted, for an event synced from\nmore than one calendar. Omit to delete the canonical copy.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Deletion scope; defaults to the entire event or series.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CalendarDeletionScopeParam"
            }
          },
          {
            "name": "recurrenceId",
            "in": "query",
            "description": "Original-start key of the occurrence a scoped deletion targets.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inbox",
            "in": "query",
            "description": "Inbox address holding the copy this request deletes. An agent run\nmust name it when the meeting is on more than one of the requester's\ninboxes, and it must be the inbox holding the addressed copy; a\nmismatch is refused whoever sends it.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The event was deleted"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only or needs reauthorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "The provider rejected the deletion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["calendar_events"],
        "summary": "Update fields of a calendar event and return its synced entity.",
        "operationId": "update_calendar_event",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Calendar event entity id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCalendarEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The updated calendar event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEvent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid event fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only or needs reauthorization, or the event is a snapshot of a shared meeting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "404": {
            "description": "Event or targeted occurrence not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "The provider rejected the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}/copy": {
      "post": {
        "tags": ["calendar_events"],
        "summary": "Add a snapshot of an event shared with one of the requester's channels to\none of their Google calendars and return the synced snapshot. The\nsnapshot keeps the meeting's iCalendar UID and organizer, lists only the\nrequester as a guest, and carries no join link; nobody is notified.\nWhile the requester's request to join the event is pending or accepted,\nthe copy is refused with `join_request_open`: the meeting reaches their\ncalendar as the invitation, which a copy would otherwise take in.",
        "operationId": "copy_calendar_event",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Shared calendar event entity id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopyCalendarEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The copy on the requester's calendar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEvent"
                }
              }
            }
          },
          "400": {
            "description": "The event cannot be copied, or the calendar is not a Google calendar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only or needs reauthorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "404": {
            "description": "Event not found or not shared with the requester",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "Already on the requester's calendar, a request to join it is pending or accepted, no writable calendar, or the provider refused the copy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}/guests": {
      "post": {
        "tags": ["calendar_events"],
        "summary": "Add guests to a calendar event without touching anyone already invited,\nand return its synced entity. The organizer, and guests the organizer lets\ninvite others, may call it; Google emails the new guests.",
        "operationId": "invite_calendar_event_guests",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Calendar event entity id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteCalendarEventGuestsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The updated calendar event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEvent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid guests or scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only, only the organizer can invite guests, the event is a snapshot of a shared meeting, or the calendar needs reauthorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "404": {
            "description": "Event or occurrence not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "The connected account neither organizes nor attends the event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}/provider-url": {
      "get": {
        "tags": ["calendar_events"],
        "summary": "Resolve an authorized event's provider link for Outlook-only actions.",
        "operationId": "calendar_event_provider_url",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "calendarId",
            "in": "query",
            "description": "Exact calendar copy; defaults to the canonical copy.",
            "required": false,
            "schema": {
              "type": ["string", "null"],
              "format": "uuid"
            }
          },
          {
            "name": "recurrenceId",
            "in": "query",
            "description": "Original-start key of one occurrence; omitted for the entire series.",
            "required": false,
            "schema": {
              "type": ["string", "null"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEventProviderUrl"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}/replacement": {
      "post": {
        "tags": ["calendar_events"],
        "summary": "Read and persist an organizer-only preview, without sending invitations.",
        "operationId": "prepare_calendar_replacement",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrepareCalendarReplacementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarReplacementView"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}/rsvp": {
      "put": {
        "tags": ["calendar_events"],
        "summary": "Set the requester's RSVP on a calendar event and return its synced entity.",
        "operationId": "rsvp_calendar_event",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Calendar event entity id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RsvpCalendarEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The updated calendar event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarEvent"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only or needs reauthorization, or the event is a snapshot of a shared meeting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "The connected account is not an attendee",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": ["crate::health"],
        "summary": "Health check",
        "operationId": "health_handler",
        "responses": {
          "200": {
            "description": "health",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/join-requests/{request_id}": {
      "put": {
        "tags": ["calendar_events"],
        "summary": "Answer a request to join an event the requester can change and return\nwhere it now stands. Accepting adds the guest through the invite path; an\nalready answered request is returned unchanged.",
        "operationId": "respond_to_join_request",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "description": "Join request id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RespondToJoinRequestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The answered join request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarJoinRequest"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Calendar is read-only, the organizer doesn't let guests invite others, or the calendar needs reauthorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "404": {
            "description": "Request not found or its event cannot be changed by the requester",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "409": {
            "description": "The provider rejected the new guest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          },
          "503": {
            "description": "Transient provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/replacements/{operation_id}": {
      "get": {
        "tags": ["calendar_events"],
        "summary": "Read saved progress without performing a provider mutation.",
        "operationId": "calendar_replacement_status",
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarReplacementView"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["calendar_events"],
        "summary": "Discard a preview only if no confirmation has been recorded.",
        "operationId": "discard_calendar_replacement",
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/replacements/{operation_id}/confirm": {
      "post": {
        "tags": ["calendar_events"],
        "summary": "Explicitly confirm the saved preview, or resume the same confirmed operation.",
        "operationId": "confirm_calendar_replacement",
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarReplacementView"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarMutationApiError"
                }
              }
            }
          }
        }
      }
    },
    "/scheduling/bookings": {
      "get": {
        "tags": ["scheduling"],
        "summary": "List the profile's bookings, optionally those starting in a half-open range.",
        "operationId": "list_bookings",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for personal bookings.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive start; supply together with `to`, at most 733 days apart.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Exclusive end; supply together with `from`.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingsResponse"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/bookings/{id}/change": {
      "post": {
        "tags": ["scheduling"],
        "summary": "Approve, cancel, record attendance for, or reschedule one booking.",
        "operationId": "change_booking",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Booking identity",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          },
          "409": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/bookings/{id}/manage": {
      "get": {
        "tags": ["scheduling"],
        "summary": "Read one booking as its personal owner, a host, or a team administrator.",
        "operationId": "get_managed_booking",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Booking identity",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptResponse"
                }
              }
            }
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/bookings/{id}/slots": {
      "get": {
        "tags": ["scheduling"],
        "summary": "Replacement start times for one booking on a schedule-local date.",
        "operationId": "list_booking_reschedule_slots",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Booking identity",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Date in the booking's schedule time zone.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotsResponse"
                }
              }
            }
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/insights": {
      "post": {
        "tags": ["scheduling"],
        "summary": "Booking statistics for a local date range and the equally long period before it.",
        "operationId": "get_booking_insights",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for the caller's personal booking links.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InsightQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingInsights"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/links": {
      "get": {
        "tags": ["scheduling"],
        "summary": "List and search booking links with their full drafts and reusable schedules.",
        "operationId": "list_booking_links",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for personal links.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Text matched against link title, slug and description; omit for all links.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingLinkListing"
                }
              }
            }
          },
          "403": {
            "description": ""
          }
        }
      },
      "post": {
        "tags": ["scheduling"],
        "summary": "Create a booking link; an identical replay at the same slug returns the saved link.",
        "operationId": "create_booking_link",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for the caller's personal booking links.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBookingLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingLink"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "409": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/links/{id}": {
      "put": {
        "tags": ["scheduling"],
        "summary": "Replace one booking link's configuration at the profile revision it was read with.",
        "operationId": "edit_booking_link",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Booking link (event type) identity",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for the caller's personal booking links.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditBookingLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingLink"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          },
          "409": {
            "description": ""
          }
        }
      }
    },
    "/scheduling/settings": {
      "get": {
        "tags": ["scheduling"],
        "summary": "Read personal or team booking settings without creating them.",
        "operationId": "get_booking_settings",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for the caller's personal booking links.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            }
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          }
        }
      },
      "put": {
        "tags": ["scheduling"],
        "summary": "Save booking settings at the revision they were read with.",
        "operationId": "save_booking_settings",
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Existing Macro team; omit for the caller's personal booking links.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingProfile"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "409": {
            "description": ""
          }
        }
      }
    },
    "/team-sharing": {
      "get": {
        "tags": ["calendar_events"],
        "summary": "Read the authenticated user's sharing choice.",
        "operationId": "get_team_sharing",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamCalendarSharingBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["calendar_events"],
        "summary": "Set the authenticated user's sharing choice.",
        "operationId": "set_team_sharing",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamCalendarSharingBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamCalendarSharingBody"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AttendeeResponseStatus": {
        "type": "string",
        "description": "RSVP state for an attendee.",
        "enum": ["needs_action", "accepted", "declined", "tentative"]
      },
      "AvailabilityCalendar": {
        "type": "object",
        "description": "Per-user inclusion of a source calendar in personal availability.",
        "required": [
          "calendarId",
          "name",
          "contributesToAvailability",
          "isPrimary"
        ],
        "properties": {
          "calendarId": {
            "type": "string",
            "format": "uuid",
            "description": "Visible source calendar."
          },
          "contributesToAvailability": {
            "type": "boolean",
            "description": "Whether its events normally block the user's time."
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether this is the connected account's primary calendar."
          },
          "name": {
            "type": "string",
            "description": "Source name."
          }
        }
      },
      "AvailabilityCalendarBody": {
        "type": "object",
        "description": "Own-user source inclusion preference.",
        "required": ["contributesToAvailability"],
        "properties": {
          "contributesToAvailability": {
            "type": "boolean",
            "description": "Whether this calendar contributes to personal availability."
          }
        }
      },
      "AvailabilityCalendarsResponse": {
        "type": "object",
        "description": "Source calendar settings returned to their viewer.",
        "required": ["calendars"],
        "properties": {
          "calendars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailabilityCalendar"
            },
            "description": "Directly visible source calendars."
          }
        }
      },
      "Booking": {
        "type": "object",
        "description": "Public booking details, also visible to authorized profile members.",
        "required": [
          "id",
          "eventTypeId",
          "title",
          "name",
          "email",
          "startsAt",
          "endsAt",
          "timeZone",
          "hosts",
          "status",
          "location",
          "answers"
        ],
        "properties": {
          "answers": {
            "type": "object",
            "description": "Answers keyed by question identity.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string",
              "format": "uuid"
            }
          },
          "attendance": {
            "$ref": "#/components/schemas/BookingAttendance",
            "description": "Explicit attendance outcome; existing booking records default to unknown."
          },
          "email": {
            "type": "string",
            "description": "Booker's email."
          },
          "endsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute meeting end."
          },
          "eventTypeId": {
            "type": "string",
            "format": "uuid",
            "description": "Booking link identity."
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Assigned hosts."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Booking identity."
          },
          "location": {
            "type": "string",
            "description": "Final location or conference URL."
          },
          "name": {
            "type": "string",
            "description": "Booker's name."
          },
          "questionLabels": {
            "type": "object",
            "description": "Original labels for answers, independent of later event-type edits.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string",
              "format": "uuid"
            }
          },
          "rescheduleCount": {
            "type": "integer",
            "format": "int32",
            "description": "Number of successfully completed moves to a different start time.",
            "minimum": 0
          },
          "rescheduledAt": {
            "type": ["string", "null"],
            "format": "date-time",
            "description": "When the most recent successful reschedule completed."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute meeting start."
          },
          "status": {
            "$ref": "#/components/schemas/BookingStatus",
            "description": "Current lifecycle state."
          },
          "timeZone": {
            "type": "string",
            "description": "Booker's display time zone."
          },
          "title": {
            "type": "string",
            "description": "Snapshot of the meeting title."
          }
        }
      },
      "BookingAttendance": {
        "type": "string",
        "description": "Attendance recorded by an assigned host or profile administrator after a meeting.",
        "enum": ["unknown", "attended", "guestNoShow", "hostNoShow"]
      },
      "BookingChange": {
        "oneOf": [
          {
            "type": "object",
            "description": "Approve a legacy pending booking and send its calendar invitations.",
            "required": ["action"],
            "properties": {
              "action": {
                "type": "string",
                "enum": ["approve"]
              }
            }
          },
          {
            "type": "object",
            "description": "Cancel a booking and notify its attendees.",
            "required": ["action"],
            "properties": {
              "action": {
                "type": "string",
                "enum": ["cancel"]
              }
            }
          },
          {
            "type": "object",
            "description": "Record or clear attendance after the meeting ends.",
            "required": ["attendance", "action"],
            "properties": {
              "action": {
                "type": "string",
                "enum": ["attendance"]
              },
              "attendance": {
                "$ref": "#/components/schemas/BookingAttendance",
                "description": "Recorded outcome."
              }
            }
          },
          {
            "type": "object",
            "description": "Move the existing meeting to an available time; notify attendees.",
            "required": ["startsAt", "action"],
            "properties": {
              "action": {
                "type": "string",
                "enum": ["reschedule"]
              },
              "startsAt": {
                "type": "string",
                "format": "date-time",
                "description": "Absolute start chosen from available replacement slots."
              }
            }
          }
        ],
        "description": "A host's requested change to a booked meeting."
      },
      "BookingDateOverride": {
        "type": "object",
        "description": "Replacement availability for one date.",
        "required": ["date", "windows"],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Local date in the schedule zone."
          },
          "windows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingTimeWindow"
            },
            "description": "Empty means unavailable all day."
          }
        }
      },
      "BookingEventType": {
        "type": "object",
        "description": "A reusable booking link.",
        "required": [
          "id",
          "title",
          "slug",
          "description",
          "durationMinutes",
          "location",
          "googleMeet",
          "enabled",
          "scheduleId",
          "mode",
          "hosts",
          "beforeMinutes",
          "afterMinutes",
          "noticeMinutes",
          "horizonDays",
          "intervalMinutes",
          "requiresConfirmation",
          "questions"
        ],
        "properties": {
          "afterMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Protected time after a meeting.",
            "minimum": 0
          },
          "beforeMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Protected time before a meeting.",
            "minimum": 0
          },
          "dailyLimit": {
            "type": ["integer", "null"],
            "format": "int32",
            "description": "Maximum bookings for this event on one schedule-local day.",
            "minimum": 0
          },
          "description": {
            "type": "string",
            "description": "Public description."
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Meeting duration.",
            "minimum": 0
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether new bookings are accepted."
          },
          "googleMeet": {
            "type": "boolean",
            "description": "Generate a Google Meet conference. Mutually exclusive with a Macro call."
          },
          "horizonDays": {
            "type": "integer",
            "format": "int32",
            "description": "Maximum days ahead.",
            "minimum": 0
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Current Macro user identities selected as hosts."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable identity."
          },
          "intervalMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Spacing of offered start times.",
            "minimum": 0
          },
          "location": {
            "type": "string",
            "description": "Meeting location."
          },
          "macroCall": {
            "type": "boolean",
            "description": "Generate a Macro call and attach its join link when someone books.\nMutually exclusive with Google Meet. Omitted on links saved before\nMacro calls were a booking option, which keep their previous conference."
          },
          "mode": {
            "$ref": "#/components/schemas/SchedulingMode",
            "description": "Host assignment policy."
          },
          "noticeMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Minimum notice in minutes.",
            "minimum": 0
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingQuestion"
            },
            "description": "Additional form fields."
          },
          "requiresConfirmation": {
            "type": "boolean",
            "description": "Hold bookings for host approval."
          },
          "scheduleId": {
            "type": "string",
            "format": "uuid",
            "description": "Referenced availability schedule."
          },
          "slug": {
            "type": "string",
            "description": "Unique link segment within a profile."
          },
          "title": {
            "type": "string",
            "description": "Public title."
          }
        }
      },
      "BookingInsights": {
        "type": "object",
        "description": "Current and equally long preceding local-calendar periods.",
        "required": [
          "asOf",
          "previousFrom",
          "previousTo",
          "current",
          "previous"
        ],
        "properties": {
          "asOf": {
            "type": "string",
            "format": "date-time",
            "description": "Time at which completion was evaluated."
          },
          "current": {
            "$ref": "#/components/schemas/InsightPeriod",
            "description": "Requested period."
          },
          "previous": {
            "$ref": "#/components/schemas/InsightPeriod",
            "description": "Comparison period, using identical filters and definitions."
          },
          "previousFrom": {
            "type": "string",
            "format": "date",
            "description": "Preceding period's first local date."
          },
          "previousTo": {
            "type": "string",
            "format": "date",
            "description": "Preceding period's last local date."
          }
        }
      },
      "BookingLink": {
        "type": "object",
        "description": "Saved link with actual identities and revision for subsequent edits.",
        "required": ["profileId", "eventTypeId", "revision", "draft"],
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/BookingLinkDraft",
            "description": "Full editable configuration."
          },
          "eventTypeId": {
            "type": "string",
            "format": "uuid",
            "description": "Stable link identity."
          },
          "profileId": {
            "type": "string",
            "format": "uuid",
            "description": "Owning profile."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "description": "Profile revision to supply when editing."
          }
        },
        "additionalProperties": false
      },
      "BookingLinkDraft": {
        "type": "object",
        "description": "Complete proposal reviewed and validated before saving.",
        "required": ["event", "schedule"],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/BookingLinkEvent",
            "description": "Public details, hosts, booking rules and questions."
          },
          "schedule": {
            "$ref": "#/components/schemas/BookingLinkSchedule",
            "description": "Weekly hours, IANA time zone, and date overrides for this link."
          }
        },
        "additionalProperties": false
      },
      "BookingLinkEvent": {
        "type": "object",
        "description": "All editable rules for one link. Personal links must use the authenticated user as host.",
        "required": [
          "title",
          "slug",
          "description",
          "durationMinutes",
          "location",
          "googleMeet",
          "enabled",
          "mode",
          "hosts",
          "beforeMinutes",
          "afterMinutes",
          "noticeMinutes",
          "horizonDays",
          "intervalMinutes",
          "requiresConfirmation",
          "questions"
        ],
        "properties": {
          "afterMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Protected time after a meeting.",
            "minimum": 0
          },
          "beforeMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Protected time before a meeting.",
            "minimum": 0
          },
          "dailyLimit": {
            "type": ["integer", "null"],
            "format": "int32",
            "description": "Maximum bookings for this event on one schedule-local day.",
            "minimum": 0
          },
          "description": {
            "type": "string",
            "description": "Public description."
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Meeting duration.",
            "minimum": 0
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether new bookings are accepted."
          },
          "googleMeet": {
            "type": "boolean",
            "description": "Generate a Google Meet conference. Mutually exclusive with `macroCall`."
          },
          "horizonDays": {
            "type": "integer",
            "format": "int32",
            "description": "Maximum days ahead.",
            "minimum": 0
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Current Macro user identities selected as hosts."
          },
          "intervalMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Spacing of offered start times.",
            "minimum": 0
          },
          "location": {
            "type": "string",
            "description": "Meeting location."
          },
          "macroCall": {
            "type": "boolean",
            "description": "Attach a Macro call when someone books. A join link is created for that\nbooking and written onto the calendar invitation. Mutually exclusive\nwith `googleMeet`. Prefer this for a Macro booking; omit or false when\nthe link should use Google Meet or no video. False is omitted so drafts\nsaved before this field still round-trip unchanged."
          },
          "mode": {
            "$ref": "#/components/schemas/SchedulingMode",
            "description": "Host assignment policy."
          },
          "noticeMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Minimum notice in minutes.",
            "minimum": 0
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingQuestion"
            },
            "description": "Additional form fields."
          },
          "requiresConfirmation": {
            "type": "boolean",
            "description": "Hold bookings for host approval."
          },
          "slug": {
            "type": "string",
            "description": "Unique link segment within a profile."
          },
          "title": {
            "type": "string",
            "description": "Public title."
          }
        },
        "additionalProperties": false
      },
      "BookingLinkListing": {
        "type": "object",
        "description": "Authorized discovery results including reusable availability.",
        "required": [
          "teamIds",
          "userId",
          "profileId",
          "revision",
          "schedules",
          "links"
        ],
        "properties": {
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingLink"
            },
            "description": "Links whose title, slug or description matches the search, including paused links."
          },
          "profileId": {
            "type": "string",
            "format": "uuid",
            "description": "Owning profile identity, including unsaved new profiles."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "description": "Current revision."
          },
          "schedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingSchedule"
            },
            "description": "Reusable schedules, even when no links match."
          },
          "teamIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Current team identities that can be used to discover team links."
          },
          "userId": {
            "type": "string",
            "description": "Current authenticated host identity for personal drafts."
          }
        },
        "additionalProperties": false
      },
      "BookingLinkSchedule": {
        "type": "object",
        "description": "Availability copied into a dedicated schedule when it changes; other links retain their hours.",
        "required": ["name", "timeZone", "weekly", "overrides"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingDateOverride"
            },
            "description": "Date-specific replacements."
          },
          "timeZone": {
            "type": "string",
            "description": "IANA time zone."
          },
          "weekly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingWeeklyDay"
            },
            "description": "Weekly windows."
          }
        },
        "additionalProperties": false
      },
      "BookingProfile": {
        "type": "object",
        "description": "Editable configuration for a person or team.",
        "required": [
          "id",
          "name",
          "description",
          "schedules",
          "eventTypes",
          "revision"
        ],
        "properties": {
          "defaultScheduleId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Personal hours used by team events; absent legacy profiles use their first schedule."
          },
          "description": {
            "type": "string",
            "description": "Public introduction."
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingEventType"
            },
            "description": "Booking links."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Public, opaque profile identity."
          },
          "name": {
            "type": "string",
            "description": "Display name on the public page."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "description": "Optimistic concurrency version."
          },
          "schedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingSchedule"
            },
            "description": "Reusable schedules."
          }
        }
      },
      "BookingQuestion": {
        "type": "object",
        "description": "A question on the booking form.",
        "required": ["id", "label", "required"],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable identity."
          },
          "label": {
            "type": "string",
            "description": "Public question label."
          },
          "required": {
            "type": "boolean",
            "description": "Whether an answer is mandatory."
          }
        }
      },
      "BookingResponse": {
        "type": "object",
        "description": "One booking after a change.",
        "required": ["booking"],
        "properties": {
          "booking": {
            "$ref": "#/components/schemas/Booking",
            "description": "The saved booking."
          }
        }
      },
      "BookingSchedule": {
        "type": "object",
        "description": "Reusable hours, with DST interpreted in an IANA zone.",
        "required": ["id", "name", "timeZone", "weekly", "overrides"],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable schedule identity."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingDateOverride"
            },
            "description": "Date-specific replacements."
          },
          "timeZone": {
            "type": "string",
            "description": "IANA time zone."
          },
          "weekly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingWeeklyDay"
            },
            "description": "Weekly windows."
          }
        }
      },
      "BookingSlot": {
        "type": "object",
        "description": "Available slot and the hosts who can satisfy it.",
        "required": ["startsAt", "endsAt"],
        "properties": {
          "endsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute end."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute start."
          }
        }
      },
      "BookingStatus": {
        "type": "string",
        "description": "Booking lifecycle state.",
        "enum": ["pending", "confirmed", "cancelled", "processing", "failed"]
      },
      "BookingTimeWindow": {
        "type": "object",
        "description": "A wall-clock window in an availability schedule.",
        "required": ["start", "end"],
        "properties": {
          "end": {
            "type": "string",
            "description": "Exclusive HH:MM end."
          },
          "start": {
            "type": "string",
            "description": "Inclusive HH:MM start."
          }
        }
      },
      "BookingWeeklyDay": {
        "type": "object",
        "description": "Availability for one weekday.",
        "required": ["day", "windows"],
        "properties": {
          "day": {
            "type": "integer",
            "format": "int32",
            "description": "Sunday is zero.",
            "minimum": 0
          },
          "windows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingTimeWindow"
            },
            "description": "Non-overlapping local windows."
          }
        }
      },
      "BookingsResponse": {
        "type": "object",
        "description": "Bookings of one profile.",
        "required": ["bookings"],
        "properties": {
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            },
            "description": "Every matching booking."
          }
        }
      },
      "CalendarAttendee": {
        "type": "object",
        "description": "An attendee on a calendar event.",
        "required": [
          "email",
          "responseStatus",
          "isOrganizer",
          "isOptional",
          "isSelf"
        ],
        "properties": {
          "comment": {
            "type": ["string", "null"],
            "description": "Optional attendee comment."
          },
          "displayName": {
            "type": ["string", "null"],
            "description": "Provider display name."
          },
          "email": {
            "type": "string",
            "description": "Normalized email address."
          },
          "isOptional": {
            "type": "boolean",
            "description": "Whether attendance is optional."
          },
          "isOrganizer": {
            "type": "boolean",
            "description": "Whether this attendee is the organizer."
          },
          "isSelf": {
            "type": "boolean",
            "description": "Whether this attendee is one of the viewing requester's inboxes."
          },
          "responseStatus": {
            "$ref": "#/components/schemas/AttendeeResponseStatus",
            "description": "RSVP state."
          }
        }
      },
      "CalendarAttendeeInputBody": {
        "type": "object",
        "description": "An attendee supplied to a calendar mutation.",
        "required": ["email"],
        "properties": {
          "email": {
            "type": "string",
            "description": "Attendee email address."
          },
          "isOptional": {
            "type": "boolean",
            "description": "Whether attendance is optional."
          }
        }
      },
      "CalendarCapabilities": {
        "type": "object",
        "description": "Actual provider capabilities used by calendar editors.",
        "required": [
          "removeConference",
          "autoDecline",
          "emailReminders",
          "customRecurrence",
          "resetRsvp",
          "guestPolicy"
        ],
        "properties": {
          "autoDecline": {
            "type": "boolean",
            "description": "Whether event-level automatic invitation declines are supported."
          },
          "conferenceProvider": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConferenceProvider",
                "description": "Meeting system available for new conferences, when any."
              }
            ]
          },
          "customRecurrence": {
            "type": "boolean",
            "description": "Whether arbitrary RFC 5545 recurrence properties can be written."
          },
          "emailReminders": {
            "type": "boolean",
            "description": "Whether email reminders are delivered by the provider or Macro."
          },
          "guestPolicy": {
            "type": "boolean",
            "description": "Whether the organizer can set what guests may do."
          },
          "removeConference": {
            "type": "boolean",
            "description": "Whether an existing conference can be detached."
          },
          "resetRsvp": {
            "type": "boolean",
            "description": "Whether an attendee can reset their RSVP to unanswered."
          }
        }
      },
      "CalendarDeletionScopeParam": {
        "type": "string",
        "description": "How much of a recurring series a deletion removes.",
        "enum": ["all", "this_event", "this_and_following"]
      },
      "CalendarEvent": {
        "type": "object",
        "description": "A stable, first-class Macro calendar event entity.\n\nContent fields hold the canonical source's values: the account's primary\ncalendar copy when one is synced, else the freshest remaining copy.",
        "required": [
          "id",
          "ownerId",
          "icalUid",
          "title",
          "status",
          "visibility",
          "transparency",
          "time",
          "recurrenceLines",
          "sequence",
          "isReadOnly",
          "attendees",
          "guestPolicy",
          "isSnapshot",
          "viewerCan",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "attendees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarAttendee"
            },
            "description": "Attendees, keyed by email during persistence."
          },
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Calendar the canonical source belongs to, when known. Absent only in\nprojections stored before calendars were attributed."
          },
          "conferenceProvider": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConferenceProvider",
                "description": "Which conferencing system backs `conference_url`. `None` whenever no\nconference is attached."
              }
            ]
          },
          "conferenceUrl": {
            "type": ["string", "null"],
            "description": "Direct join URL when known."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Entity creation time."
          },
          "creatorEmail": {
            "type": ["string", "null"],
            "description": "Provider-reported creator email. Distinct from the organizer when\nsomeone writes onto a calendar they do not own. Omitted from stored\nprojections when unknown so events ingested before this field still\ncompare equal."
          },
          "creatorName": {
            "type": ["string", "null"],
            "description": "Provider-reported creator display name."
          },
          "description": {
            "type": ["string", "null"],
            "description": "Optional event body."
          },
          "eventType": {
            "$ref": "#/components/schemas/EventType",
            "description": "Provider event type. Skipped when it is the regular type so\nprojections stored before event types were modeled still compare\nequal."
          },
          "guestPolicy": {
            "$ref": "#/components/schemas/GuestPolicy",
            "description": "What the organizer lets guests do: the canonical copy's values, or\nGoogle's defaults for an event synced before the policy was modeled."
          },
          "icalUid": {
            "type": "string",
            "description": "RFC 5545 UID used to reconcile provider and email sources."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Macro entity identifier."
          },
          "isReadOnly": {
            "type": "boolean",
            "description": "Whether the canonical source's calendar prohibits editing it."
          },
          "isSnapshot": {
            "type": "boolean",
            "description": "Whether this is a snapshot of a meeting shared with the owner, which\nMacro added to their calendar as a private copy: the meeting's changes\nnever reach it, and nothing done to it reaches the meeting."
          },
          "location": {
            "type": ["string", "null"],
            "description": "Optional physical or virtual location label."
          },
          "organizerEmail": {
            "type": ["string", "null"],
            "description": "Organizer email."
          },
          "organizerName": {
            "type": ["string", "null"],
            "description": "Organizer display name."
          },
          "ownerId": {
            "type": "string",
            "description": "Macro user who owns this event entity."
          },
          "recurrenceLines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`)."
          },
          "reminders": {
            "$ref": "#/components/schemas/EventReminders",
            "description": "Per-user reminder configuration. Skipped when it is the provider\ndefault so projections stored before reminders were modeled still\ncompare equal."
          },
          "sequence": {
            "type": "integer",
            "format": "int32",
            "description": "Provider/iCalendar sequence number.",
            "minimum": 0
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarEventSourceContent"
            },
            "description": "Content of every active copy of this event, canonical first: the\nprimary calendar's copy, then the freshest. A client picks the copy\nwhose calendar it is showing and falls back to the first. Populated\nonly on the read path, so stored projections omit it."
          },
          "status": {
            "$ref": "#/components/schemas/EventStatus",
            "description": "Event status."
          },
          "time": {
            "$ref": "#/components/schemas/EventTime",
            "description": "Timed or all-day shape."
          },
          "title": {
            "type": "string",
            "description": "Display title."
          },
          "transparency": {
            "$ref": "#/components/schemas/EventTransparency",
            "description": "Availability behavior."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Entity update time."
          },
          "viewerCan": {
            "$ref": "#/components/schemas/ViewerCapabilities",
            "description": "What the viewing requester may do with the event. Resolved only on\nthe read path, alongside each attendee's `is_self`; nothing when no\nviewer is known. Source projections never store it."
          },
          "visibility": {
            "$ref": "#/components/schemas/EventVisibility",
            "description": "Event visibility."
          }
        }
      },
      "CalendarEventProviderUrl": {
        "type": "object",
        "description": "Provider-validated external event link.",
        "properties": {
          "url": {
            "type": ["string", "null"],
            "description": "None when the event no longer exists at its provider."
          }
        }
      },
      "CalendarEventSourceContent": {
        "type": "object",
        "description": "The content one provider copy of an event carries.\n\nGoogle keeps these fields per calendar copy: a shared calendar's copy of a\nmember's event can have its own title, type, reminders, and access role.\nThe entity holds its canonical source's values. Every other copy's values\nare read from here so a client can show the copy that belongs to the\ncalendar being viewed.",
        "required": [
          "calendarId",
          "title",
          "eventType",
          "visibility",
          "transparency",
          "isReadOnly",
          "reminders"
        ],
        "properties": {
          "calendarId": {
            "type": "string",
            "format": "uuid",
            "description": "Calendar this copy lives on."
          },
          "creatorEmail": {
            "type": ["string", "null"],
            "description": "Provider-reported creator email."
          },
          "creatorName": {
            "type": ["string", "null"],
            "description": "Provider-reported creator display name."
          },
          "description": {
            "type": ["string", "null"],
            "description": "Optional event body."
          },
          "eventType": {
            "$ref": "#/components/schemas/EventType",
            "description": "Provider event type."
          },
          "isReadOnly": {
            "type": "boolean",
            "description": "Whether the calendar's access role prohibits editing this copy."
          },
          "location": {
            "type": ["string", "null"],
            "description": "Optional physical or virtual location label."
          },
          "reminders": {
            "$ref": "#/components/schemas/EventReminders",
            "description": "Reminder configuration of this copy."
          },
          "title": {
            "type": "string",
            "description": "Display title."
          },
          "transparency": {
            "$ref": "#/components/schemas/EventTransparency",
            "description": "Availability behavior."
          },
          "visibility": {
            "$ref": "#/components/schemas/EventVisibility",
            "description": "Event visibility."
          }
        }
      },
      "CalendarGuestInputBody": {
        "type": "object",
        "description": "A guest added to an event.",
        "required": ["email"],
        "properties": {
          "email": {
            "type": "string",
            "description": "Guest email address."
          },
          "optional": {
            "type": "boolean",
            "description": "Whether attendance is optional."
          }
        }
      },
      "CalendarJoinRequest": {
        "type": "object",
        "description": "A channel member's request to be added as a guest of an event they see\nonly through a channel share.",
        "required": [
          "id",
          "eventId",
          "requesterId",
          "requesterEmail",
          "status",
          "createdAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the request was made."
          },
          "eventId": {
            "type": "string",
            "format": "uuid",
            "description": "The sharer's event entity that was shared with the channel."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Request identifier."
          },
          "requesterEmail": {
            "type": "string",
            "description": "Address the sharer invites when accepting."
          },
          "requesterId": {
            "type": "string",
            "description": "Macro user asking to join."
          },
          "status": {
            "$ref": "#/components/schemas/CalendarJoinRequestStatus",
            "description": "Where the request stands."
          }
        }
      },
      "CalendarJoinRequestDecision": {
        "type": "string",
        "description": "How a sharer answers a request to join their event.",
        "enum": ["accept", "decline"]
      },
      "CalendarJoinRequestStatus": {
        "type": "string",
        "description": "Lifecycle of a request to be added as a guest of a shared event.",
        "enum": ["pending", "accepted", "declined"]
      },
      "CalendarMutationApiError": {
        "type": "object",
        "description": "HTTP error body returned by calendar mutation endpoints.",
        "required": ["code", "message"],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/CalendarMutationErrorCode",
            "description": "Machine-readable failure category."
          },
          "message": {
            "type": "string",
            "description": "Human-readable failure description."
          }
        }
      },
      "CalendarMutationErrorCode": {
        "type": "string",
        "description": "Machine-readable failure category for calendar mutations.",
        "enum": [
          "not_found",
          "occurrence_not_found",
          "read_only",
          "no_writable_calendar",
          "not_attendee",
          "not_organizer",
          "guests_cannot_invite",
          "guest_list_hidden",
          "guests_cannot_modify",
          "already_on_calendar",
          "join_request_open",
          "copy_refused",
          "snapshot",
          "invalid_input",
          "reauth_required",
          "provider_rejected",
          "retryable",
          "persist_failed",
          "macro_call_failed",
          "copy_choice_required",
          "confirmation_required"
        ]
      },
      "CalendarProvider": {
        "type": "string",
        "description": "Provider selected from the persisted calendar account and email binding.",
        "enum": ["google", "outlook"]
      },
      "CalendarReplacementView": {
        "type": "object",
        "description": "Safe preview and recovery response; never exposes the opaque provider snapshot.",
        "required": [
          "operationId",
          "status",
          "title",
          "time",
          "attendeeCount",
          "isSeries",
          "removeConference",
          "completedSteps",
          "totalSteps"
        ],
        "properties": {
          "attendeeCount": {
            "type": "integer",
            "description": "Guest count for cancellation and reinvitation confirmation.",
            "minimum": 0
          },
          "completedSteps": {
            "type": "integer",
            "format": "int32",
            "description": "Number of completed provider steps."
          },
          "event": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CalendarEvent",
                "description": "Returned after the complete operation has been persisted."
              }
            ]
          },
          "isSeries": {
            "type": "boolean",
            "description": "Entire recurring series, including exceptions, is replaced."
          },
          "operationId": {
            "type": "string",
            "format": "uuid",
            "description": "Use this identity when confirming or checking progress."
          },
          "providerUrl": {
            "type": ["string", "null"],
            "description": "Original event for manual review."
          },
          "removeConference": {
            "type": "boolean",
            "description": "The provider conference is removed."
          },
          "replacementUrl": {
            "type": ["string", "null"],
            "description": "New provider event, when creation was confirmed."
          },
          "status": {
            "$ref": "#/components/schemas/ReplacementStatus",
            "description": "Current durable state."
          },
          "time": {
            "$ref": "#/components/schemas/EventTime",
            "description": "Frozen time."
          },
          "title": {
            "type": "string",
            "description": "Frozen title."
          },
          "totalSteps": {
            "type": "integer",
            "format": "int32",
            "description": "Number of provider steps in this operation."
          }
        }
      },
      "CalendarRsvpScopeParam": {
        "type": "string",
        "description": "How much of a recurring series an RSVP applies to.\n\nUnlike deletion there is no this-and-following variant: the provider\ncannot express a forward-scoped response, so offering one would be a\npromise sync could not keep.",
        "enum": ["all", "this_event"]
      },
      "CalendarUpdateScopeParam": {
        "type": "string",
        "description": "How much of a recurring series an update applies to.\n\nLike RSVPs there is no this-and-following variant: the provider cannot\nexpress a forward-scoped edit as one write, and emulating it (truncate\nthe series, insert an edited clone) is non-atomic and re-invites the\nattendees of the clone. Compose it from a this-and-following deletion\nand a create when that shape is wanted.",
        "enum": ["all", "this_event"]
      },
      "ConferenceChange": {
        "type": "string",
        "description": "A requested change to an event's conferencing. Omitting the field leaves\nthe existing conference untouched; only these values change it.",
        "enum": ["provider_default", "microsoft_teams", "google_meet", "none"]
      },
      "ConferenceProvider": {
        "type": "string",
        "description": "The conferencing system backing an event's join URL.\n\nCalendars can create Google Meet or Microsoft Teams according to their\ncapabilities. Imported third-party conferences are labeled separately.\nOmitting a conference change preserves the current conference; explicit\nchanges still require provider and calendar capability validation.",
        "enum": ["microsoft_teams", "google_meet", "other"]
      },
      "CopyCalendarEventRequest": {
        "type": "object",
        "description": "Request body adding a shared event to the requester's calendar.",
        "properties": {
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Google calendar to add the copy to; defaults to the requester's\nprimary inbox's primary calendar."
          }
        }
      },
      "CreateBookingLinkRequest": {
        "type": "object",
        "description": "A new booking link, saved after the user approved it.",
        "required": ["draft", "userConfirmation"],
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/BookingLinkDraft",
            "description": "Full booking rules and availability the user approved."
          },
          "userConfirmation": {
            "type": "string",
            "description": "The user's reply approving this proposal, quoted verbatim."
          }
        },
        "additionalProperties": false
      },
      "CreateCalendarEventRequest": {
        "type": "object",
        "description": "Request body creating a calendar event on the requester's calendar.",
        "required": ["title", "time"],
        "properties": {
          "attendees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarAttendeeInputBody"
            },
            "description": "Invited attendees."
          },
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Exact calendar to create the event on; takes precedence over the\ninbox default."
          },
          "conference": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConferenceChange",
                "description": "Conference to attach to the new event; omit to create it without one."
              }
            ]
          },
          "description": {
            "type": ["string", "null"],
            "description": "Optional event body."
          },
          "emailLinkId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Connected inbox whose primary calendar receives the event; defaults\nto the requester's primary inbox."
          },
          "guestPolicy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GuestPolicy",
                "description": "What guests may do; omit for Google's defaults (guests may invite\nothers and see the guest list, not modify the event). Google\ncalendars only."
              }
            ]
          },
          "idempotencyKey": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Stable retry identity, scoped to the authenticated organizer."
          },
          "location": {
            "type": ["string", "null"],
            "description": "Optional location label."
          },
          "macroCall": {
            "type": "boolean",
            "description": "Mint a Macro call and write its join link into the description and\nlocation before creating the event, so the invitation carries it.\nCannot be combined with `conference`."
          },
          "outOfOffice": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutOfOfficeProperties",
                "description": "Out-of-office properties; present to create the event as a Google\nout-of-office status event (primary calendar only, timed, no\nattendees), omitted for a regular event."
              }
            ]
          },
          "recurrenceLines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Raw RFC 5545 recurrence properties (`RRULE`, `RDATE`, `EXDATE`)."
          },
          "reminders": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventReminders",
                "description": "Reminder configuration; omit to keep the calendar defaults."
              }
            ]
          },
          "time": {
            "$ref": "#/components/schemas/EventTime",
            "description": "Timed or all-day shape."
          },
          "title": {
            "type": "string",
            "description": "Display title."
          },
          "transparency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventTransparency",
                "description": "Availability behavior."
              }
            ]
          },
          "visibility": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventVisibility",
                "description": "Event visibility."
              }
            ]
          }
        }
      },
      "EditBookingLinkRequest": {
        "type": "object",
        "description": "Replacement configuration for one booking link, saved after the user approved it.",
        "required": ["expectedRevision", "draft", "userConfirmation"],
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/BookingLinkDraft",
            "description": "Full edited booking rules and availability the user approved."
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "description": "Profile revision the edit was prepared from; a newer revision conflicts."
          },
          "userConfirmation": {
            "type": "string",
            "description": "The user's reply approving this proposal, quoted verbatim."
          }
        },
        "additionalProperties": false
      },
      "EventReminderOverride": {
        "type": "object",
        "description": "One reminder: how it alerts and how many minutes before the event start\n(before midnight in the calendar's zone for all-day events) it fires.",
        "required": ["method", "minutes"],
        "properties": {
          "method": {
            "type": "string",
            "description": "Provider method, stored verbatim; only `popup` fires Macro\nnotifications."
          },
          "minutes": {
            "type": "integer",
            "format": "int32",
            "description": "Minutes before the event start.",
            "minimum": 0
          }
        }
      },
      "EventReminders": {
        "type": "object",
        "description": "Per-user reminder configuration for an event, mirroring Google's model:\neither the calendar's default reminders apply, or the explicit overrides\nreplace them entirely.",
        "required": ["useDefault"],
        "properties": {
          "overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventReminderOverride"
            },
            "description": "Explicit reminders replacing the defaults when `use_default` is off."
          },
          "useDefault": {
            "type": "boolean",
            "description": "Whether the calendar's default reminders apply."
          }
        }
      },
      "EventStatus": {
        "type": "string",
        "description": "Canonical event status.",
        "enum": ["confirmed", "tentative", "cancelled"]
      },
      "EventTime": {
        "oneOf": [
          {
            "type": "object",
            "description": "An event with absolute instants.",
            "required": ["startsAt", "endsAt", "kind"],
            "properties": {
              "endsAt": {
                "type": "string",
                "format": "date-time",
                "description": "Exclusive end instant; equal to the start for an imported point event."
              },
              "kind": {
                "type": "string",
                "enum": ["timed"]
              },
              "startsAt": {
                "type": "string",
                "format": "date-time",
                "description": "Inclusive start instant."
              },
              "timeZone": {
                "type": ["string", "null"],
                "description": "Original IANA time-zone identifier, when supplied."
              }
            }
          },
          {
            "type": "object",
            "description": "An all-day event using RFC 5545's exclusive end date.",
            "required": ["startDate", "endDate", "kind"],
            "properties": {
              "endDate": {
                "type": "string",
                "format": "date",
                "description": "Exclusive local end date."
              },
              "kind": {
                "type": "string",
                "enum": ["allDay"]
              },
              "startDate": {
                "type": "string",
                "format": "date",
                "description": "Inclusive local start date."
              }
            }
          }
        ],
        "description": "The mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema."
      },
      "EventTransparency": {
        "type": "string",
        "description": "Whether an event blocks availability.",
        "enum": ["opaque", "transparent"]
      },
      "EventType": {
        "type": "string",
        "description": "Google's event type: ordinary meetings versus the status-style entries\n(working location, out of office, focus time, birthdays) Google renders\nand notifies differently. Immutable at the provider after creation.",
        "enum": [
          "default",
          "out_of_office",
          "focus_time",
          "working_location",
          "birthday",
          "from_gmail"
        ]
      },
      "EventVisibility": {
        "type": "string",
        "description": "Visibility of event details.",
        "enum": ["default", "public", "private", "confidential"]
      },
      "GuestPolicy": {
        "type": "object",
        "description": "The switches an organizer sets on an event to bound what its guests may\ndo. Google omits a switch from the payload while it holds its default.",
        "required": ["canModify", "canInviteOthers", "canSeeOtherGuests"],
        "properties": {
          "canInviteOthers": {
            "type": "boolean",
            "description": "Whether guests may invite others."
          },
          "canModify": {
            "type": "boolean",
            "description": "Whether guests may change the event, including its guest list."
          },
          "canSeeOtherGuests": {
            "type": "boolean",
            "description": "Whether guests may see the guest list."
          }
        }
      },
      "InsightCounts": {
        "type": "object",
        "description": "Counts can overlap: a rescheduled event can also be completed or cancelled.",
        "required": [
          "total",
          "completed",
          "rescheduled",
          "cancelled",
          "guestNoShow",
          "hostNoShow"
        ],
        "properties": {
          "cancelled": {
            "type": "integer",
            "format": "int32",
            "description": "Cancelled bookings, grouped by their scheduled start.",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "format": "int32",
            "description": "Confirmed, ended bookings excluding explicit no-shows.",
            "minimum": 0
          },
          "guestNoShow": {
            "type": "integer",
            "format": "int32",
            "description": "Explicit guest no-shows only.",
            "minimum": 0
          },
          "hostNoShow": {
            "type": "integer",
            "format": "int32",
            "description": "Explicit host no-shows only.",
            "minimum": 0
          },
          "rescheduled": {
            "type": "integer",
            "format": "int32",
            "description": "Bookings with at least one completed reschedule, counted once.",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "All bookings except failed and processing requests.",
            "minimum": 0
          }
        }
      },
      "InsightPeriod": {
        "type": "object",
        "description": "One complete period of metrics and chart data, with no guest contact information.",
        "required": [
          "counts",
          "meetingMinutes",
          "averageMinutes",
          "days",
          "hours",
          "eventCounts",
          "hostCounts"
        ],
        "properties": {
          "averageMinutes": {
            "type": "number",
            "format": "double",
            "description": "Average scheduled duration of all confirmed bookings, including future ones."
          },
          "counts": {
            "$ref": "#/components/schemas/InsightCounts",
            "description": "Summary event counts."
          },
          "days": {
            "type": "object",
            "description": "Local-date counts, including dates with zero bookings.",
            "additionalProperties": {
              "$ref": "#/components/schemas/InsightCounts"
            },
            "propertyNames": {
              "type": "string",
              "format": "date"
            }
          },
          "eventCounts": {
            "type": "object",
            "description": "Booking counts by link identity.",
            "additionalProperties": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string",
              "format": "uuid"
            }
          },
          "hostCounts": {
            "type": "object",
            "description": "Booking counts by host; collective bookings count once for each host.",
            "additionalProperties": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "hours": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Booking counts by local hour, indexed from 0 to 23."
          },
          "meetingMinutes": {
            "type": "number",
            "format": "double",
            "description": "Scheduled minutes of completed meetings, not actual call duration."
          }
        }
      },
      "InsightQuery": {
        "type": "object",
        "description": "Inclusive local dates and optional booking/host filters.",
        "required": ["from", "to", "timeZone"],
        "properties": {
          "eventTypeId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Restrict to one booking link; omit for all links."
          },
          "from": {
            "type": "string",
            "format": "date",
            "description": "First local date, inclusive."
          },
          "hostId": {
            "type": ["string", "null"],
            "description": "Restrict to one assigned host; omit for all hosts."
          },
          "timeZone": {
            "type": "string",
            "description": "IANA zone used for dates and hour-of-day grouping."
          },
          "to": {
            "type": "string",
            "format": "date",
            "description": "Last local date, inclusive; maximum 366 days."
          }
        },
        "additionalProperties": false
      },
      "InviteCalendarEventGuestsRequest": {
        "type": "object",
        "description": "Request body adding guests to an event without touching anyone already\ninvited.",
        "required": ["guests"],
        "properties": {
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Calendar whose copy of the event is written, for an event synced from\nmore than one calendar. Omit to write the canonical copy."
          },
          "guests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarGuestInputBody"
            },
            "description": "Guests to add; anyone already on the event is skipped."
          },
          "inbox": {
            "type": ["string", "null"],
            "description": "Inbox address holding the copy this request changes. An agent run\nmust name it when the meeting is on more than one of the requester's\ninboxes, and it must be the inbox holding the addressed copy; a\nmismatch is refused whoever sends it."
          },
          "recurrenceId": {
            "type": ["string", "null"],
            "description": "Original-start key of the occurrence the guests are added to."
          },
          "scope": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CalendarUpdateScopeParam",
                "description": "How much of a recurring series gains the guests. Omit to let\n`recurrenceId` decide: the identified occurrence alone when one is\nsupplied, otherwise the whole event or series. An explicit\n`this_event` scope requires `recurrenceId`."
              }
            ]
          }
        }
      },
      "ListCalendarsResponse": {
        "type": "object",
        "description": "Calendars visible to the requester across connected and delegated inboxes.",
        "required": ["calendars"],
        "properties": {
          "calendars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VisibleCalendar"
            },
            "description": "Primaries and writable calendars first."
          }
        }
      },
      "OutOfOfficeAutoDeclineMode": {
        "type": "string",
        "description": "How an out-of-office event responds to conflicting invitations, mirroring\nGoogle's `autoDeclineMode`.",
        "enum": [
          "decline_none",
          "decline_all_conflicting_invitations",
          "decline_only_new_conflicting_invitations"
        ]
      },
      "OutOfOfficeProperties": {
        "type": "object",
        "description": "The extra properties Google requires on an out-of-office event, mirroring\nits `outOfOfficeProperties` block. Their presence on a draft or patch is\nwhat marks the mutation as out-of-office.",
        "properties": {
          "autoDeclineMode": {
            "$ref": "#/components/schemas/OutOfOfficeAutoDeclineMode",
            "description": "How conflicting invitations are handled while the user is out."
          },
          "declineMessage": {
            "type": ["string", "null"],
            "description": "Message returned to organizers whose invitations are auto-declined."
          }
        }
      },
      "PrepareCalendarReplacementRequest": {
        "type": "object",
        "description": "A read-only preview request. Confirmation uses the returned operation identity.",
        "required": ["removeConference"],
        "properties": {
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Exact calendar copy; defaults to canonical."
          },
          "recurrenceId": {
            "type": ["string", "null"],
            "description": "Original-start key; omitted to replace the entire series."
          },
          "removeConference": {
            "type": "boolean",
            "description": "Omit the provider conference in the replacement."
          }
        }
      },
      "ProfileResponse": {
        "type": "object",
        "description": "Booking settings of one profile.",
        "required": ["profile"],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/BookingProfile",
            "description": "Full settings, including the revision to save against."
          }
        }
      },
      "ReceiptResponse": {
        "type": "object",
        "description": "A booking with its booker management capability.",
        "required": ["booking", "token", "scheduleTimeZone"],
        "properties": {
          "booking": {
            "$ref": "#/components/schemas/Booking",
            "description": "The booking."
          },
          "scheduleTimeZone": {
            "type": "string",
            "description": "IANA time zone of the booking's availability schedule."
          },
          "token": {
            "type": "string",
            "format": "uuid",
            "description": "Bearer capability for the booker's receipt, reschedule and cancel pages."
          }
        }
      },
      "RefreshCalendarEvent": {
        "oneOf": [
          {
            "type": "object",
            "description": "A sync run committed changes for `link_id`; viewers should refetch.",
            "required": ["link_id", "team_ooo_changed", "event"],
            "properties": {
              "event": {
                "type": "string",
                "enum": ["synced"]
              },
              "link_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connected inbox whose calendars changed."
              },
              "team_ooo_changed": {
                "type": "boolean",
                "description": "False only when the run excludes changes to teammate OOO projections."
              }
            }
          },
          {
            "type": "object",
            "description": "Team projections need refreshing after a sync or entitlement change.",
            "required": ["team_ooo_changed", "event"],
            "properties": {
              "event": {
                "type": "string",
                "enum": ["team_sharing_changed"]
              },
              "team_ooo_changed": {
                "type": "boolean",
                "description": "True for sharing changes and any possibly affected OOO projection."
              }
            }
          },
          {
            "type": "object",
            "description": "The viewer's request to join a shared event was answered.",
            "required": ["event_id", "event"],
            "properties": {
              "event": {
                "type": "string",
                "enum": ["join_request_answered"]
              },
              "event_id": {
                "type": "string",
                "format": "uuid",
                "description": "The shared event they asked to join."
              }
            }
          }
        ],
        "description": "Realtime signal that a connected inbox's calendar projection changed."
      },
      "ReplacementStatus": {
        "type": "string",
        "description": "User-visible workflow state.",
        "enum": ["needs_confirmation", "in_progress", "complete"]
      },
      "RespondToJoinRequestRequest": {
        "type": "object",
        "description": "Request body answering a join request.",
        "required": ["decision"],
        "properties": {
          "decision": {
            "$ref": "#/components/schemas/CalendarJoinRequestDecision",
            "description": "The sharer's answer."
          }
        }
      },
      "RsvpCalendarEventRequest": {
        "type": "object",
        "description": "Request body setting the requester's RSVP on an event.",
        "required": ["response"],
        "properties": {
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Calendar whose copy of the event is answered, for an event synced\nfrom more than one calendar. Omit to answer on the canonical copy."
          },
          "recurrenceId": {
            "type": ["string", "null"],
            "description": "Original-start key of the occurrence the response targets."
          },
          "respondingEmail": {
            "type": ["string", "null"],
            "description": "The owned connected address whose attendance is changed. Validated by the domain.\nOmit to answer as the inbox the addressed copy syncs through."
          },
          "response": {
            "$ref": "#/components/schemas/AttendeeResponseStatus",
            "description": "The response to record for the connected account."
          },
          "scope": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CalendarRsvpScopeParam",
                "description": "How much of a recurring series the response covers. Omit to let\n`recurrenceId` decide: the identified occurrence alone when one is\nsupplied, otherwise the whole series. An explicit `this_event` scope\nrequires `recurrenceId`, so a scoped request is never silently\nwidened to the series."
              }
            ]
          }
        }
      },
      "SchedulingMode": {
        "type": "string",
        "description": "Team host assignment policy.",
        "enum": ["individual", "collective", "roundRobin"]
      },
      "SlotsResponse": {
        "type": "object",
        "description": "Available start times.",
        "required": ["slots"],
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingSlot"
            },
            "description": "Every available slot."
          }
        }
      },
      "TeamCalendarSharing": {
        "type": "string",
        "description": "What a user exposes through their team membership.",
        "enum": ["all", "busy_only", "none"]
      },
      "TeamCalendarSharingBody": {
        "type": "object",
        "description": "Own-user sharing preference.",
        "required": ["sharing"],
        "properties": {
          "sharing": {
            "$ref": "#/components/schemas/TeamCalendarSharing",
            "description": "Busy-only is the default, including when no setting has been saved."
          }
        }
      },
      "UpdateCalendarEventRequest": {
        "type": "object",
        "description": "Request body patching an event; omitted fields are left untouched.",
        "properties": {
          "attendees": {
            "type": ["array", "null"],
            "items": {
              "$ref": "#/components/schemas/CalendarAttendeeInputBody"
            },
            "description": "Replacement attendee list."
          },
          "calendarId": {
            "type": ["string", "null"],
            "format": "uuid",
            "description": "Calendar whose copy of the event is patched, for an event synced from\nmore than one calendar. Omit to patch the canonical copy."
          },
          "conference": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConferenceChange",
                "description": "Conference change: `google_meet` attaches a freshly generated Meet,\n`none` detaches the current conference, and omitting it leaves the\nconference untouched.\n\nA third-party conference is replaced or detached like any other, since\nthe request is explicit. Omit the field to leave it alone."
              }
            ]
          },
          "description": {
            "type": ["string", "null"],
            "description": "Replacement description; an empty string clears it."
          },
          "guestPolicy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GuestPolicy",
                "description": "Replacement guest policy; only the organizer of a Google event may\nchange it, for the whole event or series. Omit to leave it untouched."
              }
            ]
          },
          "inbox": {
            "type": ["string", "null"],
            "description": "Inbox address holding the copy this request changes. An agent run\nmust name it when the meeting is on more than one of the requester's\ninboxes, and it must be the inbox holding the addressed copy; a\nmismatch is refused whoever sends it."
          },
          "location": {
            "type": ["string", "null"],
            "description": "Replacement location; an empty string clears it."
          },
          "outOfOffice": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutOfOfficeProperties",
                "description": "Replacement out-of-office properties, applied only to an event that is\nalready out-of-office — the provider event type is immutable. Omit to\nleave them untouched."
              }
            ]
          },
          "recurrenceId": {
            "type": ["string", "null"],
            "description": "Original-start key of the occurrence the update targets."
          },
          "recurrenceLines": {
            "type": ["array", "null"],
            "items": {
              "type": "string"
            },
            "description": "Replacement recurrence properties; an empty list clears them."
          },
          "reminders": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventReminders",
                "description": "Replacement reminder configuration."
              }
            ]
          },
          "scope": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CalendarUpdateScopeParam",
                "description": "How much of a recurring series the update covers. Omit to let\n`recurrenceId` decide: the identified occurrence alone when one is\nsupplied, otherwise the whole event or series. An explicit\n`this_event` scope requires `recurrenceId`, so a scoped request is\nnever silently widened to the series."
              }
            ]
          },
          "time": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventTime",
                "description": "Replacement time."
              }
            ]
          },
          "title": {
            "type": ["string", "null"],
            "description": "Replacement title; an empty string clears it."
          },
          "transparency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventTransparency",
                "description": "Replacement transparency."
              }
            ]
          },
          "visibility": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventVisibility",
                "description": "Replacement visibility."
              }
            ]
          }
        }
      },
      "ViewerCapabilities": {
        "type": "object",
        "description": "What the viewing requester may do with an event.",
        "required": [
          "editDetails",
          "inviteGuests",
          "removeGuests",
          "setGuestPolicy",
          "rsvp",
          "organize"
        ],
        "properties": {
          "editDetails": {
            "type": "boolean",
            "description": "Change the event's details (title, time, description, conference)."
          },
          "inviteGuests": {
            "type": "boolean",
            "description": "Add guests."
          },
          "organize": {
            "type": "boolean",
            "description": "Act as the event's organizer: replace its whole guest list and manage\nits conferencing."
          },
          "removeGuests": {
            "type": "boolean",
            "description": "Remove guests."
          },
          "rsvp": {
            "type": "boolean",
            "description": "Answer the invitation."
          },
          "setGuestPolicy": {
            "type": "boolean",
            "description": "Change the event's guest policy, which only Google calendars have."
          }
        }
      },
      "VisibleCalendar": {
        "type": "object",
        "description": "A calendar visible to a requester, listed for pickers and filters.",
        "required": [
          "provider",
          "capabilities",
          "id",
          "emailLinkId",
          "emailAddress",
          "name",
          "isPrimary",
          "isWritable",
          "isSubscription",
          "defaultReminders"
        ],
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/CalendarCapabilities",
            "description": "Provider features available on this actual calendar."
          },
          "color": {
            "type": ["string", "null"],
            "description": "Provider color."
          },
          "contributesToAvailability": {
            "type": "boolean",
            "description": "Whether this calendar counts toward the requester's busy time: their\nsetting, by default only the primary calendars of inboxes they own.\nThe nearest thing to \"this is the requester's own\": a provider's\naccess role only says what they may do, on a colleague's calendar too."
          },
          "defaultReminders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventReminderOverride"
            },
            "description": "Default reminders applied to events that keep `useDefault`."
          },
          "emailAddress": {
            "type": "string",
            "description": "Connected inbox address, for grouping in multi-inbox pickers."
          },
          "emailLinkId": {
            "type": "string",
            "format": "uuid",
            "description": "Connected inbox that syncs this calendar."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Persisted Macro calendar identifier."
          },
          "isPrimary": {
            "type": "boolean",
            "description": "Whether this is its account's primary calendar."
          },
          "isSubscription": {
            "type": "boolean",
            "description": "Whether this is one of Google's shared system calendars (holidays,\nbirthdays) the account subscribes to rather than one a person maintains."
          },
          "isWritable": {
            "type": "boolean",
            "description": "Whether the grant can create and modify events on this calendar."
          },
          "name": {
            "type": "string",
            "description": "Provider display name."
          },
          "provider": {
            "$ref": "#/components/schemas/CalendarProvider",
            "description": "Calendar provider, for display and reconnect routing."
          },
          "syncError": {
            "type": ["string", "null"],
            "description": "A persistent sync failure isolated to this calendar, surfaced so the\nsettings row can badge it. `None` while the calendar is syncing\nnormally or a failure has not yet crossed the persistence threshold."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "calendar_events",
      "description": "Macro Calendar Service"
    },
    {
      "name": "scheduling",
      "description": "Booking links, bookings and booking settings"
    }
  ]
}