{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "http"
  ],
  "swagger": "2.0",
  "info": {
    "description": "API for Choir Central",
    "title": "choircentral",
    "version": "0.1"
  },
  "paths": {
    "/admin/audit-events": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists audit events for platform administration",
        "operationId": "listAdminAuditEvents",
        "parameters": [
          {
            "type": "string",
            "description": "Only events associated with this organisation",
            "name": "organisationID",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Only events performed by this user",
            "name": "actorUserID",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Only events for this API operation ID",
            "name": "operationID",
            "in": "query"
          },
          {
            "enum": [
              "succeeded",
              "unauthenticated",
              "denied",
              "invalid",
              "failed",
              "partially_completed"
            ],
            "type": "string",
            "description": "Only events with this outcome",
            "name": "outcome",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Only events associated with this request",
            "name": "requestID",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Target type; requires organisationID and targetID",
            "name": "targetType",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Target ID; requires organisationID and targetType",
            "name": "targetID",
            "in": "query"
          },
          {
            "type": "string",
            "format": "date-time",
            "description": "Include events recorded at or after this time",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "format": "date-time",
            "description": "Include events recorded at or before this time",
            "name": "to",
            "in": "query"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 50,
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminAuditEventPage"
            }
          },
          "400": {
            "description": "Invalid filters, date range, limit, or cursor"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/billing": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists stored Stripe billing accounts for platform administration",
        "operationId": "listAdminBillingAccounts",
        "parameters": [
          {
            "enum": [
              "live",
              "test"
            ],
            "type": "string",
            "default": "live",
            "description": "Billing environment to list",
            "name": "mode",
            "in": "query"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 50,
            "description": "Maximum billing accounts to return",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminBillingAccountPage"
            }
          },
          "400": {
            "description": "Invalid mode, limit, or cursor"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/dashboard": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets the platform administration dashboard summary",
        "operationId": "getAdminDashboard",
        "parameters": [
          {
            "enum": [
              "live",
              "test"
            ],
            "type": "string",
            "default": "live",
            "description": "Environment to summarise",
            "name": "mode",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminDashboard"
            }
          },
          "400": {
            "description": "Invalid mode"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/email-deliveries": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists Amazon SES email deliveries for platform administration",
        "operationId": "listAdminSESEmailDeliveries",
        "parameters": [
          {
            "type": "string",
            "format": "email",
            "description": "Exact recipient email address",
            "name": "recipient",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Exact organisation ID",
            "name": "organisationID",
            "in": "query"
          },
          {
            "enum": [
              "processing",
              "retrying",
              "suppressed",
              "accepted",
              "delivered",
              "delivery_delayed",
              "rejected",
              "transient_bounce",
              "permanent_bounce",
              "complained",
              "rendering_failed",
              "failed"
            ],
            "type": "string",
            "description": "Exact current delivery status",
            "name": "status",
            "in": "query"
          },
          {
            "type": "string",
            "format": "date-time",
            "description": "Include deliveries created at or after this time",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "format": "date-time",
            "description": "Include deliveries created at or before this time",
            "name": "to",
            "in": "query"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 50,
            "description": "Maximum number of deliveries to return",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminSESEmailDeliveryPage"
            }
          },
          "400": {
            "description": "Invalid filter or cursor"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/email-deliveries/{deliveryID}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets an Amazon SES email delivery timeline for platform administration",
        "operationId": "getAdminSESEmailDelivery",
        "parameters": [
          {
            "maxLength": 64,
            "minLength": 64,
            "type": "string",
            "description": "SHA-256 delivery identifier",
            "name": "deliveryID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminSESEmailDelivery"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Delivery not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/email-incidents": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists recipient-level email delivery incidents for platform administration",
        "operationId": "listAdminEmailIncidents",
        "parameters": [
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 50,
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminEmailIncidentPage"
            }
          },
          "400": {
            "description": "Invalid limit or cursor"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/feature-flags": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets the feature flags enabled for everyone",
        "operationId": "getAdminGlobalFeatureFlagAssignments",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignments"
            }
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "description": "Removing a flag here leaves direct user and organisation assignments in place.",
        "tags": [
          "admin"
        ],
        "summary": "Replaces the feature flags enabled for everyone",
        "operationId": "putAdminGlobalFeatureFlagAssignments",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignmentUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignments"
            }
          },
          "400": {
            "description": "Unknown feature flag key"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/feedback-screenshots/{userID}/{screenshotID}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets a short-lived private feedback screenshot URL",
        "operationId": "getAdminFeedbackScreenshotURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "type": "string",
            "name": "screenshotID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Screenshot URL created",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Screenshot not found or expired"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/operations/queues/{queueName}/messages": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Peeks at messages in a dead-letter queue without deleting them",
        "operationId": "getAdminQueueMessages",
        "parameters": [
          {
            "type": "string",
            "description": "Name of the dead-letter queue to inspect",
            "name": "queueName",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminQueueMessages"
            }
          },
          "400": {
            "description": "Queue is not an inspectable dead-letter queue"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "admin"
        ],
        "summary": "Removes all messages from an inspectable dead-letter queue",
        "operationId": "purgeAdminQueue",
        "parameters": [
          {
            "type": "string",
            "description": "Name of the dead-letter queue to purge",
            "name": "queueName",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Purge requested"
          },
          "400": {
            "description": "Queue is not an inspectable dead-letter queue or could not be purged"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/operations/status": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets platform deployment and AWS operations status",
        "operationId": "getAdminOperationsStatus",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminOperationsStatus"
            }
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/operations/test-error": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Emits a test backend error for monitoring verification",
        "operationId": "triggerAdminTestError",
        "responses": {
          "204": {
            "description": "Test error emitted"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisation/{organisationID}/billing/reconcile": {
      "post": {
        "description": "Platform administrators only. Preserves any active manual plan override.",
        "tags": [
          "billing"
        ],
        "summary": "Reconciles stored billing state from Stripe",
        "operationId": "reconcileOrganisationBilling",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationBillingStatus"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation or Stripe customer not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisation/{organisationID}/plan": {
      "put": {
        "description": "Platform administrators only. Manual overrides are not changed by Stripe webhooks.",
        "tags": [
          "billing"
        ],
        "summary": "Sets a manual organisation plan override",
        "operationId": "setManualOrganisationPlan",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SetManualOrganisationPlanRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationBillingStatus"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "description": "Platform administrators only. Reconciles the effective plan from Stripe when a customer exists.",
        "tags": [
          "billing"
        ],
        "summary": "Returns an organisation to Stripe-managed plan state",
        "operationId": "clearManualOrganisationPlan",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationBillingStatus"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists organisations for platform administration",
        "operationId": "listAdminOrganisations",
        "parameters": [
          {
            "enum": [
              "live",
              "test"
            ],
            "type": "string",
            "default": "live",
            "description": "Organisation environment to list",
            "name": "mode",
            "in": "query"
          },
          {
            "minLength": 1,
            "type": "string",
            "description": "Case-insensitive name substring or exact organisation ID",
            "name": "query",
            "in": "query"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 50,
            "description": "Maximum organisations to return",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminOrganisationPage"
            }
          },
          "400": {
            "description": "Invalid mode, limit, cursor, or query"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Creates a private test organisation for an existing live user",
        "operationId": "createAdminTestOrganisation",
        "parameters": [
          {
            "description": "Test organisation to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AdminCreateTestOrganisationRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "400": {
            "description": "Invalid owner, name, or voicing"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Owner not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets an organisation for platform administration",
        "operationId": "getAdminOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminOrganisationDetail"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}/billing": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets stored billing state for an organisation",
        "operationId": "getAdminOrganisationBilling",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminOrganisationBilling"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}/billing/invoices": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists Stripe invoices for an organisation",
        "operationId": "listAdminOrganisationInvoices",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 20,
            "description": "Maximum invoices to return",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminInvoicePage"
            }
          },
          "400": {
            "description": "Invalid limit or cursor"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          },
          "503": {
            "description": "Stripe unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}/events": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists event summaries for an organisation",
        "operationId": "listAdminOrganisationEvents",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AdminOrganisationEventSummary"
              }
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}/feature-flags": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets enabled feature flag assignments for an organisation",
        "operationId": "getAdminOrganisationFeatureFlagAssignments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignments"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "admin"
        ],
        "summary": "Replaces enabled feature flag assignments for an organisation",
        "operationId": "putAdminOrganisationFeatureFlagAssignments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignmentUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated assignments",
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignments"
            }
          },
          "400": {
            "description": "Unknown feature flag key"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}/invites/{inviteID}": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Resends a pending organisation invitation using the seven-day cooldown and fair-use rules",
        "operationId": "resendAdminOrganisationInvite",
        "parameters": [
          {
            "type": "string",
            "name": "organisationID",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "name": "inviteID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Invitation queued"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation or invitation not found"
          },
          "429": {
            "description": "Seven-day invitation cooldown, monthly fair-use allowance, or daily delivery safeguard exceeded"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "admin"
        ],
        "summary": "Revokes a pending organisation invitation and removes its placeholder member",
        "operationId": "revokeAdminOrganisationInvite",
        "parameters": [
          {
            "type": "string",
            "name": "organisationID",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "name": "inviteID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Invitation revoked or already absent"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/organisations/{organisationID}/ownership": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Atomically transfers an organisation owner role to an existing full member",
        "operationId": "transferAdminOrganisationOwnership",
        "parameters": [
          {
            "type": "string",
            "name": "organisationID",
            "in": "path",
            "required": true
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AdminTransferOwnershipRequest"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Ownership transferred"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Organisation not found"
          },
          "409": {
            "description": "Source is not an owner or target is not an eligible member"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/providers/status": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets cached connectivity and configuration status for external providers",
        "operationId": "getAdminProviderStatus",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminProviderHealth"
            }
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/ses/health": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets account-wide Amazon SES sending health and recent aggregate metrics",
        "operationId": "getAdminSESHealth",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminSESHealth"
            }
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/ses/message-insights": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets operational Amazon SES events for a stored delivery incident",
        "operationId": "getAdminSESMessageInsight",
        "parameters": [
          {
            "minLength": 1,
            "type": "string",
            "description": "Stored Amazon SES delivery incident ID",
            "name": "incidentID",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminSESMessageInsight"
            }
          },
          "400": {
            "description": "Incident ID is required"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Stored Amazon SES incident not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/users": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Lists users for platform administration",
        "operationId": "listAdminUsers",
        "parameters": [
          {
            "enum": [
              "live",
              "test"
            ],
            "type": "string",
            "default": "live",
            "description": "User environment to list",
            "name": "mode",
            "in": "query"
          },
          {
            "minLength": 1,
            "type": "string",
            "description": "Case-insensitive name substring, exact user ID, Clerk ID, or email address",
            "name": "query",
            "in": "query"
          },
          {
            "enum": [
              "name",
              "email",
              "id",
              "lastActivityAt",
              "createdAt"
            ],
            "type": "string",
            "description": "User field used for directory ordering; requires direction",
            "name": "sort",
            "in": "query"
          },
          {
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Sort direction; requires sort",
            "name": "direction",
            "in": "query"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 50,
            "description": "Maximum users to return",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminUserPage"
            }
          },
          "400": {
            "description": "Invalid mode, query, limit, or cursor"
          },
          "403": {
            "description": "Platform administrator required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/users/{userID}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets a user for platform administration",
        "operationId": "getAdminUser",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminUserDetail"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/users/{userID}/clerk-status": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets live Clerk account status for a platform user",
        "operationId": "getAdminUserClerkStatus",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/AdminUserClerkStatus"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "Platform user not found"
          },
          "503": {
            "description": "Clerk unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/admin/users/{userID}/feature-flags": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Gets enabled feature flag assignments for a user",
        "operationId": "getAdminUserFeatureFlagAssignments",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignments"
            }
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "admin"
        ],
        "summary": "Replaces enabled feature flag assignments for a user",
        "operationId": "putAdminUserFeatureFlagAssignments",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignmentUpdate"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated assignments",
            "schema": {
              "$ref": "#/definitions/FeatureFlagAssignments"
            }
          },
          "400": {
            "description": "Unknown feature flag key"
          },
          "403": {
            "description": "Platform administrator required"
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/billing/pricing": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Gets current public Pro pricing directly from Stripe",
        "operationId": "getPublicPricing",
        "responses": {
          "200": {
            "description": "Current catalogue pricing; never cached",
            "schema": {
              "$ref": "#/definitions/ProPricing"
            }
          },
          "503": {
            "description": "Pricing unavailable"
          }
        },
        "security": []
      }
    },
    "/cal/token/generate": {
      "get": {
        "tags": [
          "calendar"
        ],
        "summary": "Gets a user calendar token",
        "operationId": "getUserCalendarToken",
        "parameters": [
          {
            "pattern": "^org_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
            "type": "string",
            "description": "Organisation to scope the token",
            "name": "organisationID",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "calendar"
        ],
        "summary": "Replaces a user calendar token, revoking the previous feed URL",
        "operationId": "rotateUserCalendarToken",
        "parameters": [
          {
            "pattern": "^org_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
            "type": "string",
            "description": "Organisation to scope the token",
            "name": "organisationID",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/cal/{token}.ics": {
      "get": {
        "description": "Returns an ICS calendar feed containing visible events from 12 months in the past through 24 months in the future",
        "produces": [
          "text/calendar"
        ],
        "tags": [
          "calendar"
        ],
        "summary": "Gets a calendar feed",
        "operationId": "getCalendarFeed",
        "parameters": [
          {
            "type": "string",
            "description": "User-specific calendar token",
            "name": "token",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar feed generated successfully",
            "schema": {
              "type": "string"
            },
            "headers": {
              "Content-Type": {
                "type": "string",
                "default": "text/calendar",
                "description": "MIME type of the calendar feed"
              }
            }
          }
        }
      }
    },
    "/event-rsvp": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets event details for an email RSVP capability without changing attendance",
        "operationId": "getEventRSVP",
        "parameters": [
          {
            "$ref": "#/parameters/header_eventRSVPAuthorization"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/EventRSVPDetails"
            }
          },
          "401": {
            "description": "Invalid, expired, revoked, or ineligible RSVP capability"
          }
        }
      }
    },
    "/event-rsvp/response": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Confirms an attendance response using an email RSVP capability",
        "operationId": "respondToEventByEmail",
        "parameters": [
          {
            "$ref": "#/parameters/header_eventRSVPAuthorization"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EventRSVPResponseRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/EventRSVPDetails"
            }
          },
          "400": {
            "description": "Invalid response"
          },
          "401": {
            "description": "Invalid, expired, revoked, or ineligible RSVP capability"
          }
        }
      }
    },
    "/feature-flags": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets effective feature flags for the authenticated user",
        "operationId": "getFeatureFlags",
        "parameters": [
          {
            "pattern": "^org_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
            "type": "string",
            "description": "Optional organisation whose assignments should be included; the user must be a member",
            "name": "organisationID",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FeatureFlagsResponse"
            }
          },
          "403": {
            "description": "User is not a member of the requested organisation"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/feedback": {
      "post": {
        "tags": [
          "feedback"
        ],
        "summary": "Submits feedback",
        "operationId": "submitFeedback",
        "parameters": [
          {
            "description": "Feedback to submit",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FeedbackRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid feedback or screenshot"
          },
          "403": {
            "description": "User is not a member of the requested organisation"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/feedback/screenshot-upload": {
      "post": {
        "tags": [
          "feedback"
        ],
        "summary": "Creates a private feedback screenshot upload",
        "operationId": "getFeedbackScreenshotUploadURL",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FeedbackScreenshotUploadRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Upload created",
            "schema": {
              "$ref": "#/definitions/FeedbackScreenshotUploadURL"
            }
          },
          "400": {
            "description": "Invalid screenshot metadata"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/location/search": {
      "get": {
        "tags": [
          "location"
        ],
        "summary": "Searches for a location (deprecated; use client-side Places Autocomplete)",
        "operationId": "searchLocation",
        "deprecated": true,
        "parameters": [
          {
            "type": "string",
            "description": "Search query",
            "name": "query",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/LocationSearchTextResults"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Creates a new organisation",
        "operationId": "createOrganisation",
        "parameters": [
          {
            "description": "Organisation to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewOrganisationRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation-reply-email/confirm": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Confirms a choir reply email address using the link sent to that address",
        "operationId": "confirmOrganisationReplyEmail",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ConfirmOrganisationReplyEmailRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/ConfirmOrganisationReplyEmailResponse"
            }
          },
          "404": {
            "description": "Invalid, expired or already used confirmation link"
          }
        }
      }
    },
    "/organisation/invites/accept": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Accepts an organisation invitation using an opaque token and a matching verified email",
        "operationId": "acceptOrganisationInviteByToken",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/OnboardingTokenRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accepted"
          },
          "403": {
            "description": "The authenticated user does not have the invited verified email"
          },
          "404": {
            "description": "Invitation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/invites/preview": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Safely previews a pending organisation invitation by opaque token",
        "operationId": "previewOrganisationInvite",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/OnboardingTokenRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationInvitePreview"
            }
          },
          "404": {
            "description": "Invitation not found"
          }
        },
        "security": []
      }
    },
    "/organisation/join-codes/{joinCode}": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Previews the organisation associated with a join code",
        "operationId": "previewOrganisationJoinCode",
        "parameters": [
          {
            "maxLength": 9,
            "minLength": 8,
            "pattern": "^[A-Za-z0-9-]+$",
            "type": "string",
            "name": "joinCode",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationJoinCodePreview"
            }
          },
          "404": {
            "description": "Join code not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/join-codes/{joinCode}/join": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Immediately joins the authenticated user to an organisation by join code",
        "operationId": "joinOrganisationByCode",
        "parameters": [
          {
            "maxLength": 9,
            "minLength": 8,
            "pattern": "^[A-Za-z0-9-]+$",
            "type": "string",
            "name": "joinCode",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Joined"
          },
          "404": {
            "description": "Join code not found"
          },
          "409": {
            "description": "User is already a member"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/request_to_join": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Requests to join an organisation",
        "operationId": "requestToJoinOrganisation",
        "parameters": [
          {
            "description": "Request",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/RequestToJoinRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Organisation Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/request_to_join/{requestID}": {
      "delete": {
        "tags": [
          "organisation"
        ],
        "summary": "Cancels a request to join an organisation",
        "operationId": "cancelRequestToJoinOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_requestID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets an organisation",
        "operationId": "getOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/Organisation"
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "patch": {
        "description": "Updates organisation details such as name, public-search visibility, timezone, logo, and brand colour.\nFor timezone, either provide a timezone directly,\nor set timezoneFromLocation to true to derive the timezone from the organisation's\nlocation using the Google Timezone API.\n",
        "tags": [
          "organisation"
        ],
        "summary": "Updates an organisation",
        "operationId": "updateOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Organisation fields to update",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateOrganisationRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/UpdateOrganisationResponse"
            }
          },
          "400": {
            "description": "Bad Request (invalid timezone, location not set or invalid reply email)"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Storage limit exceeded",
            "schema": {
              "$ref": "#/definitions/StorageLimitExceeded"
            }
          },
          "429": {
            "description": "Too many reply email confirmation requests"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/billing/checkout": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Creates a Stripe checkout session for upgrading plan",
        "operationId": "createCheckout",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCheckoutRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/CheckoutURLResponse"
            }
          },
          "400": {
            "description": "Invalid plan, or the terms have not been accepted"
          },
          "403": {
            "description": "Billing management permission required"
          },
          "404": {
            "description": "Organisation not found"
          },
          "409": {
            "description": "The displayed quote is missing or has changed. Reload pricing and ask the customer to confirm before trying again."
          },
          "503": {
            "description": "Pricing unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/billing/checkout/{checkoutSessionID}": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Verifies a Stripe checkout session and synchronises subscription state",
        "operationId": "confirmCheckout",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "pattern": "^cs_[a-zA-Z0-9_]+$",
            "type": "string",
            "name": "checkoutSessionID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/CheckoutConfirmation"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Organisation or checkout session not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/billing/contact": {
      "put": {
        "description": "The billing contact must be an active member of the organisation.",
        "tags": [
          "billing"
        ],
        "summary": "Updates the organisation billing contact",
        "operationId": "updateOrganisationBillingContact",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateOrganisationBillingContactRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationBillingStatus"
            }
          },
          "400": {
            "description": "Target user is not an active organisation member"
          },
          "403": {
            "description": "Billing management permission required"
          },
          "404": {
            "description": "Stripe customer not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/billing/portal": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Gets a Stripe billing portal URL for managing subscription",
        "operationId": "getBillingPortal",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/CheckoutURLResponse"
            }
          },
          "403": {
            "description": "Billing management permission required"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/billing/pricing": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Gets current Pro pricing in the organisation's Stripe mode",
        "operationId": "getOrganisationPricing",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "Current catalogue pricing, not the existing subscription price; never cached",
            "schema": {
              "$ref": "#/definitions/ProPricing"
            }
          },
          "403": {
            "description": "Organisation membership required"
          },
          "503": {
            "description": "Pricing unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/billing/status": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Gets the effective plan and Stripe subscription status",
        "operationId": "getBillingStatus",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationBillingStatus"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Organisation not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/cloud_documents": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets cloud documents",
        "operationId": "getOrganisationCloudDocuments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationCloudDocument"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/cloudlink/upload": {
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Uploads a cloud link document (e.g. google docs)",
        "operationId": "uploadCloudLink",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Document to upload",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UploadCloudLinkRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "$ref": "#/responses/TierUpgradeRequired"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/contactDetails/{userID}": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets contact details for a user in an organisation",
        "operationId": "getUserContactDetailsForOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/UserContactDetails"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/directories": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets document directories",
        "operationId": "getOrganisationDirectories",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/DocumentDirectory"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Creates a document directory",
        "operationId": "createOrganisationDirectory",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Directory to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewDocumentDirectoryRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/directories/{directoryID}": {
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Deletes a document directory",
        "operationId": "deleteOrganisationDirectory",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_directoryID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/directories/{directoryID}/export": {
      "post": {
        "tags": [
          "archive"
        ],
        "summary": "Creates an asynchronous ZIP export of a document directory and its descendants",
        "operationId": "createOrganisationDirectoryExport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_directoryID"
          }
        ],
        "responses": {
          "202": {
            "description": "Export queued",
            "schema": {
              "$ref": "#/definitions/ArchiveExport"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Directory not found"
          },
          "409": {
            "description": "Invalid directory hierarchy"
          },
          "503": {
            "description": "Export service unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/directories/{directoryID}/rename": {
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Renames a document directory",
        "operationId": "renameOrganisationDirectory",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_directoryID"
          },
          {
            "description": "New name for the directory",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/directories/{directoryID}/visibility": {
      "put": {
        "tags": [
          "document"
        ],
        "summary": "Updates the usergroups a document directory is visible to",
        "operationId": "updateOrganisationDirectoryVisibility",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_directoryID"
          },
          {
            "description": "Visibility for the directory. An empty usergroup array plus visibleToAdminsOnly false means visible to all members.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "visibleToUsergroupIDs",
                "visibleToAdminsOnly"
              ],
              "properties": {
                "visibleToAdminsOnly": {
                  "type": "boolean"
                },
                "visibleToUsergroupIDs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/directory_contents": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets the directories and documents for a directory",
        "operationId": "getOrganisationDirectoryContents",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "Directory to list contents for. Root if empty.",
            "name": "directoryID",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/DirectoryContents"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/document_email": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets your personal document upload address and recent imports",
        "operationId": "getDocumentEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "Personal upload settings",
            "schema": {
              "$ref": "#/definitions/DocumentEmailSettings"
            }
          },
          "403": {
            "description": "Document management permission required"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Creates or replaces your personal document upload address",
        "operationId": "resetDocumentEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "Personal upload settings",
            "schema": {
              "$ref": "#/definitions/DocumentEmailSettings"
            }
          },
          "403": {
            "description": "Document management permission required"
          },
          "409": {
            "description": "Settings changed concurrently or no verified email address"
          },
          "503": {
            "description": "Email uploads are unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Revokes your personal document upload address",
        "operationId": "disableDocumentEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "204": {
            "description": "Address disabled"
          },
          "403": {
            "description": "Document management permission required"
          },
          "409": {
            "description": "Settings changed concurrently"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/documents": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets documents",
        "operationId": "getOrganisationDocuments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationDocumentMeta"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/documents/export": {
      "post": {
        "tags": [
          "archive"
        ],
        "summary": "Creates an asynchronous ZIP export of all organisation documents",
        "operationId": "createOrganisationDocumentsExport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "202": {
            "description": "Export queued",
            "schema": {
              "$ref": "#/definitions/ArchiveExport"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "503": {
            "description": "Export service unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/documents/move": {
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Moves documents into a directory",
        "operationId": "moveOrganisationDocuments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Documents to move",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MoveDocumentsRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "409": {
            "description": "Moving the documents would broaden their visibility and requires confirmation"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/documents/{documentID}": {
      "post": {
        "tags": [
          "document"
        ],
        "summary": "Edits a document",
        "operationId": "editOrganisationDocument",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_documentID"
          },
          {
            "description": "Document to edit",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EditOrganisationDocumentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "409": {
            "description": "Moving the document would broaden its visibility without confirmation"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "document"
        ],
        "summary": "Deletes a document",
        "operationId": "deleteOrganisationDocument",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_documentID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Organisation Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/event/{eventID}/ticketing/grant": {
      "post": {
        "description": "Nonproduction only. Resolves the authoritative association and issues a short-lived grant for exact command string bytes to the authenticated acting subject. An omitted command returns association context only. Does not provision or enable ticketing.",
        "tags": [
          "ticket"
        ],
        "operationId": "issueTicketingGrant",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/TicketingGrantRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verified association and optional exact-byte grant",
            "schema": {
              "$ref": "#/definitions/TicketingGrantResponse"
            }
          },
          "400": {
            "description": "Invalid command"
          },
          "403": {
            "description": "Permission, event, rollout or capability denied"
          },
          "409": {
            "description": "Source revision conflict"
          },
          "503": {
            "description": "Integration not configured"
          }
        },
        "security": [
          {
            "clerk": [
              "usr"
            ]
          }
        ]
      }
    },
    "/organisation/{organisationID}/event/{eventID}/ticketing/setup": {
      "get": {
        "description": "Read-only nonproduction setup defaults. Requires current configure permission, visible event and rollout. Creates no resources and exposes no legal or payment data.",
        "tags": [
          "ticket"
        ],
        "operationId": "getTicketingSetup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved setup state and reusable seller defaults or choir suggestions",
            "schema": {
              "$ref": "#/definitions/TicketingSetupResponse"
            }
          },
          "403": {
            "description": "Permission, event, rollout or source capability denied"
          },
          "409": {
            "description": "Stale source; reload"
          },
          "503": {
            "description": "Setup service unavailable"
          }
        },
        "security": [
          {
            "clerk": [
              "usr"
            ]
          }
        ]
      },
      "post": {
        "description": "Test-only authorised initial setup. Ownership, IDs, schedule and slug are server-derived. Requires independently configured provisioning capability.",
        "tags": [
          "ticket"
        ],
        "operationId": "setupTicketing",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "logoImage": {
                  "description": "Optional bounded inline JPEG replacement for ticketing only. Requires skipChoirLogo. External URLs and SVG are rejected.",
                  "type": "string",
                  "maxLength": 7000
                },
                "skipChoirLogo": {
                  "description": "Explicitly skip copying the choir logo. Supply logoImage for a safe replacement or omit it to start without a logo. Existing seller branding is never overwritten.",
                  "type": "boolean"
                },
                "supportEmail": {
                  "description": "Required for initial setup; omit when recovering the saved association.",
                  "type": "string",
                  "maxLength": 254,
                  "minLength": 3
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saved source association and provisioned draft, or existing association",
            "schema": {
              "$ref": "#/definitions/TicketingGrantResponse"
            }
          },
          "400": {
            "description": "Missing event schedule or invalid contact or replacement image",
            "schema": {
              "$ref": "#/definitions/TicketingSetupError"
            }
          },
          "403": {
            "description": "Permission, event, rollout or capability denied"
          },
          "409": {
            "description": "Concurrent source change; reload before retry"
          },
          "422": {
            "description": "Unsupported choir logo; replace or explicitly continue without logo",
            "schema": {
              "$ref": "#/definitions/TicketingSetupError"
            }
          },
          "503": {
            "description": "Temporary logo or setup service failure; retry is safe",
            "schema": {
              "$ref": "#/definitions/TicketingSetupError"
            }
          }
        },
        "security": [
          {
            "clerk": [
              "usr"
            ]
          }
        ]
      }
    },
    "/organisation/{organisationID}/events": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Creates a new event",
        "operationId": "createOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Event to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateEventRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "type": "string"
            }
          },
          "404": {
            "description": "Organisation Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets an event",
        "operationId": "getOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationEvent"
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "event"
        ],
        "summary": "Updates an event",
        "operationId": "updateOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "description": "Event to update",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateEventRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid event data"
          },
          "403": {
            "description": "Organisation Admin required"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Source event changed or ticketing schedule is locked",
            "schema": {
              "$ref": "#/definitions/EventSourceConflict"
            }
          },
          "422": {
            "description": "Request validation failed"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Deletes an event",
        "operationId": "deleteOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "409": {
            "description": "Linked ticketing history requires a cancellation/refund workflow",
            "schema": {
              "$ref": "#/definitions/EventSourceConflict"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/attachments": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets attachments for an event",
        "operationId": "getEventAttachments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/EventAttachment"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Creates an event attachment record",
        "operationId": "createEventAttachment",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateEventAttachmentRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/attachments/{eventAttachmentID}": {
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Deletes an event attachment",
        "operationId": "deleteEventAttachment",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_eventAttachmentID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/attachments/{eventAttachmentID}/presigned/download": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets a presigned URL for downloading an event attachment",
        "operationId": "getEventAttachmentDownloadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_eventAttachmentID"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/attachments/{eventAttachmentID}/presigned/upload": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets a presigned URL for uploading an event attachment",
        "operationId": "getEventAttachmentUploadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_eventAttachmentID"
          },
          {
            "type": "string",
            "description": "Base64-encoded MD5 hash of the file content",
            "name": "contentMD5",
            "in": "query",
            "required": true
          },
          {
            "type": "string",
            "name": "contentType",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "format": "int64",
            "name": "sizeBytes",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/EventAttachmentUploadURL"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Storage limit exceeded",
            "schema": {
              "$ref": "#/definitions/StorageLimitExceeded"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/attendance/export": {
      "get": {
        "produces": [
          "application/pdf"
        ],
        "tags": [
          "event"
        ],
        "summary": "Exports attendance as PDF",
        "operationId": "exportEventAttendance",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance PDF",
            "schema": {
              "type": "string",
              "format": "binary"
            },
            "headers": {
              "Content-Disposition": {
                "type": "string",
                "description": "Attachment filename for the PDF"
              },
              "Content-Type": {
                "type": "string",
                "default": "application/pdf",
                "description": "MIME type of the PDF"
              }
            },
            "x-responseType": "arraybuffer"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/cancel": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Cancels an event",
        "operationId": "cancelOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Linked ticketing history requires a cancellation/refund workflow",
            "schema": {
              "$ref": "#/definitions/EventSourceConflict"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/cover": {
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Deletes the active and pending cover images for an event",
        "operationId": "deleteEventCover",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Missing events.update permission"
          },
          "404": {
            "description": "Event Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/cover/presigned/upload": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Reserves an event cover and returns a direct S3 upload form",
        "operationId": "getEventCoverUploadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EventCoverUploadRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/EventCoverUploadURL"
            }
          },
          "400": {
            "description": "Invalid image type or size"
          },
          "403": {
            "description": "Missing events.update permission"
          },
          "404": {
            "description": "Event Not Found"
          },
          "409": {
            "description": "Storage limit exceeded",
            "schema": {
              "$ref": "#/definitions/StorageLimitExceeded"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/cover/{variant}/presigned": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Returns a short-lived inline URL for a ready event cover rendition",
        "operationId": "getEventCoverURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "enum": [
              "card",
              "hero"
            ],
            "type": "string",
            "name": "variant",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Event access denied"
          },
          "404": {
            "description": "Event or ready cover Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/documents": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets canonical organisation documents linked to an event",
        "operationId": "getEventDocuments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationDocumentMeta"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/documents/{documentID}": {
      "put": {
        "tags": [
          "event"
        ],
        "summary": "Links an existing organisation document to an event",
        "operationId": "linkDocumentToEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_documentID"
          }
        ],
        "responses": {
          "204": {
            "description": "Linked"
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Removes a document link from an event without deleting the document",
        "operationId": "unlinkDocumentFromEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_documentID"
          }
        ],
        "responses": {
          "204": {
            "description": "Unlinked"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/excludedusers": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets the list of excluded users for an event",
        "operationId": "getExcludedUsersForEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/excludeusers": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Excludes users from an event",
        "operationId": "addExcludedUsersToEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "description": "Users to exclude",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ExcludeUsersRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/excludeusers/remove": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Un-excludes users from an event",
        "operationId": "removeExcludedUsersFromEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "description": "Users to un-exclude",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ExcludeUsersRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/manual-email": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Queues a manual event email to an attendance group",
        "operationId": "sendEventManualEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SendEventManualEmailRequest"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Email queued",
            "schema": {
              "$ref": "#/definitions/EventManualEmailQueued"
            }
          },
          "400": {
            "description": "Invalid request or no matching recipients"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Event not found"
          },
          "409": {
            "description": "Recipient list changed after preview"
          },
          "429": {
            "description": "Monthly recipient or daily campaign limit exceeded"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/manual-email/recipients": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Previews recipients for a manual event email",
        "operationId": "getEventManualEmailRecipients",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "enum": [
              "all",
              "going",
              "no_response",
              "no_response_or_maybe",
              "except_not_going",
              "maybe"
            ],
            "type": "string",
            "name": "group",
            "in": "query",
            "required": true
          },
          {
            "minLength": 1,
            "pattern": "^ugrp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
            "type": "string",
            "description": "Optionally restrict recipients to members of this organisation user group.",
            "name": "usergroupID",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching selected members. Private email preferences are applied only during delivery.",
            "schema": {
              "$ref": "#/definitions/EventManualEmailRecipients"
            }
          },
          "400": {
            "description": "Invalid recipient group"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Event not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/manual-email/schedules": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Lists scheduled manual emails for an event",
        "operationId": "listScheduledEventEmails",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled email campaigns",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ScheduledEventEmail"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Event not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Schedules a manual event email",
        "operationId": "createScheduledEventEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ScheduleEventEmailRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Scheduled email created",
            "schema": {
              "$ref": "#/definitions/ScheduledEventEmail"
            }
          },
          "400": {
            "description": "Invalid schedule or audience"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Event not found"
          },
          "409": {
            "description": "Event or recipients changed after preview"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/manual-email/schedules/{campaignID}": {
      "put": {
        "tags": [
          "event"
        ],
        "summary": "Updates a scheduled manual event email before dispatch",
        "operationId": "updateScheduledEventEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_eventEmailCampaignID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateScheduledEventEmailRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled email updated",
            "schema": {
              "$ref": "#/definitions/ScheduledEventEmail"
            }
          },
          "400": {
            "description": "Invalid schedule or audience"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Campaign not found"
          },
          "409": {
            "description": "Campaign, event, or recipients changed"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Cancels and deletes a scheduled manual event email",
        "operationId": "deleteScheduledEventEmail",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_eventEmailCampaignID"
          },
          {
            "minimum": 1,
            "type": "integer",
            "name": "version",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Scheduled email deleted"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Campaign not found"
          },
          "409": {
            "description": "Campaign has changed or dispatch started"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/manual-email/schedules/{campaignID}/send-now": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Sends a scheduled manual event email immediately",
        "operationId": "sendScheduledEventEmailNow",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_eventEmailCampaignID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ScheduledEventEmailVersionRequest"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Campaign dispatched",
            "schema": {
              "$ref": "#/definitions/ScheduledEventEmail"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Campaign not found"
          },
          "409": {
            "description": "Campaign has changed or dispatch started"
          },
          "429": {
            "description": "Email allowance reached"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/programme": {
      "get": {
        "tags": [
          "programme"
        ],
        "summary": "Gets the programme for an event (convenience route)",
        "operationId": "getEventProgramme",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/EventProgramme"
            }
          },
          "404": {
            "description": "Programme Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/public-page": {
      "get": {
        "tags": [
          "event"
        ],
        "summary": "Gets the public page configuration for an event",
        "operationId": "getEventPublicPage",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Public page configuration",
            "schema": {
              "$ref": "#/definitions/EventPublicPage"
            }
          },
          "403": {
            "description": "Missing events.update permission"
          },
          "404": {
            "description": "Event or public page not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "event"
        ],
        "summary": "Creates or updates the public page configuration",
        "operationId": "updateEventPublicPage",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateEventPublicPageRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public page configuration",
            "schema": {
              "$ref": "#/definitions/EventPublicPage"
            }
          },
          "400": {
            "description": "Invalid public page configuration"
          },
          "403": {
            "description": "Missing permission or pilot feature flag"
          },
          "404": {
            "description": "Event not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/public-page/publish": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Publishes the event public page synchronously",
        "operationId": "publishEventPublicPage",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Public page configuration",
            "schema": {
              "$ref": "#/definitions/EventPublicPage"
            }
          },
          "400": {
            "description": "Public page cannot be published"
          },
          "403": {
            "description": "Missing permission or pilot feature flag"
          },
          "404": {
            "description": "Event or public page not found"
          },
          "502": {
            "description": "Public event publisher failed"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/public-page/unpublish": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Unpublishes the event public page synchronously",
        "operationId": "unpublishEventPublicPage",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "Public page configuration",
            "schema": {
              "$ref": "#/definitions/EventPublicPage"
            }
          },
          "403": {
            "description": "Missing events.update permission"
          },
          "404": {
            "description": "Event or public page not found"
          },
          "502": {
            "description": "Public event publisher failed"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/response": {
      "post": {
        "tags": [
          "event"
        ],
        "summary": "Responds to an event",
        "operationId": "respondToOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "description": "Response",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EventResponseRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationEventAttendance2"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Deletes a response to an event",
        "operationId": "deleteResponseToOrganisationEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "description": "Response",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/DeleteEventResponseRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationEventAttendance2"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/ticket-url": {
      "put": {
        "tags": [
          "event"
        ],
        "summary": "Sets or clears an event's ticket URL",
        "operationId": "updateEventTicketURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateEventTicketURLRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated event data",
            "schema": {
              "$ref": "#/definitions/OrganisationEventData"
            }
          },
          "400": {
            "description": "Invalid ticket URL"
          },
          "403": {
            "description": "Missing events.update permission"
          },
          "404": {
            "description": "Event Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/tickets": {
      "get": {
        "tags": [
          "ticket"
        ],
        "summary": "Gets ticket types for an event",
        "operationId": "getTicketTypes",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/TicketType"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "ticket"
        ],
        "summary": "Creates a ticket type",
        "operationId": "createTicketType",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewTicketTypeRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/events/{eventID}/tickets/order": {
      "post": {
        "description": "Legacy ordering is permanently unavailable. New booking APIs are separate from this retired endpoint.",
        "tags": [
          "ticket"
        ],
        "summary": "Retired legacy ticket ordering endpoint",
        "operationId": "createTicketOrder",
        "deprecated": true,
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewTicketOrderRequest"
            }
          }
        ],
        "responses": {
          "410": {
            "description": "Legacy ticket ordering has been retired. No order is created."
          }
        }
      }
    },
    "/organisation/{organisationID}/events/{eventID}/voice-part/{userID}": {
      "put": {
        "tags": [
          "event"
        ],
        "summary": "Sets a voice-part override for one member on one event",
        "operationId": "setEventVoicePartOverride",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EventVoicePartOverrideRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationEventAttendance2"
            }
          },
          "400": {
            "description": "Invalid voice part"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Event or member not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "event"
        ],
        "summary": "Removes a voice-part override for one member on one event",
        "operationId": "deleteEventVoicePartOverride",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          },
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationEventAttendance2"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Event or member not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/exports/{exportID}": {
      "get": {
        "tags": [
          "archive"
        ],
        "summary": "Gets the current status of an archive export",
        "operationId": "getOrganisationArchiveExport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_exportID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/ArchiveExport"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Export not found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "archive"
        ],
        "summary": "Cancels an archive export",
        "operationId": "cancelOrganisationArchiveExport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_exportID"
          }
        ],
        "responses": {
          "200": {
            "description": "Export cancellation requested",
            "schema": {
              "$ref": "#/definitions/ArchiveExport"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Export not found"
          },
          "409": {
            "description": "Export can no longer be cancelled"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/exports/{exportID}/parts/{partID}/download": {
      "get": {
        "tags": [
          "archive"
        ],
        "summary": "Gets a pre-signed download URL for a completed archive part",
        "operationId": "getOrganisationArchiveExportPartDownloadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_exportID"
          },
          {
            "$ref": "#/parameters/path_exportPartID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Export part not found"
          },
          "409": {
            "description": "Export part is not ready"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/invite": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Invites a user to an organisation",
        "operationId": "inviteToOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "User to invite",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/InviteUserRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/InviteUsersResponses"
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "429": {
            "description": "Monthly fair-use allowance or daily delivery safeguard exceeded, or seven-day resend cooldown active"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/invite/{inviteID}": {
      "delete": {
        "tags": [
          "organisation"
        ],
        "summary": "Deletes an invite to an organisation",
        "operationId": "deleteOrganisationInvite",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_inviteID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/invite/{inviteID}/accept": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Accepts an invite to an organisation",
        "operationId": "acceptOrganisationInvite",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_inviteID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/invite/{inviteID}/decline": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Declines an invite to an organisation",
        "operationId": "declineOrganisationInvite",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_inviteID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/join-code": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets the reusable join code for an organisation",
        "operationId": "getOrganisationJoinCode",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationJoinCode"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Replaces the reusable join code and immediately invalidates the previous code",
        "operationId": "resetOrganisationJoinCode",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "Reset",
            "schema": {
              "$ref": "#/definitions/OrganisationJoinCode"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/member-imports": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Parses member data into a temporary reviewable import",
        "operationId": "createOrganisationMemberImport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateMemberImportRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Import parsed",
            "schema": {
              "$ref": "#/definitions/MemberImport"
            }
          },
          "400": {
            "description": "Source could not be parsed"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/member-imports/{importID}": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets a temporary member import",
        "operationId": "getOrganisationMemberImport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_memberImportID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/MemberImport"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Import not found or expired"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/member-imports/{importID}/apply": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Creates pending members from reviewed import rows without sending invitations",
        "operationId": "applyOrganisationMemberImport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_memberImportID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ApplyMemberImportRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Import applied",
            "schema": {
              "$ref": "#/definitions/MemberImport"
            }
          },
          "400": {
            "description": "Reviewed rows are invalid"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Import not found or expired"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/memberinvites": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets member invites for an organisation",
        "operationId": "getOrganisationMemberInvites",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationInvitation"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/members/{userID}": {
      "delete": {
        "tags": [
          "organisation"
        ],
        "summary": "Removes a user from an organisation (self-removal or Admin removal)",
        "operationId": "removeOrganisationMember",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content - User successfully removed"
          },
          "403": {
            "description": "Forbidden - User not authorized to remove this member"
          },
          "404": {
            "description": "Not Found - User is not a member of this organisation"
          },
          "409": {
            "description": "Conflict - Another Admin must be assigned first",
            "schema": {
              "$ref": "#/definitions/RemoveOrganisationMemberWarning"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/members/{userID}/classification": {
      "put": {
        "tags": [
          "organisation"
        ],
        "summary": "Updates a member's voice part, musical function, or unassigned classification",
        "operationId": "updateOrganisationMemberClassification",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateMemberClassificationRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationMember"
            }
          },
          "400": {
            "description": "Invalid classification or voice part outside the organisation voicing"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Member not found"
          },
          "409": {
            "description": "Membership changed since it was loaded"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/members/{userID}/permissions/effective": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets a member's effective organisation permissions",
        "operationId": "getMemberEffectiveOrganisationPermissions",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationAccess"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/members/{userID}/roles": {
      "put": {
        "description": "Protected Admin access is managed through dedicated endpoints and cannot be changed here.",
        "tags": [
          "organisation"
        ],
        "summary": "Replaces a member's ordinary organisation roles",
        "operationId": "updateOrganisationMemberRoles",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateMemberRolesRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationAccess"
            }
          },
          "400": {
            "description": "Invalid or protected role assignment"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Member not found"
          },
          "409": {
            "description": "Membership changed since it was loaded"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces": {
      "get": {
        "tags": [
          "music"
        ],
        "summary": "Gets music pieces",
        "operationId": "getOrganisationMusicPieces",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/MusicPiece"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "music"
        ],
        "summary": "Creates a music piece",
        "operationId": "createOrganisationMusicPiece",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Music piece to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewMusicPieceRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces/attachments/export": {
      "post": {
        "tags": [
          "archive"
        ],
        "summary": "Creates an asynchronous ZIP export of all uploaded music attachments",
        "operationId": "createOrganisationMusicAttachmentsExport",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "202": {
            "description": "Export queued",
            "schema": {
              "$ref": "#/definitions/ArchiveExport"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "503": {
            "description": "Export service unavailable"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces/{musicPieceID}": {
      "post": {
        "tags": [
          "music"
        ],
        "summary": "Edits a music piece",
        "operationId": "editOrganisationMusicPiece",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "description": "Music piece to edit",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EditMusicPieceRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "music"
        ],
        "summary": "Deletes a music piece",
        "operationId": "deleteOrganisationMusicPiece",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces/{musicPieceID}/attachments": {
      "get": {
        "tags": [
          "music"
        ],
        "summary": "Gets attachments for a music piece",
        "operationId": "getMusicPieceAttachments",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/MusicPieceAttachment"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "music"
        ],
        "summary": "Creates an attachment for a music piece",
        "operationId": "createMusicPieceAttachment",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "description": "Attachment to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewMusicPieceAttachmentRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces/{musicPieceID}/attachments/{attachmentID}": {
      "post": {
        "tags": [
          "music"
        ],
        "summary": "Edits a music piece attachment",
        "operationId": "editMusicPieceAttachment",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "$ref": "#/parameters/path_attachmentID"
          },
          {
            "description": "Attachment data to update",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/EditMusicPieceAttachmentRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "music"
        ],
        "summary": "Deletes a music piece attachment",
        "operationId": "deleteMusicPieceAttachment",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "$ref": "#/parameters/path_attachmentID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces/{musicPieceID}/attachments/{attachmentID}/presigned/download": {
      "get": {
        "tags": [
          "music"
        ],
        "summary": "Gets a pre-signed URL for downloading a music piece attachment",
        "operationId": "getMusicPieceAttachmentDownloadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "$ref": "#/parameters/path_attachmentID"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/music_pieces/{musicPieceID}/attachments/{attachmentID}/presigned/upload": {
      "get": {
        "tags": [
          "music"
        ],
        "summary": "Gets a pre-signed URL for uploading a music piece attachment",
        "operationId": "getMusicPieceAttachmentUploadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "$ref": "#/parameters/path_attachmentID"
          },
          {
            "type": "string",
            "description": "MD5 hash of the file content",
            "name": "contentMD5",
            "in": "query",
            "required": true
          },
          {
            "type": "string",
            "name": "contentType",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "format": "int64",
            "name": "sizeBytes",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/MusicPieceAttachmentUploadURL"
            }
          },
          "404": {
            "description": "Not Found"
          },
          "409": {
            "description": "Storage limit exceeded",
            "schema": {
              "$ref": "#/definitions/StorageLimitExceeded"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/owners/{userID}": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Grants protected Admin access to an active member",
        "operationId": "grantOrganisationOwnership",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateOwnershipRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationAccess"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Member not found"
          },
          "409": {
            "description": "Membership changed since it was loaded"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "organisation"
        ],
        "summary": "Revokes protected Admin access while preserving at least one Admin",
        "operationId": "revokeOrganisationOwnership",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateOwnershipRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationAccess"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Member not found"
          },
          "409": {
            "description": "Final Admin or stale membership version"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/permissions/effective": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets the authenticated member's effective organisation permissions",
        "operationId": "getEffectiveOrganisationPermissions",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationAccess"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/presigned/download": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets a pre-signed URL for downloading a document",
        "operationId": "getDocumentDownloadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "ID of the document",
            "name": "documentID",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/presigned/upload": {
      "get": {
        "tags": [
          "document"
        ],
        "summary": "Gets a pre-signed URL for uploading a document",
        "operationId": "getDocumentUploadURL",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "Description of the document",
            "name": "description",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Directory to upload into",
            "name": "directoryID",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Original file name of the document",
            "name": "filename",
            "in": "query",
            "required": true
          },
          {
            "type": "string",
            "description": "MD5 hash of the file content",
            "name": "contentMD5",
            "in": "query",
            "required": true
          },
          {
            "type": "string",
            "name": "contentType",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "format": "int64",
            "name": "sizeBytes",
            "in": "query",
            "required": true
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Usergroups the document is restricted to. Empty means visible to all members.",
            "name": "visibleToUsergroupIDs",
            "in": "query"
          },
          {
            "type": "boolean",
            "description": "If true, only organisation Admins can see the document.",
            "name": "visibleToAdminsOnly",
            "in": "query"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/DocumentUploadURL"
            }
          },
          "404": {
            "description": "Organisation Not Found"
          },
          "409": {
            "description": "Storage limit exceeded",
            "schema": {
              "$ref": "#/definitions/StorageLimitExceeded"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes": {
      "get": {
        "tags": [
          "programme"
        ],
        "summary": "Lists all programmes for an organisation",
        "operationId": "listProgrammes",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Programme"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "programme"
        ],
        "summary": "Creates a new standalone programme",
        "operationId": "createProgramme",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "Programme details",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateProgrammeRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK - Returns the programme ID",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}": {
      "get": {
        "tags": [
          "programme"
        ],
        "summary": "Gets a specific programme with all sections and pieces",
        "operationId": "getProgramme",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "ID of the programme",
            "name": "programmeID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/EventProgramme"
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "programme"
        ],
        "summary": "Updates a programme",
        "operationId": "updateProgramme",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "ID of the programme",
            "name": "programmeID",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated programme details",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateProgrammeRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "programme"
        ],
        "summary": "Deletes a programme",
        "operationId": "deleteProgramme",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "ID of the programme to delete",
            "name": "programmeID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/custom-parts": {
      "post": {
        "tags": [
          "programme"
        ],
        "summary": "Adds a custom part to the programme",
        "operationId": "addCustomPart",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "description": "Custom part to add",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AddCustomProgrammePartRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/CustomProgrammePart"
            }
          },
          "400": {
            "description": "Invalid programme section"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/custom-parts/{customPartID}": {
      "put": {
        "tags": [
          "programme"
        ],
        "summary": "Updates a custom programme part",
        "operationId": "updateCustomPart",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "type": "string",
            "description": "ID of the custom part",
            "name": "customPartID",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated custom part",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateCustomProgrammePartRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/CustomProgrammePart"
            }
          },
          "400": {
            "description": "Invalid programme section"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "programme"
        ],
        "summary": "Deletes a custom programme part",
        "operationId": "deleteCustomPart",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "type": "string",
            "description": "ID of the custom part",
            "name": "customPartID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/draft": {
      "put": {
        "tags": [
          "programme"
        ],
        "summary": "Marks a programme as draft or not draft",
        "operationId": "markProgrammeDraft",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "description": "Draft status",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MarkProgrammeDraftRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/events": {
      "get": {
        "tags": [
          "programme"
        ],
        "summary": "Gets all events linked to a programme",
        "operationId": "getProgrammeEvents",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "type": "string",
            "description": "ID of the programme",
            "name": "programmeID",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationEventData"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/events/{eventID}": {
      "post": {
        "tags": [
          "programme"
        ],
        "summary": "Links a programme to an event",
        "operationId": "linkEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request (event already has a programme)"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "programme"
        ],
        "summary": "Unlinks a programme from an event",
        "operationId": "unlinkEvent",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "$ref": "#/parameters/path_eventID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/export": {
      "get": {
        "produces": [
          "application/pdf"
        ],
        "tags": [
          "programme"
        ],
        "summary": "Exports the programme as a PDF",
        "operationId": "exportProgramme",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "type": "string",
            "description": "Optional event ID to include event details in the PDF header",
            "name": "eventID",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "PDF file",
            "schema": {
              "type": "string",
              "format": "binary"
            },
            "headers": {
              "Content-Type": {
                "type": "string",
                "default": "application/pdf",
                "description": "MIME type of the PDF"
              }
            },
            "x-responseType": "arraybuffer"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Programme Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/pieces": {
      "put": {
        "tags": [
          "programme"
        ],
        "summary": "Reorders pieces in the programme",
        "operationId": "reorderPieces",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "description": "New order",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ReorderProgrammePiecesRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "programme"
        ],
        "summary": "Adds a music piece to the programme",
        "operationId": "addPiece",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "description": "Piece to add",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AddProgrammePieceRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/pieces/{musicPieceID}/{position}": {
      "put": {
        "tags": [
          "programme"
        ],
        "summary": "Updates metadata for a piece in the programme",
        "operationId": "updatePiece",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "type": "integer",
            "description": "Position of the piece to update",
            "name": "position",
            "in": "path",
            "required": true
          },
          {
            "description": "Updated piece metadata",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateProgrammePieceRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "programme"
        ],
        "summary": "Removes a piece from the programme",
        "operationId": "removePiece",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "$ref": "#/parameters/path_musicPieceID"
          },
          {
            "type": "integer",
            "description": "Position of the piece to remove",
            "name": "position",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/sections": {
      "post": {
        "tags": [
          "programme"
        ],
        "summary": "Creates a section in the programme",
        "operationId": "createSection",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "description": "Section to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateProgrammeSectionRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/programmes/{programmeID}/sections/{programmeSectionID}": {
      "put": {
        "tags": [
          "programme"
        ],
        "summary": "Updates a programme section",
        "operationId": "updateSection",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "$ref": "#/parameters/path_programmeSectionID"
          },
          {
            "description": "Section updates",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateProgrammeSectionRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/ProgrammeSection"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "programme"
        ],
        "summary": "Deletes a programme section",
        "operationId": "deleteSection",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_programmeID"
          },
          {
            "$ref": "#/parameters/path_programmeSectionID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/requeststojoin": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets requests to join an organisation",
        "operationId": "getOrganisationRequestsToJoin",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationRequestToJoin"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/respond_to_request_to_join/{requestID}": {
      "post": {
        "tags": [
          "organisation"
        ],
        "summary": "Responds to a request to join an organisation",
        "operationId": "respondToRequestToJoinOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_requestID"
          },
          {
            "description": "Response",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/RequestToJoinResponse"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/roles": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Lists role definitions available to an organisation",
        "operationId": "listOrganisationRoles",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationRoleDefinition"
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/setup-status": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets progress through the initial organisation setup",
        "operationId": "getOrganisationSetupStatus",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationSetupStatus"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/ticketing/grant": {
      "post": {
        "tags": [
          "ticket"
        ],
        "operationId": "issueChoirTicketingGrant",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/TicketingGrantRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact-byte choir command grant",
            "schema": {
              "$ref": "#/definitions/TicketingGrantResponse"
            }
          },
          "400": {
            "description": "Invalid command"
          },
          "403": {
            "description": "Configure permission or scope denied"
          },
          "409": {
            "description": "Source revision conflict"
          },
          "503": {
            "description": "Setup unavailable"
          }
        },
        "security": [
          {
            "clerk": [
              "usr"
            ]
          }
        ]
      }
    },
    "/organisation/{organisationID}/ticketing/setup": {
      "get": {
        "tags": [
          "ticket"
        ],
        "operationId": "getChoirTicketingSetup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "Read-only choir setup including saved profile or branding defaults",
            "schema": {
              "$ref": "#/definitions/ChoirSetupResult"
            }
          },
          "403": {
            "description": "Configure permission or rollout denied"
          },
          "503": {
            "description": "Setup unavailable"
          }
        },
        "security": [
          {
            "clerk": [
              "usr"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ticket"
        ],
        "operationId": "saveChoirTicketingSetup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChoirSetupSave"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed durable profile save",
            "schema": {
              "$ref": "#/definitions/ChoirSetupResult"
            }
          },
          "400": {
            "description": "Invalid profile"
          },
          "403": {
            "description": "Configure permission or capability denied"
          },
          "409": {
            "description": "Revision or request conflict"
          },
          "422": {
            "description": "Unsupported choir logo",
            "schema": {
              "$ref": "#/definitions/TicketingSetupError"
            }
          },
          "503": {
            "description": "Retry the identical saved intent",
            "schema": {
              "$ref": "#/definitions/TicketingSetupError"
            }
          }
        },
        "security": [
          {
            "clerk": [
              "usr"
            ]
          }
        ]
      }
    },
    "/organisation/{organisationID}/usage": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Gets organisation storage and email usage",
        "operationId": "getOrganisationUsage",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationUsage"
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisation/{organisationID}/usergroups/": {
      "get": {
        "tags": [
          "usergroup"
        ],
        "summary": "Gets user groups",
        "operationId": "getOrganisationUsergroups",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Usergroup"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "usergroup"
        ],
        "summary": "Creates a new user group",
        "operationId": "createOrganisationUsergroup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "description": "User group to create",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewUsergroupRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisations/{organisationID}/usergroups/{usergroupID}": {
      "delete": {
        "tags": [
          "usergroup"
        ],
        "summary": "Deletes a user group",
        "operationId": "deleteOrganisationUsergroup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_usergroupID"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisations/{organisationID}/usergroups/{usergroupID}/addmember/{userID}": {
      "post": {
        "tags": [
          "usergroup"
        ],
        "summary": "Adds a member to a usergroup",
        "operationId": "addMemberToOrganisationUsergroup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_usergroupID"
          },
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/organisations/{organisationID}/usergroups/{usergroupID}/removemember/{userID}": {
      "post": {
        "tags": [
          "usergroup"
        ],
        "summary": "Removes a member from a user group",
        "operationId": "removeMemberFromOrganisationUsergroup",
        "parameters": [
          {
            "$ref": "#/parameters/path_orgID"
          },
          {
            "$ref": "#/parameters/path_usergroupID"
          },
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/orgsanisations/search/{query}": {
      "get": {
        "tags": [
          "organisation"
        ],
        "summary": "Searches for organisations",
        "operationId": "searchOrganisations",
        "parameters": [
          {
            "type": "string",
            "description": "Search query",
            "name": "query",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationSummary"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/ping": {
      "get": {
        "tags": [
          "application"
        ],
        "summary": "Pings the service",
        "operationId": "getPing",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/PingResponse"
            }
          }
        }
      }
    },
    "/test/getUserToken": {
      "get": {
        "tags": [
          "test"
        ],
        "summary": "Gets a user token",
        "operationId": "getUserToken",
        "parameters": [
          {
            "type": "string",
            "description": "ID of the user",
            "name": "userID",
            "in": "query",
            "required": true
          },
          {
            "type": "boolean",
            "default": false,
            "description": "Includes the platform administrator claim in test environments",
            "name": "platformAdmin",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "/user": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets user. Uses clerk token to get user details",
        "operationId": "getUser",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/UserResponse"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/email-preferences": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets the authenticated user's email preferences",
        "operationId": "getUserEmailPreferences",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/UserEmailPreferences"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Updates the authenticated user's email preferences",
        "operationId": "updateUserEmailPreferences",
        "parameters": [
          {
            "description": "Email preferences to update",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateEmailPreferencesRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/UserEmailPreferences"
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/email/{email}": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets all users with Email",
        "operationId": "getUsersByEmail",
        "parameters": [
          {
            "type": "string",
            "description": "Email of the user",
            "name": "email",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/User"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/preferences-guide/{version}": {
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Marks a preferences guide version as complete for the authenticated user",
        "operationId": "completePreferencesGuide",
        "parameters": [
          {
            "minimum": 1,
            "type": "integer",
            "format": "int64",
            "description": "Preferences guide version being completed or dismissed",
            "name": "version",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Preferences guide completed"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/push-installations/{installationID}": {
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Registers or renews an installation for the authenticated user",
        "operationId": "registerPushInstallation",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PushInstallationRequest"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Registered"
          },
          "400": {
            "description": "Invalid installation"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "delete": {
        "tags": [
          "user"
        ],
        "summary": "Unregisters only the authenticated user's installation",
        "operationId": "unregisterPushInstallation",
        "parameters": [
          {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": "integer",
            "format": "int64",
            "description": "Persisted installation operation counter, higher than every earlier registration or removal.",
            "name": "sequence",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Unregistered"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "parameters": [
        {
          "maxLength": 128,
          "minLength": 16,
          "pattern": "^[A-Za-z0-9_-]+$",
          "type": "string",
          "name": "installationID",
          "in": "path",
          "required": true
        }
      ]
    },
    "/user/push-preferences": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets independent native notification preferences",
        "operationId": "getPushPreferences",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/PushPreferences"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Updates supplied native preferences without changing email preferences",
        "operationId": "updatePushPreferences",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PushPreferences"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/PushPreferences"
            }
          },
          "400": {
            "description": "Unknown preference"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/{userID}/contactDetails": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets contact details for a user",
        "operationId": "getUserContactDetails",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/UserContactDetails"
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      },
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Updates contact details for a user",
        "operationId": "updateUserContactDetails",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "type": "string",
            "description": "Phone number of the user",
            "name": "phoneNumber",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Address of the user",
            "name": "homeAddress",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/{userID}/invitationsToJoinOrganisation": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets invitations to join an organisation",
        "operationId": "getInvitationsToJoinOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/UserOrganisationInvitation"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/{userID}/organisationEvents/": {
      "get": {
        "description": "Returns visible events that have not yet ended. Past and cancelled events are available from the paginated past-events endpoint.",
        "tags": [
          "user"
        ],
        "summary": "Gets upcoming events for a user",
        "operationId": "getOrganisationEventsForUser",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganisationEvent2"
              }
            }
          },
          "403": {
            "description": "Forbidden - user ID does not match authenticated user"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/{userID}/organisationEvents/past": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets a page of past events for a user",
        "operationId": "getPastOrganisationEventsForUser",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          },
          {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "format": "int32",
            "default": 25,
            "description": "Maximum event candidates to inspect and return",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Opaque cursor returned by the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/OrganisationEventPage"
            }
          },
          "400": {
            "description": "Invalid or mismatched cursor"
          },
          "403": {
            "description": "Forbidden - user ID does not match authenticated user"
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/user/{userID}/requestsToJoinOrganisation": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Gets requests to join an organisation",
        "operationId": "getRequestsToJoinOrganisation",
        "parameters": [
          {
            "$ref": "#/parameters/path_userID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/UserRequestsToJoinOrganisation"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/voicings": {
      "get": {
        "tags": [
          "voicing"
        ],
        "summary": "Gets voicings",
        "operationId": "getVoicings",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Voicing"
              }
            }
          }
        },
        "security": [
          {
            "clerk": []
          }
        ]
      }
    },
    "/webhooks/clerk": {
      "post": {
        "tags": [
          "webhook"
        ],
        "summary": "Webhook for Clerk",
        "operationId": "clerkWebhook",
        "parameters": [
          {
            "description": "Clerk webhook",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/webhooks/stripe": {
      "post": {
        "description": "This endpoint receives Stripe webhook events. Authentication is done via a Stripe signature in the 'Stripe-Signature' header, not a JWT.\n",
        "tags": [
          "webhook"
        ],
        "summary": "Stripe Webhook Endpoint",
        "operationId": "stripeWebhook",
        "parameters": [
          {
            "type": "string",
            "description": "Stripe webhook signature header used for validation.",
            "name": "Stripe-Signature",
            "in": "header",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Signature verification failed"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    }
  },
  "definitions": {
    "AddCustomProgrammePartRequest": {
      "type": "object",
      "required": [
        "name",
        "position"
      ],
      "properties": {
        "description": {
          "description": "Optional description or details",
          "type": "string",
          "x-nullable": true
        },
        "durationMinutes": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "intervalAfter": {
          "type": "boolean",
          "default": false
        },
        "name": {
          "description": "Name of the custom part (e.g., \"Reading\", \"Organ Voluntary\")",
          "type": "string"
        },
        "performanceNotes": {
          "type": "string",
          "x-nullable": true
        },
        "performer": {
          "description": "Who is performing or presenting this part",
          "type": "string",
          "x-nullable": true
        },
        "position": {
          "type": "integer",
          "format": "int64"
        },
        "sectionID": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AddProgrammePieceRequest": {
      "type": "object",
      "required": [
        "musicPieceID",
        "position"
      ],
      "properties": {
        "attachmentIDs": {
          "description": "Specific attachment IDs to include for this programme piece (if omitted or empty, shows piece data only)",
          "type": "array",
          "items": {
            "type": "string"
          },
          "x-nullable": true
        },
        "durationMinutes": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "intervalAfter": {
          "type": "boolean",
          "default": false
        },
        "musicPieceID": {
          "type": "string"
        },
        "performanceNotes": {
          "type": "string",
          "x-nullable": true
        },
        "position": {
          "type": "integer",
          "format": "int64"
        },
        "sectionID": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminAlarmStatus": {
      "type": "object",
      "required": [
        "name",
        "state",
        "updatedAt"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AdminAuditActor": {
      "type": "object",
      "required": [
        "type",
        "isAdmin"
      ],
      "properties": {
        "authMethod": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "isAdmin": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "userID": {
          "type": "string"
        }
      }
    },
    "AdminAuditEvent": {
      "type": "object",
      "required": [
        "id",
        "eventType",
        "occurredAt",
        "recordedAt",
        "expiresAt",
        "action",
        "summary",
        "outcome",
        "actor",
        "requestID",
        "httpMethod",
        "httpRoute",
        "statusCode",
        "durationMS",
        "partialCompletion",
        "truncated"
      ],
      "properties": {
        "action": {
          "type": "string"
        },
        "actor": {
          "$ref": "#/definitions/AdminAuditActor"
        },
        "after": {
          "type": "object",
          "additionalProperties": true
        },
        "before": {
          "type": "object",
          "additionalProperties": true
        },
        "changedFields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "commitHash": {
          "type": "string"
        },
        "correlationID": {
          "type": "string"
        },
        "durationMS": {
          "type": "integer",
          "format": "int64"
        },
        "eventType": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "httpMethod": {
          "type": "string"
        },
        "httpRoute": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true
        },
        "occurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "operationID": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "partialCompletion": {
          "type": "boolean"
        },
        "reasonCode": {
          "type": "string"
        },
        "recordedAt": {
          "type": "string",
          "format": "date-time"
        },
        "relatedTargets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminAuditTarget"
          }
        },
        "requestID": {
          "type": "string"
        },
        "sourceIP": {
          "type": "string"
        },
        "statusCode": {
          "type": "integer"
        },
        "summary": {
          "type": "string"
        },
        "target": {
          "$ref": "#/definitions/AdminAuditTarget"
        },
        "truncated": {
          "type": "boolean"
        },
        "userAgent": {
          "type": "string"
        }
      }
    },
    "AdminAuditEventPage": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminAuditEvent"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminAuditTarget": {
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "displayName": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "AdminBillingAccount": {
      "type": "object",
      "required": [
        "organisationID",
        "organisationName",
        "mode",
        "effectivePlan",
        "planSource",
        "stripeCustomerID",
        "cancelAtPeriodEnd",
        "createdAt"
      ],
      "properties": {
        "cancelAtPeriodEnd": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "currentPeriodEnd": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "effectivePlan": {
          "type": "string"
        },
        "lastSyncedAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ]
        },
        "organisationID": {
          "type": "string"
        },
        "organisationName": {
          "type": "string"
        },
        "planSource": {
          "type": "string"
        },
        "stripeCustomerID": {
          "type": "string"
        },
        "subscriptionID": {
          "type": "string"
        },
        "subscriptionStatus": {
          "type": "string"
        }
      }
    },
    "AdminBillingAccountPage": {
      "type": "object",
      "required": [
        "accounts"
      ],
      "properties": {
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminBillingAccount"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminCreateTestOrganisationRequest": {
      "type": "object",
      "required": [
        "name",
        "ownerUserID",
        "voicingID"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "ownerUserID": {
          "description": "Existing live full user who will own the test organisation",
          "type": "string"
        },
        "voicingID": {
          "type": "string"
        }
      }
    },
    "AdminDashboard": {
      "type": "object",
      "required": [
        "mode",
        "generatedAt",
        "apiCommitID",
        "userCount",
        "dailyActiveUserCount",
        "monthlyActiveUserCount",
        "organisationCount",
        "stripeCustomerCount",
        "lifecycleTrackedOrganisationCount",
        "activatedWithin14DaysCount",
        "retainedActiveOrganisationCount",
        "weekEightEligibleOrganisationCount",
        "weekEightActiveOrganisationCount"
      ],
      "properties": {
        "activatedWithin14DaysCount": {
          "description": "Tracked organisations completing the activation milestones within 14 days",
          "type": "integer",
          "format": "int64"
        },
        "apiCommitID": {
          "type": "string"
        },
        "dailyActiveUserCount": {
          "description": "Users active in the previous 24 hours",
          "type": "integer",
          "format": "int64"
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "lifecycleTrackedOrganisationCount": {
          "description": "Organisations with first-party lifecycle instrumentation",
          "type": "integer",
          "format": "int64"
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ]
        },
        "monthlyActiveUserCount": {
          "description": "Users active in the previous 30 days",
          "type": "integer",
          "format": "int64"
        },
        "organisationCount": {
          "type": "integer",
          "format": "int64"
        },
        "retainedActiveOrganisationCount": {
          "description": "Tracked organisations with both administrator and member activity in the previous 28 days",
          "type": "integer",
          "format": "int64"
        },
        "stripeCustomerCount": {
          "type": "integer",
          "format": "int64"
        },
        "userCount": {
          "type": "integer",
          "format": "int64"
        },
        "weekEightActiveOrganisationCount": {
          "description": "Eligible organisations with both administrator and member activity during days 49 to 55",
          "type": "integer",
          "format": "int64"
        },
        "weekEightEligibleOrganisationCount": {
          "description": "Tracked organisations old enough to have completed their eighth week",
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "AdminEmailIncident": {
      "type": "object",
      "required": [
        "id",
        "address",
        "eventType",
        "reason",
        "detail",
        "emailID",
        "occurredAt"
      ],
      "properties": {
        "address": {
          "type": "string",
          "format": "email"
        },
        "detail": {
          "type": "string"
        },
        "emailID": {
          "description": "Legacy provider message identifier retained for compatibility",
          "type": "string"
        },
        "eventType": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "occurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "organisationID": {
          "type": "string",
          "x-nullable": true
        },
        "provider": {
          "type": "string",
          "enum": [
            "ses"
          ],
          "x-nullable": true
        },
        "providerMessageID": {
          "type": "string",
          "x-nullable": true
        },
        "reason": {
          "type": "string",
          "enum": [
            "permanent_bounce",
            "transient_bounce",
            "complaint",
            "failed",
            "delivery_delayed"
          ]
        }
      }
    },
    "AdminEmailIncidentPage": {
      "type": "object",
      "required": [
        "incidents"
      ],
      "properties": {
        "incidents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminEmailIncident"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminFunctionStatus": {
      "type": "object",
      "required": [
        "name",
        "state",
        "lastUpdateStatus",
        "lastModified"
      ],
      "properties": {
        "lastModified": {
          "type": "string"
        },
        "lastUpdateStatus": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "state": {
          "type": "string"
        }
      }
    },
    "AdminInvoice": {
      "type": "object",
      "required": [
        "id",
        "status",
        "currency",
        "amountDue",
        "amountPaid",
        "amountRemaining",
        "createdAt"
      ],
      "properties": {
        "amountDue": {
          "type": "integer",
          "format": "int64"
        },
        "amountPaid": {
          "type": "integer",
          "format": "int64"
        },
        "amountRemaining": {
          "type": "integer",
          "format": "int64"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "currency": {
          "type": "string"
        },
        "dueAt": {
          "type": "string",
          "format": "date-time"
        },
        "hostedInvoiceURL": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "invoicePDFURL": {
          "type": "string"
        },
        "number": {
          "type": "string"
        },
        "paidAt": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "AdminInvoicePage": {
      "type": "object",
      "required": [
        "invoices"
      ],
      "properties": {
        "invoices": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminInvoice"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminOperationsStatus": {
      "type": "object",
      "required": [
        "overallStatus",
        "commitID",
        "checkedAt",
        "alarms",
        "queues",
        "functions"
      ],
      "properties": {
        "alarms": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminAlarmStatus"
          }
        },
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "commitID": {
          "type": "string"
        },
        "functions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminFunctionStatus"
          }
        },
        "overallStatus": {
          "type": "string",
          "enum": [
            "operational",
            "degraded",
            "unavailable"
          ]
        },
        "queues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminQueueStatus"
          }
        }
      }
    },
    "AdminOrganisationBilling": {
      "type": "object",
      "required": [
        "organisationID",
        "mode",
        "effectivePlan",
        "planSource",
        "hasStripeCustomer",
        "stripeCancelAtPeriodEnd"
      ],
      "properties": {
        "billingContactUserID": {
          "type": "string"
        },
        "effectivePlan": {
          "type": "string"
        },
        "hasStripeCustomer": {
          "type": "boolean"
        },
        "manualPlanExpiresAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ]
        },
        "organisationID": {
          "type": "string"
        },
        "planSource": {
          "type": "string"
        },
        "storedBillingUpdatedAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "stripeCancelAtPeriodEnd": {
          "type": "boolean"
        },
        "stripeCurrentPeriodEnd": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "stripeCustomerID": {
          "type": "string"
        },
        "stripeLastSyncedAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "stripePriceID": {
          "type": "string"
        },
        "stripeSubscriptionID": {
          "type": "string"
        },
        "stripeSubscriptionStatus": {
          "type": "string"
        }
      }
    },
    "AdminOrganisationContentSummary": {
      "type": "object",
      "required": [
        "documentCount",
        "documentBytes",
        "directoryCount",
        "cloudDocumentCount",
        "musicPieceCount",
        "musicAttachmentCount",
        "musicAttachmentBytes",
        "programmeCount",
        "eventAttachmentCount",
        "eventAttachmentBytes"
      ],
      "properties": {
        "cloudDocumentCount": {
          "type": "integer",
          "format": "int64"
        },
        "directoryCount": {
          "type": "integer",
          "format": "int64"
        },
        "documentBytes": {
          "type": "integer",
          "format": "int64"
        },
        "documentCount": {
          "type": "integer",
          "format": "int64"
        },
        "eventAttachmentBytes": {
          "type": "integer",
          "format": "int64"
        },
        "eventAttachmentCount": {
          "type": "integer",
          "format": "int64"
        },
        "musicAttachmentBytes": {
          "type": "integer",
          "format": "int64"
        },
        "musicAttachmentCount": {
          "type": "integer",
          "format": "int64"
        },
        "musicPieceCount": {
          "type": "integer",
          "format": "int64"
        },
        "programmeCount": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "AdminOrganisationDetail": {
      "type": "object",
      "required": [
        "id",
        "name",
        "isPublic",
        "mode",
        "plan",
        "planSource",
        "createdBy",
        "createdAt",
        "memberCount",
        "owners",
        "members",
        "invitations",
        "storage",
        "emailUsage",
        "contentSummary"
      ],
      "properties": {
        "brandColour": {
          "type": "string"
        },
        "contentSummary": {
          "$ref": "#/definitions/AdminOrganisationContentSummary"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "createdBy": {
          "type": "string"
        },
        "emailUsage": {
          "$ref": "#/definitions/AdminOrganisationEmailUsage"
        },
        "id": {
          "type": "string"
        },
        "invitations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationInvitation"
          }
        },
        "isPublic": {
          "type": "boolean"
        },
        "manualPlanExpiresAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "memberCount": {
          "type": "integer",
          "format": "int64"
        },
        "members": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminOrganisationMember"
          }
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ]
        },
        "name": {
          "type": "string"
        },
        "owners": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminOrganisationOwner"
          }
        },
        "plan": {
          "type": "string",
          "enum": [
            "none",
            "pro"
          ]
        },
        "planSource": {
          "type": "string",
          "enum": [
            "none",
            "stripe",
            "manual"
          ]
        },
        "storage": {
          "$ref": "#/definitions/OrganisationStorage"
        },
        "timezone": {
          "type": "string"
        }
      }
    },
    "AdminOrganisationEmailUsage": {
      "type": "object",
      "required": [
        "memberEmailsUsed",
        "memberEmailsLimit",
        "invitationsUsed",
        "invitationsLimit",
        "invitationsToday",
        "invitationsPerDay",
        "invitationDayResetsAt",
        "manualCampaignsToday",
        "manualCampaignsPerDay",
        "periodStart",
        "resetsAt"
      ],
      "properties": {
        "invitationDayResetsAt": {
          "type": "string",
          "format": "date-time"
        },
        "invitationsLimit": {
          "type": "integer",
          "format": "int64"
        },
        "invitationsPerDay": {
          "type": "integer",
          "format": "int64"
        },
        "invitationsToday": {
          "type": "integer",
          "format": "int64"
        },
        "invitationsUsed": {
          "type": "integer",
          "format": "int64"
        },
        "manualCampaignsPerDay": {
          "type": "integer",
          "format": "int64"
        },
        "manualCampaignsToday": {
          "type": "integer",
          "format": "int64"
        },
        "memberEmailsLimit": {
          "type": "integer",
          "format": "int64"
        },
        "memberEmailsUsed": {
          "type": "integer",
          "format": "int64"
        },
        "periodStart": {
          "type": "string",
          "format": "date-time"
        },
        "resetsAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AdminOrganisationEventSummary": {
      "type": "object",
      "required": [
        "id",
        "title",
        "timezone",
        "createdBy",
        "createdAt",
        "updatedAt",
        "cancelled",
        "recurring",
        "restricted"
      ],
      "properties": {
        "cancelled": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "createdBy": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "programmeID": {
          "type": "string"
        },
        "recurring": {
          "type": "boolean"
        },
        "restricted": {
          "type": "boolean"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "startTime": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AdminOrganisationMember": {
      "type": "object",
      "required": [
        "id",
        "givenName",
        "familyName",
        "email",
        "role",
        "roleIDs",
        "roleNames",
        "isOwner",
        "classification",
        "membershipType",
        "userType",
        "hasClerkAccount",
        "emailSuppressed",
        "onlyOwner"
      ],
      "properties": {
        "classification": {
          "$ref": "#/definitions/MemberClassification"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "emailSuppressed": {
          "type": "boolean"
        },
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "hasClerkAccount": {
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "isOwner": {
          "type": "boolean"
        },
        "membershipType": {
          "type": "string"
        },
        "onlyOwner": {
          "type": "boolean"
        },
        "role": {
          "description": "Legacy coarse role retained for compatibility",
          "type": "string"
        },
        "roleIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "roleNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "userType": {
          "type": "string"
        }
      }
    },
    "AdminOrganisationOwner": {
      "type": "object",
      "required": [
        "id",
        "givenName",
        "familyName",
        "email"
      ],
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    },
    "AdminOrganisationPage": {
      "type": "object",
      "required": [
        "organisations"
      ],
      "properties": {
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        },
        "organisations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminOrganisationSummary"
          }
        }
      }
    },
    "AdminOrganisationSummary": {
      "type": "object",
      "required": [
        "id",
        "name",
        "isPublic",
        "mode",
        "plan",
        "planSource",
        "createdBy",
        "createdAt"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "createdBy": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "isPublic": {
          "type": "boolean"
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ]
        },
        "name": {
          "type": "string"
        },
        "plan": {
          "type": "string",
          "enum": [
            "none",
            "pro"
          ]
        },
        "planSource": {
          "type": "string",
          "enum": [
            "none",
            "stripe",
            "manual"
          ]
        }
      }
    },
    "AdminProviderHealth": {
      "type": "object",
      "required": [
        "checkedAt",
        "providers"
      ],
      "properties": {
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "providers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminProviderStatus"
          }
        }
      }
    },
    "AdminProviderStatus": {
      "type": "object",
      "required": [
        "provider",
        "scope",
        "status",
        "checkType",
        "detail"
      ],
      "properties": {
        "checkType": {
          "type": "string",
          "enum": [
            "connectivity",
            "configuration",
            "status"
          ]
        },
        "detail": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "operational",
            "degraded",
            "unavailable",
            "configured",
            "missing"
          ]
        },
        "statusUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "AdminQueueMessage": {
      "type": "object",
      "required": [
        "id",
        "body",
        "approximateReceiveCount"
      ],
      "properties": {
        "approximateReceiveCount": {
          "type": "integer",
          "format": "int64"
        },
        "body": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "sentAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        }
      }
    },
    "AdminQueueMessages": {
      "type": "object",
      "required": [
        "messages"
      ],
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminQueueMessage"
          }
        }
      }
    },
    "AdminQueueStatus": {
      "type": "object",
      "required": [
        "name",
        "messagesVisible",
        "messagesInFlight",
        "messagesDelayed"
      ],
      "properties": {
        "messagesDelayed": {
          "type": "integer",
          "format": "int64"
        },
        "messagesInFlight": {
          "type": "integer",
          "format": "int64"
        },
        "messagesVisible": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "AdminSESEmailDelivery": {
      "type": "object",
      "required": [
        "id",
        "recipient",
        "subject",
        "fromAddress",
        "template",
        "status",
        "attemptCount",
        "providerMessageIDs",
        "duplicateSubmission",
        "createdAt",
        "updatedAt",
        "statusOccurredAt",
        "events"
      ],
      "properties": {
        "acceptedAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "attemptCount": {
          "type": "integer",
          "format": "int64"
        },
        "category": {
          "type": "string",
          "x-nullable": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "deliveredAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "duplicateSubmission": {
          "type": "boolean"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminSESEmailDeliveryEvent"
          }
        },
        "fromAddress": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "organisationID": {
          "type": "string",
          "x-nullable": true
        },
        "organisationName": {
          "type": "string",
          "x-nullable": true
        },
        "providerMessageIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "recipient": {
          "type": "string",
          "format": "email"
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "retrying",
            "suppressed",
            "accepted",
            "delivered",
            "delivery_delayed",
            "rejected",
            "transient_bounce",
            "permanent_bounce",
            "complained",
            "rendering_failed",
            "failed"
          ]
        },
        "statusOccurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "subject": {
          "type": "string"
        },
        "template": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AdminSESEmailDeliveryEvent": {
      "type": "object",
      "required": [
        "id",
        "status",
        "source",
        "detail",
        "attempt",
        "occurredAt"
      ],
      "properties": {
        "attempt": {
          "type": "integer",
          "format": "int64"
        },
        "detail": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "occurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "providerMessageID": {
          "type": "string",
          "x-nullable": true
        },
        "source": {
          "type": "string",
          "enum": [
            "worker",
            "ses"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "retrying",
            "suppressed",
            "accepted",
            "delivered",
            "delivery_delayed",
            "rejected",
            "transient_bounce",
            "permanent_bounce",
            "complained",
            "rendering_failed",
            "failed"
          ]
        }
      }
    },
    "AdminSESEmailDeliveryPage": {
      "type": "object",
      "required": [
        "deliveries"
      ],
      "properties": {
        "deliveries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminSESEmailDelivery"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminSESHealth": {
      "type": "object",
      "required": [
        "checkedAt",
        "sendingEnabled",
        "productionAccessEnabled",
        "enforcementStatus",
        "max24HourSend",
        "maxSendRate",
        "sentLast24Hours",
        "vdmStatus",
        "metricWindowStart",
        "metricWindowEnd",
        "metricWindowDays",
        "metrics"
      ],
      "properties": {
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enforcementStatus": {
          "description": "SES account reputation enforcement status",
          "type": "string"
        },
        "max24HourSend": {
          "type": "number",
          "format": "double"
        },
        "maxSendRate": {
          "type": "number",
          "format": "double"
        },
        "metricWindowDays": {
          "description": "Fixed recent aggregate window in UTC, currently 30 days",
          "type": "integer",
          "format": "int32"
        },
        "metricWindowEnd": {
          "type": "string",
          "format": "date-time"
        },
        "metricWindowStart": {
          "type": "string",
          "format": "date-time"
        },
        "metrics": {
          "$ref": "#/definitions/AdminSESMetrics"
        },
        "productionAccessEnabled": {
          "type": "boolean"
        },
        "sendingEnabled": {
          "type": "boolean"
        },
        "sentLast24Hours": {
          "type": "number",
          "format": "double"
        },
        "vdmStatus": {
          "description": "Virtual Deliverability Manager enabled status",
          "type": "string"
        }
      }
    },
    "AdminSESMessageInsight": {
      "type": "object",
      "required": [
        "messageID",
        "recipients"
      ],
      "properties": {
        "fromAddress": {
          "type": "string",
          "format": "email",
          "x-nullable": true
        },
        "messageID": {
          "type": "string"
        },
        "recipients": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminSESMessageInsightRecipient"
          }
        }
      }
    },
    "AdminSESMessageInsightEvent": {
      "type": "object",
      "required": [
        "eventType",
        "timestamp"
      ],
      "properties": {
        "eventType": {
          "type": "string"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AdminSESMessageInsightRecipient": {
      "type": "object",
      "required": [
        "address",
        "events"
      ],
      "properties": {
        "address": {
          "type": "string",
          "format": "email"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminSESMessageInsightEvent"
          }
        },
        "isp": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "AdminSESMetrics": {
      "type": "object",
      "required": [
        "send",
        "delivery",
        "complaint",
        "permanentBounce",
        "transientBounce"
      ],
      "properties": {
        "complaint": {
          "type": "integer",
          "format": "int64"
        },
        "delivery": {
          "type": "integer",
          "format": "int64"
        },
        "permanentBounce": {
          "type": "integer",
          "format": "int64"
        },
        "send": {
          "type": "integer",
          "format": "int64"
        },
        "transientBounce": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "AdminTransferOwnershipRequest": {
      "type": "object",
      "required": [
        "currentOwnerID",
        "newOwnerID"
      ],
      "properties": {
        "currentOwnerID": {
          "type": "string"
        },
        "newOwnerID": {
          "type": "string"
        }
      }
    },
    "AdminUserClerkStatus": {
      "type": "object",
      "required": [
        "linked",
        "exists",
        "checkedAt"
      ],
      "properties": {
        "banned": {
          "type": "boolean"
        },
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "clerkUserID": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "exists": {
          "type": "boolean"
        },
        "lastActiveAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastSignInAt": {
          "type": "string",
          "format": "date-time"
        },
        "linked": {
          "type": "boolean"
        },
        "locked": {
          "type": "boolean"
        },
        "passwordEnabled": {
          "type": "boolean"
        },
        "primaryEmail": {
          "type": "string",
          "format": "email"
        },
        "primaryEmailVerified": {
          "type": "boolean"
        },
        "twoFactorEnabled": {
          "type": "boolean"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AdminUserDetail": {
      "allOf": [
        {
          "$ref": "#/definitions/AdminUserSummary"
        },
        {
          "type": "object",
          "required": [
            "memberships",
            "invitations",
            "joinRequests",
            "emailSuppressed"
          ],
          "properties": {
            "clerkUserID": {
              "type": "string"
            },
            "emailSuppressed": {
              "type": "boolean"
            },
            "imageURL": {
              "type": "string"
            },
            "invitations": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AdminUserInvitation"
              }
            },
            "joinRequests": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AdminUserJoinRequest"
              }
            },
            "memberships": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AdminUserMembership"
              }
            }
          }
        }
      ]
    },
    "AdminUserInvitation": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "organisationName",
        "status",
        "createdAt",
        "sentCount"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "id": {
          "type": "string"
        },
        "lastSentAt": {
          "type": "string",
          "format": "date-time"
        },
        "organisationID": {
          "type": "string"
        },
        "organisationName": {
          "type": "string"
        },
        "sentCount": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "AdminUserJoinRequest": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "organisationName",
        "createdAt"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "id": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        },
        "organisationName": {
          "type": "string"
        }
      }
    },
    "AdminUserMembership": {
      "type": "object",
      "required": [
        "organisationID",
        "organisationName",
        "role",
        "roleIDs",
        "roleNames",
        "isOwner",
        "membershipType",
        "classification",
        "onlyOwner"
      ],
      "properties": {
        "classification": {
          "$ref": "#/definitions/MemberClassification"
        },
        "isOwner": {
          "type": "boolean"
        },
        "membershipType": {
          "type": "string"
        },
        "onlyOwner": {
          "type": "boolean"
        },
        "organisationID": {
          "type": "string"
        },
        "organisationName": {
          "type": "string"
        },
        "role": {
          "description": "Legacy coarse role retained for compatibility",
          "type": "string"
        },
        "roleIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "roleNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "AdminUserPage": {
      "type": "object",
      "required": [
        "users"
      ],
      "properties": {
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        },
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AdminUserSummary"
          }
        }
      }
    },
    "AdminUserSummary": {
      "type": "object",
      "required": [
        "id",
        "email",
        "givenName",
        "familyName",
        "type",
        "mode",
        "hasClerkAccount",
        "createdAt"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "hasClerkAccount": {
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "lastActivityAt": {
          "description": "Most recent locally observed application activity",
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test"
          ]
        },
        "type": {
          "type": "string"
        }
      }
    },
    "ApplyMemberImportRequest": {
      "type": "object",
      "required": [
        "rows"
      ],
      "properties": {
        "rows": {
          "type": "array",
          "maxItems": 1000,
          "items": {
            "$ref": "#/definitions/ReviewedMemberImportRow"
          }
        }
      }
    },
    "ArchiveExport": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "type",
        "status",
        "filename",
        "totalFiles",
        "totalBytes",
        "processedFiles",
        "processedBytes",
        "createdAt",
        "expiresAt",
        "parts"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "error": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "filename": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        },
        "parts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ArchiveExportPart"
          }
        },
        "processedBytes": {
          "type": "integer",
          "format": "int64"
        },
        "processedFiles": {
          "type": "integer",
          "format": "int64"
        },
        "skippedFiles": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "$ref": "#/definitions/ArchiveExportStatus"
        },
        "totalBytes": {
          "type": "integer",
          "format": "int64"
        },
        "totalFiles": {
          "type": "integer",
          "format": "int64"
        },
        "type": {
          "$ref": "#/definitions/ArchiveExportType"
        }
      }
    },
    "ArchiveExportPart": {
      "type": "object",
      "required": [
        "id",
        "status",
        "filename",
        "totalFiles",
        "totalBytes",
        "processedFiles",
        "processedBytes"
      ],
      "properties": {
        "error": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "processedBytes": {
          "type": "integer",
          "format": "int64"
        },
        "processedFiles": {
          "type": "integer",
          "format": "int64"
        },
        "skippedFiles": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "$ref": "#/definitions/ArchiveExportStatus"
        },
        "totalBytes": {
          "type": "integer",
          "format": "int64"
        },
        "totalFiles": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "ArchiveExportStatus": {
      "type": "string",
      "enum": [
        "queued",
        "processing",
        "ready",
        "failed",
        "cancelling",
        "cancelled",
        "expired"
      ]
    },
    "ArchiveExportType": {
      "type": "string",
      "enum": [
        "organisation_documents",
        "document_directory",
        "music_attachments"
      ]
    },
    "AttendanceReminder": {
      "type": "object",
      "required": [
        "enabled"
      ],
      "properties": {
        "audience": {
          "description": "Required when enabled is true.",
          "$ref": "#/definitions/EventReminderAudience"
        },
        "enabled": {
          "type": "boolean"
        },
        "leadTimeDays": {
          "description": "Required when enabled is true.",
          "type": "integer",
          "maximum": 365,
          "minimum": 1
        }
      }
    },
    "CheckoutConfirmation": {
      "type": "object",
      "required": [
        "complete",
        "billing"
      ],
      "properties": {
        "billing": {
          "$ref": "#/definitions/OrganisationBillingStatus"
        },
        "complete": {
          "type": "boolean"
        }
      }
    },
    "CheckoutURLResponse": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "description": "URL to redirect user to (Stripe checkout or billing portal)",
          "type": "string"
        }
      }
    },
    "ChoirSetupResult": {
      "type": "object",
      "properties": {
        "choirLogoAvailable": {
          "type": "boolean"
        },
        "connectRevision": {
          "type": "integer",
          "format": "int64"
        },
        "connectedAccount": {
          "type": "string"
        },
        "defaults": {
          "$ref": "#/definitions/SellerDetails"
        },
        "onboardingUrl": {
          "type": "string"
        },
        "paymentStatus": {
          "type": "string",
          "enum": [
            "unavailable",
            "not_connected",
            "pending",
            "incomplete",
            "ready"
          ]
        },
        "pendingRequestId": {
          "type": "string"
        },
        "preference": {
          "type": "string",
          "enum": [
            "stripe",
            "free_only"
          ]
        },
        "preferenceRevision": {
          "type": "integer",
          "format": "int64"
        },
        "profileComplete": {
          "type": "boolean"
        },
        "sellerDetails": {
          "$ref": "#/definitions/SellerDetails"
        },
        "sellerId": {
          "type": "string"
        },
        "sellerRevision": {
          "type": "integer",
          "format": "int64"
        },
        "sourceRevision": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "type": "string",
          "enum": [
            "missing",
            "pending",
            "available",
            "disabled"
          ]
        }
      }
    },
    "ChoirSetupSave": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "logoChoice": {
          "type": "string",
          "enum": [
            "saved",
            "custom",
            "removed",
            "choir"
          ]
        },
        "requestId": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1
        },
        "resume": {
          "description": "Resume the immutable saved request after reload; omit all profile, logo and revision fields. Current configure permission is required.",
          "type": "boolean"
        },
        "sellerDetails": {
          "$ref": "#/definitions/SellerDetails"
        },
        "sellerRevision": {
          "type": "integer",
          "format": "int64"
        },
        "sourceRevision": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "ConfirmOrganisationReplyEmailRequest": {
      "type": "object",
      "required": [
        "organisationID",
        "token"
      ],
      "properties": {
        "organisationID": {
          "type": "string",
          "maxLength": 100,
          "minLength": 1
        },
        "token": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1
        }
      }
    },
    "ConfirmOrganisationReplyEmailResponse": {
      "type": "object",
      "required": [
        "choirName",
        "replyEmail"
      ],
      "properties": {
        "choirName": {
          "type": "string"
        },
        "replyEmail": {
          "type": "string"
        }
      }
    },
    "CreateCheckoutRequest": {
      "type": "object",
      "required": [
        "plan",
        "termsAccepted"
      ],
      "properties": {
        "currency": {
          "description": "Currency chosen from current Pro pricing. Required for new subscriptions.",
          "type": "string",
          "pattern": "^[a-z]{3}$"
        },
        "plan": {
          "$ref": "#/definitions/PlanType"
        },
        "quote": {
          "description": "Displayed currency offer fingerprint. Missing or outdated quotes return 409 for new subscriptions.",
          "type": "string",
          "maxLength": 64
        },
        "requestID": {
          "description": "Unique ID for this checkout attempt. Reuse it only when retrying the same request.",
          "type": "string",
          "format": "uuid"
        },
        "termsAccepted": {
          "description": "The customer agreed to the terms and asked for Pro to start during the 14-day cancellation period. Must be true.",
          "type": "boolean"
        }
      }
    },
    "CreateEventAttachmentRequest": {
      "type": "object",
      "required": [
        "filename"
      ],
      "properties": {
        "filename": {
          "type": "string"
        }
      }
    },
    "CreateEventRequest": {
      "type": "object",
      "required": [
        "title",
        "timezone"
      ],
      "properties": {
        "doorsOpenTime": {
          "description": "Optional local time when doors open for the event",
          "type": "string",
          "format": "time"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "endTime": {
          "type": "string",
          "format": "time"
        },
        "excludedUserIds": {
          "description": "User IDs to exclude from this event",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "hasRehearsal": {
          "description": "Whether a rehearsal is planned, including when its time is not yet known.",
          "type": "boolean"
        },
        "location": {
          "$ref": "#/definitions/CreateEventRequestLocation"
        },
        "note": {
          "type": "string",
          "maxLength": 100000
        },
        "onlineURL": {
          "description": "Optional HTTPS link for joining the event online, alongside or instead of the physical location",
          "type": "string",
          "maxLength": 2048
        },
        "rehearsalLocation": {
          "description": "Optional location used specifically for the rehearsal",
          "$ref": "#/definitions/CreateEventRequestLocation"
        },
        "rehearsalStartDate": {
          "type": "string",
          "format": "date"
        },
        "rehearsalStartTime": {
          "type": "string",
          "format": "time"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "startTime": {
          "type": "string",
          "format": "time"
        },
        "ticketURL": {
          "type": "string",
          "maxLength": 2048
        },
        "timezone": {
          "type": "string"
        },
        "title": {
          "type": "string",
          "maxLength": 500,
          "minLength": 1
        },
        "usergroup_id": {
          "type": "string",
          "x-nullable": true
        },
        "visible_only_to_usergroup": {
          "type": "boolean"
        }
      }
    },
    "CreateEventRequestLocation": {
      "type": "object",
      "properties": {
        "googlePlacesID": {
          "type": "string"
        },
        "latitude": {
          "description": "Event-specific pin latitude; must be supplied with longitude",
          "type": "number",
          "maximum": 90,
          "minimum": -90
        },
        "longitude": {
          "description": "Event-specific pin longitude; must be supplied with latitude",
          "type": "number",
          "maximum": 180,
          "minimum": -180
        },
        "name": {
          "type": "string",
          "maxLength": 2048
        }
      }
    },
    "CreateMemberImportRequest": {
      "type": "object",
      "properties": {
        "content": {
          "description": "Base64-encoded CSV, text, or XLSX file content",
          "type": "string",
          "maxLength": 8388608
        },
        "filename": {
          "type": "string",
          "maxLength": 255
        },
        "googleSheetsURL": {
          "description": "Public Google Sheets URL. Provide either this or content.",
          "type": "string",
          "maxLength": 2048
        }
      }
    },
    "CreateProgrammeRequest": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "CreateProgrammeSectionRequest": {
      "type": "object",
      "required": [
        "name",
        "position"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "position": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "Currency": {
      "type": "string",
      "maxLength": 3,
      "minLength": 3,
      "enum": [
        "USD",
        "EUR",
        "GBP",
        "JPY",
        "AUD",
        "CAD",
        "CHF",
        "CNY",
        "HKD",
        "NZD"
      ]
    },
    "CustomProgrammePart": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "programmeID",
        "name"
      ],
      "properties": {
        "description": {
          "description": "Optional description or details",
          "type": "string",
          "x-nullable": true
        },
        "id": {
          "type": "string"
        },
        "name": {
          "description": "Name of the custom part (e.g., \"Reading\", \"Organ Voluntary\")",
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        },
        "performer": {
          "description": "Who is performing or presenting this part",
          "type": "string",
          "x-nullable": true
        },
        "programmeID": {
          "type": "string"
        }
      }
    },
    "DeleteEventResponseRequest": {
      "type": "object",
      "required": [
        "userID"
      ],
      "properties": {
        "userID": {
          "type": "string"
        }
      }
    },
    "DirectoryContents": {
      "type": "object",
      "required": [
        "documents",
        "directories"
      ],
      "properties": {
        "directories": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentDirectory"
          }
        },
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationDocumentMeta"
          }
        }
      }
    },
    "DocumentDirectory": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        },
        "parentID": {
          "type": "string"
        },
        "visibleToAdminsOnly": {
          "description": "If true, only organisation Admins can see the folder. Takes precedence over visibleToUsergroupIDs.",
          "type": "boolean"
        },
        "visibleToUsergroupIDs": {
          "description": "Usergroups the folder is restricted to. Empty means visible to all members.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "DocumentEmailImport": {
      "type": "object",
      "required": [
        "id",
        "receivedAt",
        "status",
        "message",
        "files"
      ],
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentEmailImportFile"
          }
        },
        "id": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "receivedAt": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "completed",
            "partial",
            "rejected"
          ]
        }
      }
    },
    "DocumentEmailImportFile": {
      "type": "object",
      "required": [
        "filename",
        "status",
        "error"
      ],
      "properties": {
        "documentID": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "uploaded",
            "rejected"
          ]
        }
      }
    },
    "DocumentEmailSettings": {
      "type": "object",
      "required": [
        "available",
        "address",
        "acceptedSenders",
        "maxAttachmentBytes",
        "imports"
      ],
      "properties": {
        "acceptedSenders": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "address": {
          "description": "Personal upload address; empty when disabled. Treat as private.",
          "type": "string"
        },
        "available": {
          "type": "boolean"
        },
        "imports": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentEmailImport"
          }
        },
        "maxAttachmentBytes": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "DocumentUploadURL": {
      "type": "object",
      "required": [
        "url",
        "documentID",
        "fields"
      ],
      "properties": {
        "documentID": {
          "type": "string"
        },
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "url": {
          "type": "string"
        }
      }
    },
    "EditMusicPieceAttachmentRequest": {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/definitions/MusicPieceAttachmentData"
        }
      }
    },
    "EditMusicPieceRequest": {
      "type": "object",
      "properties": {
        "arranger": {
          "type": "string",
          "x-nullable": true
        },
        "composer": {
          "type": "string",
          "x-nullable": true
        },
        "durationMinutes": {
          "description": "Estimated performance time, in whole minutes. Omit to keep the current value; 0 clears it.",
          "type": "integer",
          "format": "int64",
          "maximum": 1440,
          "x-nullable": true
        },
        "tags": {
          "type": "array",
          "maxItems": 25,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1
          }
        },
        "title": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "EditOrganisationDocumentRequest": {
      "type": "object",
      "properties": {
        "confirmVisibilityBroadening": {
          "description": "Confirms a directory change that would make the document visible to more members.",
          "type": "boolean"
        },
        "description": {
          "type": "string",
          "x-nullable": true
        },
        "directoryID": {
          "type": "string",
          "x-nullable": true
        },
        "filename": {
          "type": "string",
          "x-nullable": true
        },
        "visibleToAdminsOnly": {
          "description": "If true, only organisation Admins can see the document. Takes precedence over visibleToUsergroupIDs.",
          "type": "boolean",
          "x-nullable": true
        },
        "visibleToUsergroupIDs": {
          "description": "Usergroups the document is restricted to. Empty means visible to all members.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "x-nullable": true
        }
      }
    },
    "EmailPreference": {
      "type": "object",
      "required": [
        "type",
        "name",
        "description",
        "isMandatory",
        "enabled"
      ],
      "properties": {
        "description": {
          "description": "Description of when this email is sent",
          "type": "string",
          "example": "Receive notifications when new events are added to your choirs"
        },
        "enabled": {
          "description": "Whether this email type is currently enabled for the user",
          "type": "boolean"
        },
        "isMandatory": {
          "description": "Whether this email type can be disabled by the user",
          "type": "boolean"
        },
        "name": {
          "description": "Display name for the email type",
          "type": "string",
          "example": "New Event Created"
        },
        "type": {
          "description": "Unique identifier for the email type",
          "type": "string",
          "example": "event_created"
        }
      }
    },
    "EventAttachment": {
      "type": "object",
      "required": [
        "id",
        "filename",
        "filetype",
        "fileSizeBytes",
        "uploadedBy",
        "uploadedAt"
      ],
      "properties": {
        "fileSizeBytes": {
          "type": "integer"
        },
        "filename": {
          "type": "string"
        },
        "filetype": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "thumbnail": {
          "type": "string",
          "format": "byte",
          "x-nullable": true
        },
        "uploadedAt": {
          "type": "string",
          "format": "date-time"
        },
        "uploadedBy": {
          "type": "string"
        }
      }
    },
    "EventAttachmentUploadURL": {
      "type": "object",
      "required": [
        "url",
        "fields"
      ],
      "properties": {
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "url": {
          "type": "string"
        }
      }
    },
    "EventCover": {
      "type": "object",
      "required": [
        "id",
        "ready"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "ready": {
          "type": "boolean"
        }
      }
    },
    "EventCoverUploadRequest": {
      "type": "object",
      "required": [
        "sizeBytes",
        "contentType",
        "contentMD5"
      ],
      "properties": {
        "contentMD5": {
          "type": "string",
          "maxLength": 24,
          "minLength": 24
        },
        "contentType": {
          "type": "string",
          "enum": [
            "image/jpeg",
            "image/png",
            "image/webp"
          ]
        },
        "sizeBytes": {
          "type": "integer",
          "format": "int64",
          "maximum": 5242880,
          "minimum": 1
        }
      }
    },
    "EventCoverUploadURL": {
      "type": "object",
      "required": [
        "coverID",
        "url",
        "fields"
      ],
      "properties": {
        "coverID": {
          "type": "string"
        },
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "url": {
          "type": "string"
        }
      }
    },
    "EventEmailMessageFormat": {
      "description": "How the message is encoded. Omitted request values mean plain.",
      "type": "string",
      "enum": [
        "plain",
        "html"
      ]
    },
    "EventEmailReplyTo": {
      "description": "Where replies go. Omitted means choir. Choir falls back to no-reply when the choir has no confirmed reply address.",
      "type": "string",
      "enum": [
        "choir",
        "no_reply"
      ]
    },
    "EventLocation": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "googleLocation": {
          "$ref": "#/definitions/GoogleLocation"
        },
        "latitude": {
          "description": "Event-specific pin latitude when the organiser overrides or drops a pin",
          "type": "number",
          "maximum": 90,
          "minimum": -90
        },
        "longitude": {
          "description": "Event-specific pin longitude when the organiser overrides or drops a pin",
          "type": "number",
          "maximum": 180,
          "minimum": -180
        },
        "name": {
          "type": "string"
        }
      }
    },
    "EventManualEmailAttendanceStatus": {
      "type": "string",
      "enum": [
        "going",
        "not_going",
        "maybe",
        "no_response"
      ]
    },
    "EventManualEmailQueued": {
      "type": "object",
      "required": [
        "selectedCount"
      ],
      "properties": {
        "selectedCount": {
          "description": "Number of members in the reviewed selection, not the private delivery count.",
          "type": "integer"
        }
      }
    },
    "EventManualEmailRecipient": {
      "type": "object",
      "required": [
        "userID",
        "givenName",
        "familyName",
        "voicePartCode",
        "classification",
        "attendanceStatus"
      ],
      "properties": {
        "attendanceStatus": {
          "$ref": "#/definitions/EventManualEmailAttendanceStatus"
        },
        "classification": {
          "$ref": "#/definitions/MemberClassification"
        },
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "userID": {
          "type": "string"
        },
        "voicePartCode": {
          "type": "string"
        }
      }
    },
    "EventManualEmailRecipientGroup": {
      "type": "string",
      "enum": [
        "all",
        "going",
        "no_response",
        "no_response_or_maybe",
        "except_not_going",
        "maybe"
      ]
    },
    "EventManualEmailRecipients": {
      "type": "object",
      "required": [
        "recipients",
        "count",
        "eventRevision"
      ],
      "properties": {
        "count": {
          "type": "integer"
        },
        "eventRevision": {
          "description": "Revision of the event details used for this recipient preview.",
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "recipients": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EventManualEmailRecipient"
          }
        }
      }
    },
    "EventProgramme": {
      "type": "object",
      "required": [
        "programme",
        "sections",
        "pieces"
      ],
      "properties": {
        "pieces": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProgrammePiece"
          }
        },
        "programme": {
          "$ref": "#/definitions/Programme"
        },
        "sections": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProgrammeSection"
          }
        }
      }
    },
    "EventPublicPage": {
      "type": "object",
      "required": [
        "publicEventID",
        "organisationID",
        "eventID",
        "destination",
        "publicDescription",
        "includeTicketLink",
        "published",
        "publicURL",
        "effectiveURLSource"
      ],
      "properties": {
        "destination": {
          "$ref": "#/definitions/EventPublicPageDestination"
        },
        "effectiveExternalURL": {
          "type": "string",
          "x-nullable": true
        },
        "effectiveURLSource": {
          "type": "string",
          "enum": [
            "hosted",
            "override",
            "organisation_website",
            "missing"
          ]
        },
        "eventID": {
          "type": "string"
        },
        "externalURLOverride": {
          "type": "string",
          "x-nullable": true
        },
        "includeTicketLink": {
          "type": "boolean"
        },
        "organisationID": {
          "type": "string"
        },
        "publicDescription": {
          "type": "string"
        },
        "publicEventID": {
          "type": "string"
        },
        "publicURL": {
          "type": "string"
        },
        "published": {
          "type": "boolean"
        }
      }
    },
    "EventPublicPageDestination": {
      "type": "string",
      "enum": [
        "hosted",
        "external"
      ]
    },
    "EventRSVPDetails": {
      "type": "object",
      "required": [
        "choirName",
        "eventTitle",
        "eventDate",
        "expiresAt"
      ],
      "properties": {
        "choirName": {
          "type": "string"
        },
        "currentResponse": {
          "x-nullable": true,
          "$ref": "#/definitions/EventResponse"
        },
        "eventDate": {
          "type": "string"
        },
        "eventTime": {
          "type": "string"
        },
        "eventTitle": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "string"
        }
      }
    },
    "EventRSVPResponseRequest": {
      "type": "object",
      "required": [
        "response"
      ],
      "properties": {
        "response": {
          "$ref": "#/definitions/EventResponse"
        }
      }
    },
    "EventReminderAudience": {
      "type": "string",
      "enum": [
        "no_response",
        "no_response_or_maybe"
      ]
    },
    "EventResponse": {
      "type": "string",
      "enum": [
        "going",
        "not_going",
        "maybe"
      ]
    },
    "EventResponse2": {
      "type": "object",
      "required": [
        "userID",
        "response"
      ],
      "properties": {
        "response": {
          "$ref": "#/definitions/EventResponse"
        },
        "userID": {
          "type": "string"
        }
      }
    },
    "EventResponseRequest": {
      "type": "object",
      "required": [
        "userID",
        "response"
      ],
      "properties": {
        "response": {
          "$ref": "#/definitions/EventResponse"
        },
        "userID": {
          "type": "string"
        }
      }
    },
    "EventResponseSummary": {
      "type": "object",
      "required": [
        "response",
        "byVoicePart",
        "total"
      ],
      "properties": {
        "byVoicePart": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/VoicePartAttendance"
          }
        },
        "response": {
          "$ref": "#/definitions/EventResponse"
        },
        "total": {
          "type": "integer"
        }
      }
    },
    "EventSourceConflict": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "ticketing_schedule_locked",
            "source_revision_conflict"
          ]
        }
      }
    },
    "EventTicketingStatus": {
      "type": "object",
      "required": [
        "scheduleLocked",
        "sourceRevision"
      ],
      "properties": {
        "publicationCorrelation": {
          "description": "Durable first-publication request ID; never a grant or credential.",
          "type": "string"
        },
        "scheduleLocked": {
          "type": "boolean"
        },
        "sourceRevision": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "EventVoicePartOverride": {
      "type": "object",
      "required": [
        "userID",
        "voicePartCode"
      ],
      "properties": {
        "userID": {
          "type": "string"
        },
        "voicePartCode": {
          "$ref": "#/definitions/VoicePartCode"
        }
      }
    },
    "EventVoicePartOverrideRequest": {
      "type": "object",
      "required": [
        "voicePartCode"
      ],
      "properties": {
        "voicePartCode": {
          "$ref": "#/definitions/VoicePartCode"
        }
      }
    },
    "ExcludeUsersRequest": {
      "type": "object",
      "required": [
        "userIds"
      ],
      "properties": {
        "userIds": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "FeatureFlag": {
      "type": "object",
      "required": [
        "key",
        "description",
        "enabled",
        "sources"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "key": {
          "$ref": "#/definitions/FeatureFlagKey"
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "user",
              "organisation",
              "global"
            ]
          }
        }
      }
    },
    "FeatureFlagAssignmentUpdate": {
      "type": "object",
      "required": [
        "enabledKeys"
      ],
      "properties": {
        "enabledKeys": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/definitions/FeatureFlagKey"
          }
        }
      }
    },
    "FeatureFlagAssignments": {
      "type": "object",
      "required": [
        "definitions",
        "enabledKeys"
      ],
      "properties": {
        "definitions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FeatureFlagDefinition"
          }
        },
        "enabledKeys": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/definitions/FeatureFlagKey"
          }
        }
      }
    },
    "FeatureFlagDefinition": {
      "type": "object",
      "required": [
        "key",
        "description"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "key": {
          "$ref": "#/definitions/FeatureFlagKey"
        }
      }
    },
    "FeatureFlagKey": {
      "type": "string",
      "enum": [
        "upgrade_plan",
        "document_email_uploads",
        "ticketing"
      ]
    },
    "FeatureFlagsResponse": {
      "type": "object",
      "required": [
        "flags"
      ],
      "properties": {
        "flags": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FeatureFlag"
          }
        }
      }
    },
    "FeedbackRequest": {
      "type": "object",
      "required": [
        "feedback",
        "type"
      ],
      "properties": {
        "feedback": {
          "type": "string",
          "maxLength": 10000,
          "minLength": 1
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true
        },
        "organisationID": {
          "description": "Currently selected organisation",
          "type": "string",
          "pattern": "^org_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
        },
        "screenshotID": {
          "description": "Optional private screenshot uploaded for this feedback",
          "type": "string",
          "pattern": "^fscr_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
        },
        "type": {
          "$ref": "#/definitions/FeedbackType"
        }
      }
    },
    "FeedbackScreenshotUploadRequest": {
      "type": "object",
      "required": [
        "contentMD5",
        "contentType",
        "sizeBytes"
      ],
      "properties": {
        "contentMD5": {
          "type": "string",
          "maxLength": 24,
          "minLength": 24
        },
        "contentType": {
          "type": "string",
          "enum": [
            "image/jpeg",
            "image/png",
            "image/webp"
          ]
        },
        "sizeBytes": {
          "type": "integer",
          "format": "int64",
          "maximum": 5242880,
          "minimum": 1
        }
      }
    },
    "FeedbackScreenshotUploadURL": {
      "type": "object",
      "required": [
        "screenshotID",
        "url",
        "fields"
      ],
      "properties": {
        "fields": {
          "description": "HTTP headers that must be included with the PUT request",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "screenshotID": {
          "type": "string"
        },
        "url": {
          "description": "Presigned URL that accepts the screenshot with an HTTP PUT request",
          "type": "string"
        }
      }
    },
    "FeedbackType": {
      "type": "string",
      "enum": [
        "bug",
        "feature",
        "other"
      ]
    },
    "GoogleLocation": {
      "type": "object",
      "required": [
        "googlePlacesID",
        "name",
        "address",
        "latitude",
        "longitude"
      ],
      "properties": {
        "address": {
          "type": "string"
        },
        "googlePlacesID": {
          "type": "string"
        },
        "latitude": {
          "type": "number"
        },
        "longitude": {
          "type": "number"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "InviteUserRequest": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "emails": {
          "description": "Up to 50 addresses per request; duplicates are collapsed case-insensitively",
          "type": "array",
          "maxItems": 50,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "InviteUsersResponse": {
      "type": "object",
      "required": [
        "userID",
        "email",
        "inviteID"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "inviteID": {
          "type": "string"
        },
        "userID": {
          "type": "string"
        }
      }
    },
    "InviteUsersResponses": {
      "description": "Map of email \u003c\u003e user id",
      "type": "array",
      "items": {
        "$ref": "#/definitions/InviteUsersResponse"
      }
    },
    "LegalIdentity": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "maxLength": 1000
        },
        "jurisdiction": {
          "type": "string",
          "maxLength": 100
        },
        "kind": {
          "type": "string",
          "enum": [
            "company",
            "charity",
            "individual",
            "partnership",
            "unincorporated"
          ]
        },
        "legalName": {
          "type": "string",
          "maxLength": 200
        },
        "registrationNumber": {
          "type": "string",
          "maxLength": 100
        },
        "tradingName": {
          "type": "string",
          "maxLength": 200
        },
        "vatNumber": {
          "type": "string",
          "maxLength": 100
        }
      }
    },
    "LocationSearchTextResults": {
      "type": "object",
      "required": [
        "results"
      ],
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GoogleLocation"
          }
        }
      }
    },
    "MarkProgrammeDraftRequest": {
      "type": "object",
      "required": [
        "draft"
      ],
      "properties": {
        "draft": {
          "type": "boolean"
        }
      }
    },
    "MemberClassification": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "function": {
          "$ref": "#/definitions/MemberFunction"
        },
        "kind": {
          "$ref": "#/definitions/MemberClassificationKind"
        },
        "voice_part": {
          "$ref": "#/definitions/VoicePart"
        }
      }
    },
    "MemberClassificationKind": {
      "type": "string",
      "enum": [
        "voice_part",
        "function",
        "unassigned"
      ]
    },
    "MemberFunction": {
      "type": "string",
      "enum": [
        "conductor",
        "accompanist"
      ]
    },
    "MemberImport": {
      "type": "object",
      "required": [
        "id",
        "filename",
        "headers",
        "rows",
        "createdAt",
        "expiresAt"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "filename": {
          "type": "string"
        },
        "headers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "id": {
          "type": "string"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MemberImportRow"
          }
        },
        "sheetName": {
          "type": "string"
        }
      }
    },
    "MemberImportRow": {
      "type": "object",
      "required": [
        "rowNumber",
        "sourceValues",
        "givenName",
        "familyName",
        "email",
        "voicePartCode",
        "status",
        "excluded"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "excluded": {
          "type": "boolean"
        },
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "rowNumber": {
          "type": "integer",
          "format": "int64"
        },
        "sourceValues": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "ready",
            "needs_attention",
            "already_member",
            "imported",
            "failed"
          ]
        },
        "voicePartCode": {
          "type": "string"
        }
      }
    },
    "MembershipOrigin": {
      "type": "string",
      "enum": [
        "founder",
        "invitation",
        "join_request",
        "join_code",
        "import"
      ]
    },
    "MembershipStatus": {
      "type": "string",
      "enum": [
        "pending",
        "active",
        "suspended"
      ]
    },
    "MembershipType": {
      "type": "string",
      "enum": [
        "invited",
        "accepted_invitation",
        "founder",
        "request_accepted",
        "join_code"
      ]
    },
    "MoveDocumentsRequest": {
      "type": "object",
      "required": [
        "documentIDs",
        "directoryID"
      ],
      "properties": {
        "confirmVisibilityBroadening": {
          "description": "Set to true to confirm a move that makes one or more documents visible to additional members",
          "type": "boolean"
        },
        "directoryID": {
          "type": "string"
        },
        "documentIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "MusicPiece": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "title",
        "createdAt",
        "attachments",
        "tags"
      ],
      "properties": {
        "arranger": {
          "type": "string"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MusicPieceAttachment"
          }
        },
        "composer": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "durationMinutes": {
          "description": "Estimated performance time, in whole minutes",
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "id": {
          "type": "string"
        },
        "imageURL": {
          "type": "string",
          "x-nullable": true
        },
        "organisationID": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "title": {
          "type": "string"
        }
      }
    },
    "MusicPieceAttachment": {
      "type": "object",
      "required": [
        "id",
        "type",
        "data",
        "uploadedBy",
        "uploadedAt"
      ],
      "properties": {
        "data": {
          "$ref": "#/definitions/MusicPieceAttachmentData"
        },
        "fileSizeBytes": {
          "type": "integer",
          "format": "int64"
        },
        "id": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/MusicPieceAttachmentType"
        },
        "uploadedAt": {
          "type": "string",
          "format": "date-time"
        },
        "uploadedBy": {
          "type": "string"
        }
      }
    },
    "MusicPieceAttachmentData": {
      "type": "object",
      "properties": {
        "arranger": {
          "type": "string"
        },
        "choir": {
          "type": "string"
        },
        "conductor": {
          "type": "string"
        },
        "edition": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "filetype": {
          "type": "string"
        },
        "isbn": {
          "type": "string"
        },
        "publisher": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "MusicPieceAttachmentType": {
      "description": "Uploaded ISO BMFF recordings use media_file until track inspection determines audio_file or video_file. Unclassified media and remote media links remain media_file.",
      "type": "string",
      "enum": [
        "unknown",
        "audio_file",
        "video_file",
        "media_file",
        "sheet_music",
        "image",
        "spotify",
        "youtube",
        "facebook",
        "tiktok",
        "soundcloud"
      ]
    },
    "MusicPieceAttachmentUploadURL": {
      "type": "object",
      "required": [
        "url",
        "fields"
      ],
      "properties": {
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "url": {
          "type": "string"
        }
      }
    },
    "MusicPieceAttachmentUploadURLRequest": {
      "type": "object",
      "required": [
        "filename",
        "contentMD5"
      ],
      "properties": {
        "contentMD5": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        }
      }
    },
    "NewDocumentDirectoryRequest": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "parentID": {
          "description": "Parent directory ID",
          "type": "string"
        },
        "visibleToAdminsOnly": {
          "description": "If true, only organisation Admins can see the folder. Takes precedence over visibleToUsergroupIDs.",
          "type": "boolean"
        },
        "visibleToUsergroupIDs": {
          "description": "Usergroups the folder is restricted to. Empty means visible to all members.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "NewMusicPieceAttachmentRequest": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "$ref": "#/definitions/MusicPieceAttachmentData"
        }
      }
    },
    "NewMusicPieceRequest": {
      "type": "object",
      "required": [
        "title"
      ],
      "properties": {
        "arranger": {
          "type": "string"
        },
        "composer": {
          "type": "string"
        },
        "durationMinutes": {
          "description": "Estimated performance time, in whole minutes. 0 means no duration.",
          "type": "integer",
          "format": "int64",
          "maximum": 1440,
          "x-nullable": true
        },
        "tags": {
          "type": "array",
          "maxItems": 25,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1
          }
        },
        "title": {
          "type": "string"
        }
      }
    },
    "NewOrganisationRequest": {
      "type": "object",
      "required": [
        "name",
        "voicingID",
        "isPublic"
      ],
      "properties": {
        "googlePlacesID": {
          "type": "string"
        },
        "isPublic": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "voicingID": {
          "type": "string"
        }
      }
    },
    "NewTicketOrderRequest": {
      "type": "object",
      "required": [
        "user",
        "items"
      ],
      "properties": {
        "items": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/TicketOrderItem"
          }
        },
        "user": {
          "$ref": "#/definitions/TicketOrderUser"
        }
      }
    },
    "NewTicketTypeRequest": {
      "type": "object",
      "required": [
        "name",
        "priceAmount",
        "currency"
      ],
      "properties": {
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "priceAmount": {
          "type": "integer"
        },
        "quantityAvailable": {
          "type": "integer",
          "x-nullable": true
        }
      }
    },
    "NewUserRequest": {
      "type": "object",
      "required": [
        "given_name",
        "family_name"
      ],
      "properties": {
        "family_name": {
          "type": "string"
        },
        "given_name": {
          "type": "string"
        }
      }
    },
    "NewUsergroupRequest": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "OnboardingTokenRequest": {
      "type": "object",
      "required": [
        "token"
      ],
      "properties": {
        "token": {
          "type": "string",
          "maxLength": 64,
          "minLength": 40,
          "pattern": "^[A-Za-z0-9_-]+$"
        }
      }
    },
    "Organisation": {
      "type": "object",
      "required": [
        "id",
        "name",
        "isPublic",
        "members",
        "voicing",
        "entitlements",
        "attendanceReminder",
        "access"
      ],
      "properties": {
        "access": {
          "$ref": "#/definitions/OrganisationAccess"
        },
        "attendanceReminder": {
          "description": "Attendance reminder applied to events in this organisation.",
          "$ref": "#/definitions/AttendanceReminder"
        },
        "brandColour": {
          "type": "string",
          "x-nullable": true
        },
        "entitlements": {
          "$ref": "#/definitions/OrganisationEntitlements"
        },
        "id": {
          "type": "string"
        },
        "isPublic": {
          "description": "Whether the organisation is listed in public search.",
          "type": "boolean"
        },
        "logoURL": {
          "type": "string",
          "x-nullable": true
        },
        "members": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationMember"
          }
        },
        "name": {
          "type": "string"
        },
        "pendingReplyEmail": {
          "description": "Address awaiting confirmation. Returned only to members who can manage settings.",
          "type": "string",
          "x-nullable": true
        },
        "replyEmail": {
          "description": "Confirmed choir reply address. Returned only to members who can send choir emails or manage settings.",
          "type": "string",
          "x-nullable": true
        },
        "storage": {
          "$ref": "#/definitions/OrganisationStorage"
        },
        "timezone": {
          "description": "IANA timezone identifier (e.g., \"Europe/London\")",
          "type": "string",
          "x-nullable": true
        },
        "voicing": {
          "$ref": "#/definitions/Voicing"
        },
        "websiteURL": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "OrganisationAccess": {
      "type": "object",
      "required": [
        "organisationID",
        "userID",
        "membershipStatus",
        "roleIDs",
        "effectivePermissions",
        "isOwner",
        "policyRevision",
        "membershipVersion"
      ],
      "properties": {
        "effectivePermissions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "isOwner": {
          "type": "boolean"
        },
        "membershipStatus": {
          "$ref": "#/definitions/MembershipStatus"
        },
        "membershipVersion": {
          "type": "integer",
          "format": "int64"
        },
        "organisationID": {
          "type": "string"
        },
        "policyRevision": {
          "type": "integer",
          "format": "int64"
        },
        "roleIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "userID": {
          "type": "string"
        }
      }
    },
    "OrganisationAuditActor": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "displayName": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "userID": {
          "type": "string"
        }
      }
    },
    "OrganisationAuditEvent": {
      "type": "object",
      "required": [
        "id",
        "eventType",
        "occurredAt",
        "action",
        "summary",
        "outcome",
        "actor",
        "statusCode",
        "partialCompletion",
        "truncated"
      ],
      "properties": {
        "action": {
          "type": "string"
        },
        "actor": {
          "$ref": "#/definitions/OrganisationAuditActor"
        },
        "after": {
          "type": "object",
          "additionalProperties": true
        },
        "before": {
          "type": "object",
          "additionalProperties": true
        },
        "changedFields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "eventType": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true
        },
        "occurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "operationID": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "partialCompletion": {
          "type": "boolean"
        },
        "reasonCode": {
          "type": "string"
        },
        "relatedTargets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationAuditTarget"
          }
        },
        "statusCode": {
          "type": "integer"
        },
        "summary": {
          "type": "string"
        },
        "target": {
          "$ref": "#/definitions/OrganisationAuditTarget"
        },
        "truncated": {
          "type": "boolean"
        }
      }
    },
    "OrganisationAuditEventPage": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationAuditEvent"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "OrganisationAuditTarget": {
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "displayName": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "OrganisationBillingStatus": {
      "type": "object",
      "required": [
        "effectivePlan",
        "planSource",
        "stripeCancelAtPeriodEnd"
      ],
      "properties": {
        "billingContactUserID": {
          "type": "string"
        },
        "effectivePlan": {
          "type": "string",
          "enum": [
            "free",
            "pro"
          ]
        },
        "manualPlanExpiresAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "planSource": {
          "type": "string",
          "enum": [
            "manual",
            "stripe"
          ]
        },
        "stripeCancelAtPeriodEnd": {
          "type": "boolean"
        },
        "stripeCurrentPeriodEnd": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "stripeLastSyncedAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "stripeSubscriptionStatus": {
          "type": "string",
          "enum": [
            "incomplete",
            "incomplete_expired",
            "trialing",
            "active",
            "past_due",
            "canceled",
            "unpaid",
            "paused"
          ]
        }
      }
    },
    "OrganisationCloudDocument": {
      "type": "object",
      "required": [
        "id",
        "url",
        "uploadedBy",
        "uploadedAt"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "uploadedAt": {
          "type": "string",
          "format": "date-time"
        },
        "uploadedBy": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "visibleToAdminsOnly": {
          "description": "If true, only organisation Admins can see the cloud document. Takes precedence over visibleToUsergroupIDs.",
          "type": "boolean"
        },
        "visibleToUsergroupIDs": {
          "description": "Usergroups the cloud document is restricted to. Empty means visible to all members.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "OrganisationDocumentMeta": {
      "type": "object",
      "required": [
        "id",
        "filename",
        "filetype",
        "fileSizeBytes",
        "uploadedBy",
        "uploadedAt"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "directoryID": {
          "type": "string"
        },
        "fileSizeBytes": {
          "type": "integer"
        },
        "filename": {
          "type": "string"
        },
        "filetype": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "thumbnail": {
          "type": "string",
          "format": "byte",
          "x-nullable": true
        },
        "uploadedAt": {
          "type": "string",
          "format": "date-time"
        },
        "uploadedBy": {
          "type": "string"
        },
        "visibleToAdminsOnly": {
          "description": "If true, only organisation Admins can see the document. Takes precedence over visibleToUsergroupIDs.",
          "type": "boolean"
        },
        "visibleToUsergroupIDs": {
          "description": "Usergroups the document is restricted to. Empty means visible to all members.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "OrganisationEmailEntitlements": {
      "type": "object",
      "required": [
        "memberEmailsUsed",
        "memberEmailsLimit",
        "invitationsUsed",
        "invitationsLimit",
        "invitationsToday",
        "invitationsPerDay",
        "invitationDayResetsAt",
        "manualCampaignsToday",
        "manualCampaignsPerDay",
        "periodStart",
        "resetsAt"
      ],
      "properties": {
        "invitationDayResetsAt": {
          "type": "string",
          "format": "date-time"
        },
        "invitationsLimit": {
          "type": "integer",
          "format": "int64"
        },
        "invitationsPerDay": {
          "type": "integer",
          "format": "int64"
        },
        "invitationsToday": {
          "type": "integer",
          "format": "int64"
        },
        "invitationsUsed": {
          "type": "integer",
          "format": "int64"
        },
        "manualCampaignsPerDay": {
          "type": "integer",
          "format": "int64"
        },
        "manualCampaignsToday": {
          "type": "integer",
          "format": "int64"
        },
        "memberEmailsLimit": {
          "type": "integer",
          "format": "int64"
        },
        "memberEmailsUsed": {
          "type": "integer",
          "format": "int64"
        },
        "periodStart": {
          "type": "string",
          "format": "date-time"
        },
        "resetsAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "OrganisationEntitlement": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "object"
        }
      }
    },
    "OrganisationEntitlements": {
      "type": "object",
      "required": [
        "entitlements",
        "plan"
      ],
      "properties": {
        "email": {
          "$ref": "#/definitions/OrganisationEmailEntitlements"
        },
        "entitlements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationEntitlement"
          }
        },
        "plan": {
          "type": "string",
          "enum": [
            "free",
            "pro"
          ]
        }
      }
    },
    "OrganisationEvent": {
      "type": "object",
      "required": [
        "organisationID",
        "data",
        "attendance"
      ],
      "properties": {
        "attendance": {
          "$ref": "#/definitions/OrganisationEventAttendance"
        },
        "data": {
          "$ref": "#/definitions/OrganisationEventData"
        },
        "organisationID": {
          "type": "string"
        }
      }
    },
    "OrganisationEvent2": {
      "type": "object",
      "required": [
        "organisationID",
        "data",
        "attendance"
      ],
      "properties": {
        "attendance": {
          "$ref": "#/definitions/OrganisationEventAttendance2"
        },
        "data": {
          "$ref": "#/definitions/OrganisationEventData"
        },
        "organisationID": {
          "type": "string"
        }
      }
    },
    "OrganisationEventAttendance": {
      "type": "object",
      "required": [
        "userResponses",
        "summaryByResponse"
      ],
      "properties": {
        "summaryByResponse": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EventResponseSummary"
          }
        },
        "userResponses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserEventResponse"
          }
        }
      }
    },
    "OrganisationEventAttendance2": {
      "type": "object",
      "required": [
        "responses"
      ],
      "properties": {
        "eligibleMemberCount": {
          "description": "Number of active members eligible to respond after user group and exclusion rules are applied.",
          "type": "integer",
          "format": "int64"
        },
        "eligibleUserIDs": {
          "description": "Eligible member IDs. Returned only when the caller can view attendance for all members.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "responses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EventResponse2"
          }
        },
        "voicePartOverrides": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EventVoicePartOverride"
          }
        }
      }
    },
    "OrganisationEventData": {
      "type": "object",
      "required": [
        "id",
        "title",
        "timezone"
      ],
      "properties": {
        "cancelledAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true
        },
        "cover": {
          "$ref": "#/definitions/EventCover"
        },
        "doorsOpenTime": {
          "description": "Local time when doors open for the event",
          "type": "string",
          "format": "time",
          "x-nullable": true
        },
        "endDate": {
          "type": "string",
          "format": "date",
          "x-nullable": true
        },
        "endTime": {
          "type": "string",
          "format": "time",
          "x-nullable": true
        },
        "eventRevision": {
          "description": "Revision token for coordinating event-derived previews and mutations.",
          "type": "string"
        },
        "hasRehearsal": {
          "description": "Whether a rehearsal is planned, including when its time is not yet known.",
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "location": {
          "$ref": "#/definitions/EventLocation"
        },
        "note": {
          "type": "string"
        },
        "onlineURL": {
          "description": "HTTPS link for joining the event online",
          "type": "string",
          "x-nullable": true
        },
        "programmeID": {
          "type": "string",
          "x-nullable": true
        },
        "rehearsalLocation": {
          "description": "Location used specifically for the rehearsal",
          "$ref": "#/definitions/EventLocation"
        },
        "rehearsalStartDate": {
          "type": "string",
          "format": "date",
          "x-nullable": true
        },
        "rehearsalStartTime": {
          "type": "string",
          "format": "time",
          "x-nullable": true
        },
        "startDate": {
          "type": "string",
          "format": "date",
          "x-nullable": true
        },
        "startTime": {
          "type": "string",
          "format": "time",
          "x-nullable": true
        },
        "ticketURL": {
          "type": "string",
          "x-nullable": true
        },
        "ticketing": {
          "$ref": "#/definitions/EventTicketingStatus"
        },
        "timezone": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "usergroupID": {
          "type": "string"
        },
        "visibleOnlyToUsergroup": {
          "type": "boolean"
        }
      }
    },
    "OrganisationEventPage": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationEvent2"
          }
        },
        "nextCursor": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "OrganisationInvitation": {
      "type": "object",
      "required": [
        "id",
        "email",
        "status",
        "createdAt",
        "createdBy",
        "lastSentAt",
        "sentCount"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "createdBy": {
          "$ref": "#/definitions/User"
        },
        "email": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "lastSentAt": {
          "type": "string",
          "format": "date-time"
        },
        "sentCount": {
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/OrganisationInviteStatus"
        }
      }
    },
    "OrganisationInvitePreview": {
      "type": "object",
      "required": [
        "organisation",
        "inviter"
      ],
      "properties": {
        "inviter": {
          "$ref": "#/definitions/OrganisationInvitePreviewInviter"
        },
        "organisation": {
          "$ref": "#/definitions/OrganisationSummary"
        }
      }
    },
    "OrganisationInvitePreviewInviter": {
      "type": "object",
      "required": [
        "given_name",
        "family_name"
      ],
      "properties": {
        "family_name": {
          "type": "string"
        },
        "given_name": {
          "type": "string"
        }
      }
    },
    "OrganisationInviteStatus": {
      "type": "string",
      "enum": [
        "pending",
        "accepted",
        "rejected"
      ]
    },
    "OrganisationJoinCode": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "description": "The current human-friendly reusable code. Returned only to authorised member inviters.",
          "type": "string",
          "pattern": "^[2-9A-HJ-NP-TV-Z]{4}-[2-9A-HJ-NP-TV-Z]{4}$"
        }
      }
    },
    "OrganisationJoinCodePreview": {
      "type": "object",
      "required": [
        "organisation"
      ],
      "properties": {
        "organisation": {
          "$ref": "#/definitions/OrganisationSummary"
        }
      }
    },
    "OrganisationLogoUploadRequest": {
      "type": "object",
      "required": [
        "filename",
        "contentMD5",
        "contentType",
        "sizeBytes"
      ],
      "properties": {
        "contentMD5": {
          "type": "string"
        },
        "contentType": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "sizeBytes": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "OrganisationMember": {
      "type": "object",
      "required": [
        "id",
        "given_name",
        "family_name",
        "role",
        "classification",
        "membership_type",
        "roleIDs",
        "membershipStatus",
        "membershipOrigin",
        "membershipVersion",
        "isOwner"
      ],
      "properties": {
        "classification": {
          "$ref": "#/definitions/MemberClassification"
        },
        "email": {
          "type": "string"
        },
        "family_name": {
          "type": "string"
        },
        "given_name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "image_url": {
          "type": "string",
          "x-nullable": true
        },
        "isOwner": {
          "type": "boolean"
        },
        "membershipOrigin": {
          "$ref": "#/definitions/MembershipOrigin"
        },
        "membershipStatus": {
          "$ref": "#/definitions/MembershipStatus"
        },
        "membershipVersion": {
          "type": "integer",
          "format": "int64"
        },
        "membership_type": {
          "$ref": "#/definitions/MembershipType"
        },
        "role": {
          "$ref": "#/definitions/OrganisationRole"
        },
        "roleIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "OrganisationRequestToJoin": {
      "type": "object",
      "required": [
        "id",
        "user"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      }
    },
    "OrganisationRole": {
      "type": "string",
      "enum": [
        "owner",
        "member"
      ]
    },
    "OrganisationRoleDefinition": {
      "type": "object",
      "required": [
        "id",
        "key",
        "name",
        "description",
        "kind",
        "permissions",
        "grantsAllPermissions",
        "protected",
        "assignable",
        "revision"
      ],
      "properties": {
        "assignable": {
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "grantsAllPermissions": {
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "built_in",
            "custom"
          ]
        },
        "name": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "protected": {
          "type": "boolean"
        },
        "revision": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "OrganisationSetupMembersState": {
      "type": "string",
      "enum": [
        "not_started",
        "pending",
        "complete"
      ]
    },
    "OrganisationSetupState": {
      "type": "string",
      "enum": [
        "ineligible",
        "in_progress",
        "complete"
      ]
    },
    "OrganisationSetupStatus": {
      "type": "object",
      "required": [
        "state",
        "members",
        "event",
        "memberActivity"
      ],
      "properties": {
        "event": {
          "$ref": "#/definitions/OrganisationSetupTaskState"
        },
        "memberActivity": {
          "$ref": "#/definitions/OrganisationSetupTaskState"
        },
        "members": {
          "$ref": "#/definitions/OrganisationSetupMembersState"
        },
        "state": {
          "$ref": "#/definitions/OrganisationSetupState"
        }
      }
    },
    "OrganisationSetupTaskState": {
      "type": "string",
      "enum": [
        "not_started",
        "complete"
      ]
    },
    "OrganisationStorage": {
      "type": "object",
      "required": [
        "usedBytes",
        "reservedBytes",
        "limitBytes",
        "remainingBytes",
        "fileCount",
        "categories"
      ],
      "properties": {
        "categories": {
          "$ref": "#/definitions/OrganisationStorageCategories"
        },
        "fileCount": {
          "type": "integer",
          "format": "int64"
        },
        "limitBytes": {
          "type": "integer",
          "format": "int64"
        },
        "remainingBytes": {
          "type": "integer",
          "format": "int64"
        },
        "reservedBytes": {
          "type": "integer",
          "format": "int64"
        },
        "usedBytes": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "OrganisationStorageCategories": {
      "type": "object",
      "required": [
        "documents",
        "musicAttachments",
        "eventAttachments",
        "unattributed"
      ],
      "properties": {
        "documents": {
          "$ref": "#/definitions/StorageCategoryUsage"
        },
        "eventAttachments": {
          "$ref": "#/definitions/StorageCategoryUsage"
        },
        "musicAttachments": {
          "$ref": "#/definitions/StorageCategoryUsage"
        },
        "unattributed": {
          "$ref": "#/definitions/StorageCategoryUsage"
        }
      }
    },
    "OrganisationSummary": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "OrganisationUsage": {
      "type": "object",
      "required": [
        "storage",
        "email"
      ],
      "properties": {
        "email": {
          "$ref": "#/definitions/OrganisationEmailEntitlements"
        },
        "storage": {
          "$ref": "#/definitions/OrganisationStorage"
        }
      }
    },
    "PingResponse": {
      "type": "object",
      "required": [
        "commitID"
      ],
      "properties": {
        "commitID": {
          "type": "string"
        }
      }
    },
    "PlanType": {
      "type": "string",
      "enum": [
        "pro"
      ]
    },
    "ProCurrencyPrice": {
      "type": "object",
      "required": [
        "currency",
        "amount",
        "amountDivisor",
        "taxBehavior",
        "quote"
      ],
      "properties": {
        "amount": {
          "description": "Amount in Stripe minor units.",
          "type": "integer",
          "format": "int64"
        },
        "amountDivisor": {
          "description": "Divide amount by this value for display in major currency units.",
          "type": "integer",
          "minimum": 1
        },
        "currency": {
          "type": "string",
          "pattern": "^[a-z]{3}$"
        },
        "quote": {
          "description": "Opaque fingerprint of this offer; pass unchanged to Checkout with the selected currency.",
          "type": "string"
        },
        "taxBehavior": {
          "type": "string",
          "enum": [
            "inclusive",
            "exclusive",
            "unspecified"
          ]
        }
      }
    },
    "ProPricing": {
      "type": "object",
      "required": [
        "defaultCurrency",
        "interval",
        "intervalCount",
        "currencies"
      ],
      "properties": {
        "currencies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProCurrencyPrice"
          }
        },
        "defaultCurrency": {
          "type": "string"
        },
        "interval": {
          "type": "string",
          "enum": [
            "day",
            "week",
            "month",
            "year"
          ]
        },
        "intervalCount": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "Programme": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "name",
        "draft"
      ],
      "properties": {
        "description": {
          "type": "string",
          "x-nullable": true
        },
        "draft": {
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        }
      }
    },
    "ProgrammePiece": {
      "type": "object",
      "required": [
        "programmePieceInstanceID",
        "programmeID",
        "position",
        "intervalAfter"
      ],
      "properties": {
        "arranger": {
          "description": "Music piece arranger (included for convenience, only for library pieces)",
          "type": "string",
          "x-nullable": true
        },
        "composer": {
          "description": "Music piece composer (included for convenience, only for library pieces)",
          "type": "string",
          "x-nullable": true
        },
        "customPart": {
          "description": "Custom part details (included for convenience, only for custom parts)",
          "x-nullable": true,
          "$ref": "#/definitions/CustomProgrammePart"
        },
        "customProgrammePartID": {
          "description": "ID of custom programme part (null if this is a library music piece)",
          "type": "string",
          "x-nullable": true
        },
        "durationMinutes": {
          "description": "Estimated performance time. For library pieces, the music library's duration takes precedence over any value stored on this programme item.",
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "intervalAfter": {
          "type": "boolean"
        },
        "musicPieceID": {
          "description": "ID of music piece from library (null if this is a custom part)",
          "type": "string",
          "x-nullable": true
        },
        "performanceNotes": {
          "type": "string",
          "x-nullable": true
        },
        "position": {
          "type": "integer",
          "format": "int64"
        },
        "programmeID": {
          "type": "string"
        },
        "programmePieceInstanceID": {
          "description": "Unique identifier for this specific instance of the piece in the programme",
          "type": "string"
        },
        "sectionID": {
          "type": "string",
          "x-nullable": true
        },
        "selectedAttachments": {
          "description": "Specific attachments selected for this programme piece instance (if none, show piece data only)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/MusicPieceAttachment"
          },
          "x-nullable": true
        },
        "title": {
          "description": "Music piece title (included for convenience, only for library pieces)",
          "type": "string"
        }
      }
    },
    "ProgrammePiecePosition": {
      "type": "object",
      "required": [
        "programmePieceInstanceID",
        "position"
      ],
      "properties": {
        "position": {
          "type": "integer",
          "format": "int64"
        },
        "programmePieceInstanceID": {
          "description": "Unique identifier for this specific piece instance",
          "type": "string"
        },
        "sectionID": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "ProgrammeSection": {
      "type": "object",
      "required": [
        "id",
        "programmeID",
        "name",
        "position"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "position": {
          "type": "integer",
          "format": "int64"
        },
        "programmeID": {
          "type": "string"
        }
      }
    },
    "PushInstallationRequest": {
      "type": "object",
      "required": [
        "token",
        "platform",
        "appVersion",
        "permission",
        "sequence"
      ],
      "properties": {
        "appVersion": {
          "type": "string",
          "maxLength": 100,
          "minLength": 1
        },
        "permission": {
          "type": "string",
          "enum": [
            "granted",
            "provisional",
            "denied",
            "undetermined"
          ]
        },
        "platform": {
          "type": "string",
          "enum": [
            "ios",
            "android"
          ]
        },
        "sequence": {
          "description": "Persisted installation operation counter, higher than every earlier registration or removal.",
          "type": "integer",
          "format": "int64",
          "maximum": 9007199254740991,
          "minimum": 1
        },
        "token": {
          "type": "string",
          "maxLength": 256,
          "minLength": 16,
          "pattern": "^(ExponentPushToken|ExpoPushToken)\\[[A-Za-z0-9_-]+\\]$"
        }
      }
    },
    "PushPreferences": {
      "type": "object",
      "required": [
        "preferences"
      ],
      "properties": {
        "preferences": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          }
        }
      }
    },
    "RemoveOrganisationMemberWarning": {
      "type": "object",
      "required": [
        "message",
        "isLastOwner"
      ],
      "properties": {
        "isLastOwner": {
          "description": "Indicates this is the last Admin",
          "type": "boolean"
        },
        "message": {
          "description": "Warning message about removing the last Admin",
          "type": "string"
        }
      }
    },
    "ReorderProgrammePiecesRequest": {
      "type": "object",
      "required": [
        "pieces"
      ],
      "properties": {
        "pieces": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProgrammePiecePosition"
          }
        }
      }
    },
    "RequestToJoinRequest": {
      "type": "object",
      "required": [
        "organisationID"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        }
      }
    },
    "RequestToJoinResponse": {
      "type": "string",
      "enum": [
        "accepted",
        "rejected"
      ]
    },
    "ReviewedMemberImportRow": {
      "type": "object",
      "required": [
        "rowNumber",
        "givenName",
        "familyName",
        "email",
        "excluded"
      ],
      "properties": {
        "email": {
          "type": "string",
          "maxLength": 320
        },
        "excluded": {
          "type": "boolean"
        },
        "familyName": {
          "type": "string",
          "maxLength": 200
        },
        "givenName": {
          "type": "string",
          "maxLength": 200
        },
        "rowNumber": {
          "type": "integer",
          "format": "int64"
        },
        "voicePartCode": {
          "type": "string",
          "maxLength": 50
        }
      }
    },
    "ScheduleEventEmailRequest": {
      "type": "object",
      "required": [
        "group",
        "subject",
        "message",
        "requestID",
        "recipientIDs",
        "eventRevision",
        "scheduledAt"
      ],
      "properties": {
        "eventRevision": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "group": {
          "$ref": "#/definitions/EventManualEmailRecipientGroup"
        },
        "includeCalendarAttachment": {
          "type": "boolean"
        },
        "includeResponseButtons": {
          "type": "boolean"
        },
        "message": {
          "description": "Plain text, or sanitised HTML when messageFormat is html. The visible text is limited to 10000 characters.",
          "type": "string",
          "maxLength": 50000,
          "minLength": 1
        },
        "messageFormat": {
          "$ref": "#/definitions/EventEmailMessageFormat"
        },
        "recipientIDs": {
          "type": "array",
          "maxItems": 100,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^usr_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
          }
        },
        "replyTo": {
          "$ref": "#/definitions/EventEmailReplyTo"
        },
        "requestID": {
          "type": "string",
          "maxLength": 100,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "scheduledAt": {
          "type": "string",
          "format": "date-time"
        },
        "subject": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "usergroupID": {
          "type": "string",
          "pattern": "^ugrp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
        }
      }
    },
    "ScheduledEventEmail": {
      "type": "object",
      "required": [
        "id",
        "eventID",
        "status",
        "scheduledAt",
        "group",
        "subject",
        "message",
        "messageFormat",
        "includeResponseButtons",
        "includeCalendarAttachment",
        "replyTo",
        "estimatedRecipientCount",
        "version",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "estimatedRecipientCount": {
          "type": "integer"
        },
        "eventID": {
          "type": "string"
        },
        "group": {
          "$ref": "#/definitions/EventManualEmailRecipientGroup"
        },
        "id": {
          "type": "string"
        },
        "includeCalendarAttachment": {
          "type": "boolean"
        },
        "includeResponseButtons": {
          "type": "boolean"
        },
        "lastError": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "messageFormat": {
          "$ref": "#/definitions/EventEmailMessageFormat"
        },
        "replyTo": {
          "$ref": "#/definitions/EventEmailReplyTo"
        },
        "scheduledAt": {
          "type": "string",
          "format": "date-time"
        },
        "sentAt": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "processing",
            "retrying",
            "sent",
            "failed"
          ]
        },
        "subject": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "usergroupID": {
          "type": "string"
        },
        "version": {
          "type": "integer"
        }
      }
    },
    "ScheduledEventEmailVersionRequest": {
      "type": "object",
      "required": [
        "version"
      ],
      "properties": {
        "version": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "SellerDetails": {
      "type": "object",
      "properties": {
        "brandColour": {
          "type": "string",
          "pattern": "^#[0-9a-fA-F]{6}$"
        },
        "displayName": {
          "type": "string",
          "maxLength": 200
        },
        "legalIdentity": {
          "$ref": "#/definitions/LegalIdentity"
        },
        "logoImage": {
          "type": "string",
          "maxLength": 7000
        },
        "supportEmail": {
          "type": "string",
          "maxLength": 254
        }
      }
    },
    "SendEventManualEmailRequest": {
      "type": "object",
      "required": [
        "group",
        "subject",
        "message",
        "requestID",
        "recipientIDs"
      ],
      "properties": {
        "eventRevision": {
          "description": "Event revision returned with the reviewed recipient preview.",
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "group": {
          "$ref": "#/definitions/EventManualEmailRecipientGroup"
        },
        "includeCalendarAttachment": {
          "description": "Attach an iCalendar file for this event when calendar details are available.",
          "type": "boolean"
        },
        "includeResponseButtons": {
          "description": "Include per-recipient RSVP buttons that work without signing in.",
          "type": "boolean"
        },
        "message": {
          "description": "Plain text, or sanitised HTML when messageFormat is html. The visible text is limited to 10000 characters.",
          "type": "string",
          "maxLength": 50000,
          "minLength": 1
        },
        "messageFormat": {
          "$ref": "#/definitions/EventEmailMessageFormat"
        },
        "recipientIDs": {
          "description": "User IDs from the reviewed recipient preview.",
          "type": "array",
          "maxItems": 100,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^usr_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
          }
        },
        "replyTo": {
          "$ref": "#/definitions/EventEmailReplyTo"
        },
        "requestID": {
          "description": "Unique ID for this send attempt. Reuse it when retrying the same send.",
          "type": "string",
          "maxLength": 100,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "subject": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "usergroupID": {
          "description": "Optionally restrict recipients to members of this organisation user group.",
          "type": "string",
          "minLength": 1,
          "pattern": "^ugrp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
        }
      }
    },
    "SetManualOrganisationPlanRequest": {
      "type": "object",
      "required": [
        "plan"
      ],
      "properties": {
        "expiresAt": {
          "description": "Optional expiry for a temporary manual grant. Must be in the future.",
          "type": "string",
          "format": "date-time"
        },
        "plan": {
          "type": "string",
          "enum": [
            "free",
            "pro"
          ]
        }
      }
    },
    "StorageCategoryUsage": {
      "type": "object",
      "required": [
        "usedBytes",
        "reservedBytes",
        "fileCount",
        "reservationCount"
      ],
      "properties": {
        "fileCount": {
          "type": "integer",
          "format": "int64"
        },
        "reservationCount": {
          "type": "integer",
          "format": "int64"
        },
        "reservedBytes": {
          "type": "integer",
          "format": "int64"
        },
        "usedBytes": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "StorageLimitExceeded": {
      "type": "object",
      "required": [
        "code",
        "usedBytes",
        "reservedBytes",
        "limitBytes",
        "requestedBytes",
        "remainingBytes"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "storage_limit_exceeded"
          ]
        },
        "limitBytes": {
          "type": "integer",
          "format": "int64"
        },
        "remainingBytes": {
          "type": "integer",
          "format": "int64"
        },
        "requestedBytes": {
          "type": "integer",
          "format": "int64"
        },
        "reservedBytes": {
          "type": "integer",
          "format": "int64"
        },
        "usedBytes": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "TicketOrder": {
      "type": "object",
      "required": [
        "id",
        "purchaserEmail",
        "items"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TicketOrderItem"
          }
        },
        "purchaserEmail": {
          "type": "string"
        }
      }
    },
    "TicketOrderItem": {
      "type": "object",
      "required": [
        "ticketTypeID",
        "quantity"
      ],
      "properties": {
        "quantity": {
          "type": "integer",
          "minimum": 1
        },
        "ticketTypeID": {
          "type": "string"
        }
      }
    },
    "TicketOrderUser": {
      "type": "object",
      "required": [
        "email",
        "given_name",
        "family_name"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "family_name": {
          "type": "string"
        },
        "given_name": {
          "type": "string"
        }
      }
    },
    "TicketType": {
      "type": "object",
      "required": [
        "id",
        "eventID",
        "name",
        "priceAmount",
        "currency",
        "quantitySold"
      ],
      "properties": {
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "description": {
          "type": "string"
        },
        "eventID": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "priceAmount": {
          "type": "integer"
        },
        "quantityAvailable": {
          "type": "integer",
          "x-nullable": true
        },
        "quantitySold": {
          "type": "integer"
        }
      }
    },
    "TicketingGrantRequest": {
      "type": "object",
      "properties": {
        "command": {
          "description": "Exact UTF-8 JSON bytes to POST unchanged to the dedicated commands endpoint. Omit to resolve association context.",
          "type": "string",
          "maxLength": 32768
        }
      }
    },
    "TicketingGrantResponse": {
      "type": "object",
      "properties": {
        "grant": {
          "description": "Sensitive subject-bound signed grant. Never log or cache.",
          "type": "string"
        },
        "saleId": {
          "type": "string"
        },
        "sellerId": {
          "type": "string"
        },
        "setupAvailable": {
          "type": "boolean"
        },
        "setupStatus": {
          "type": "string",
          "enum": [
            "unlinked",
            "pending",
            "linked",
            "disabled",
            "stale"
          ]
        },
        "sourceRevision": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "TicketingSetupDefaults": {
      "type": "object",
      "properties": {
        "brandColour": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "logoImage": {
          "type": "string"
        },
        "supportEmail": {
          "type": "string"
        }
      }
    },
    "TicketingSetupError": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "invalid_input",
            "logo_unsupported",
            "logo_unavailable",
            "setup_unavailable"
          ]
        }
      }
    },
    "TicketingSetupResponse": {
      "type": "object",
      "properties": {
        "defaults": {
          "$ref": "#/definitions/TicketingSetupDefaults"
        },
        "logoStatus": {
          "description": "Available is an uncopied choir suggestion. Copied or saved indicates durable setup branding. Unsupported and transient failures are distinguished by POST error codes.",
          "type": "string",
          "enum": [
            "available",
            "copied",
            "saved",
            "none"
          ]
        },
        "sellerStatus": {
          "type": "string",
          "enum": [
            "missing",
            "available",
            "disabled"
          ]
        },
        "setupStatus": {
          "type": "string",
          "enum": [
            "unlinked",
            "pending",
            "linked"
          ]
        }
      }
    },
    "UpdateCustomProgrammePartRequest": {
      "type": "object",
      "properties": {
        "description": {
          "description": "Optional description or details",
          "type": "string",
          "x-nullable": true
        },
        "intervalAfter": {
          "description": "Whether an interval follows this part",
          "type": "boolean",
          "x-nullable": true
        },
        "name": {
          "description": "Name of the custom part",
          "type": "string",
          "x-nullable": true
        },
        "performanceNotes": {
          "description": "Performance notes; an empty string clears the notes",
          "type": "string",
          "x-nullable": true
        },
        "performer": {
          "description": "Who is performing or presenting this part",
          "type": "string",
          "x-nullable": true
        },
        "sectionID": {
          "description": "Section containing this part; an empty string removes it from its section",
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "UpdateEmailPreferencesRequest": {
      "type": "object",
      "required": [
        "preferences"
      ],
      "properties": {
        "preferences": {
          "description": "Map of email type to enabled status (only optional types allowed)",
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          },
          "example": {
            "documents_added": true,
            "event_created": true,
            "event_reminder": false
          }
        }
      }
    },
    "UpdateEventPublicPageRequest": {
      "type": "object",
      "required": [
        "destination"
      ],
      "properties": {
        "clearExternalURLOverride": {
          "type": "boolean"
        },
        "destination": {
          "$ref": "#/definitions/EventPublicPageDestination"
        },
        "externalURLOverride": {
          "type": "string",
          "maxLength": 2048
        },
        "includeTicketLink": {
          "type": "boolean",
          "x-nullable": true
        },
        "publicDescription": {
          "type": "string",
          "maxLength": 20000
        }
      }
    },
    "UpdateEventTicketURLRequest": {
      "type": "object",
      "required": [
        "ticketURL"
      ],
      "properties": {
        "ticketURL": {
          "type": "string",
          "maxLength": 2048
        }
      }
    },
    "UpdateMemberClassificationRequest": {
      "type": "object",
      "required": [
        "classification",
        "expectedMembershipVersion"
      ],
      "properties": {
        "classification": {
          "$ref": "#/definitions/MemberClassification"
        },
        "expectedMembershipVersion": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        }
      }
    },
    "UpdateMemberRolesRequest": {
      "type": "object",
      "required": [
        "roleIDs",
        "expectedMembershipVersion"
      ],
      "properties": {
        "expectedMembershipVersion": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "roleIDs": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "UpdateOrganisationBillingContactRequest": {
      "type": "object",
      "required": [
        "userID"
      ],
      "properties": {
        "userID": {
          "type": "string",
          "pattern": "^usr_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
        }
      }
    },
    "UpdateOrganisationRequest": {
      "type": "object",
      "properties": {
        "attendanceReminder": {
          "description": "Omit to preserve the organisation's reminder configuration. Set enabled to false to disable reminders.",
          "$ref": "#/definitions/AttendanceReminder"
        },
        "brandColour": {
          "description": "Brand colour as a hex value (e.g. \"#1F4D8B\")",
          "type": "string"
        },
        "clearReplyEmail": {
          "description": "Removes the choir reply email address and any pending confirmation when true.",
          "type": "boolean"
        },
        "clearWebsiteURL": {
          "description": "Removes the organisation website URL when true.",
          "type": "boolean"
        },
        "isPublic": {
          "description": "Whether the organisation is listed in public search. Omit to preserve the current setting.",
          "type": "boolean",
          "x-nullable": true
        },
        "logoUpload": {
          "$ref": "#/definitions/OrganisationLogoUploadRequest"
        },
        "name": {
          "description": "The new name for the organisation",
          "type": "string"
        },
        "replyEmail": {
          "description": "Choir email address that receives member replies. It takes effect after the confirmation link sent to it is used.",
          "type": "string",
          "maxLength": 254
        },
        "timezone": {
          "description": "IANA timezone identifier (e.g., \"Europe/London\")",
          "type": "string",
          "maxLength": 255,
          "minLength": 1
        },
        "timezoneFromLocation": {
          "description": "If true, derive the timezone from the organisation's location using Google Timezone API",
          "type": "boolean"
        },
        "websiteURL": {
          "description": "Absolute public HTTPS website URL. Leading and trailing whitespace is ignored.",
          "type": "string",
          "maxLength": 2048
        }
      }
    },
    "UpdateOrganisationResponse": {
      "type": "object",
      "properties": {
        "logoUploadFields": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "logoUploadURL": {
          "description": "Presigned URL to upload the organisation logo when a logo upload is requested",
          "type": "string"
        }
      }
    },
    "UpdateOwnershipRequest": {
      "type": "object",
      "required": [
        "expectedMembershipVersion"
      ],
      "properties": {
        "expectedMembershipVersion": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        }
      }
    },
    "UpdateProgrammePieceRequest": {
      "type": "object",
      "properties": {
        "attachmentIDs": {
          "description": "Specific attachment IDs to include for this programme piece (if provided, replaces existing selection)",
          "type": "array",
          "items": {
            "type": "string"
          },
          "x-nullable": true
        },
        "durationMinutes": {
          "type": "integer",
          "format": "int64",
          "x-nullable": true
        },
        "intervalAfter": {
          "type": "boolean",
          "x-nullable": true
        },
        "performanceNotes": {
          "type": "string",
          "x-nullable": true
        },
        "sectionID": {
          "type": "string",
          "x-nullable": true
        }
      }
    },
    "UpdateProgrammeSectionRequest": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "New name for the section",
          "type": "string"
        }
      }
    },
    "UpdateScheduledEventEmailRequest": {
      "type": "object",
      "required": [
        "group",
        "subject",
        "message",
        "recipientIDs",
        "eventRevision",
        "scheduledAt",
        "version"
      ],
      "properties": {
        "eventRevision": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "group": {
          "$ref": "#/definitions/EventManualEmailRecipientGroup"
        },
        "includeCalendarAttachment": {
          "type": "boolean"
        },
        "includeResponseButtons": {
          "type": "boolean"
        },
        "message": {
          "description": "Plain text, or sanitised HTML when messageFormat is html. The visible text is limited to 10000 characters.",
          "type": "string",
          "maxLength": 50000,
          "minLength": 1
        },
        "messageFormat": {
          "$ref": "#/definitions/EventEmailMessageFormat"
        },
        "recipientIDs": {
          "type": "array",
          "maxItems": 100,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^usr_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
          }
        },
        "replyTo": {
          "$ref": "#/definitions/EventEmailReplyTo"
        },
        "scheduledAt": {
          "type": "string",
          "format": "date-time"
        },
        "subject": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "usergroupID": {
          "type": "string",
          "pattern": "^ugrp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
        },
        "version": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "UploadCloudLinkRequest": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "visibleToAdminsOnly": {
          "description": "If true, only organisation Admins can see the cloud document. Takes precedence over visibleToUsergroupIDs.",
          "type": "boolean"
        },
        "visibleToUsergroupIDs": {
          "description": "Usergroups the cloud document is restricted to. Empty means visible to all members.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "User": {
      "type": "object",
      "required": [
        "id",
        "given_name",
        "family_name",
        "email"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "family_name": {
          "type": "string"
        },
        "given_name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "preferencesGuideVersion": {
          "description": "Version of the preferences guide still to show. Omitted when no guide is pending.",
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "UserContactDetails": {
      "type": "object",
      "required": [
        "email"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "homeAddress": {
          "type": "string"
        },
        "phoneNumber": {
          "type": "string"
        }
      }
    },
    "UserEmailPreferences": {
      "type": "object",
      "required": [
        "preferences"
      ],
      "properties": {
        "preferences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EmailPreference"
          }
        }
      }
    },
    "UserEventResponse": {
      "type": "object",
      "required": [
        "userID",
        "givenName",
        "familyName",
        "voicePart",
        "voicePartCode",
        "classification",
        "response"
      ],
      "properties": {
        "classification": {
          "$ref": "#/definitions/MemberClassification"
        },
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "response": {
          "$ref": "#/definitions/EventResponse"
        },
        "userID": {
          "type": "string"
        },
        "voicePart": {
          "type": "string"
        },
        "voicePartCode": {
          "type": "string"
        }
      }
    },
    "UserOrganisationInvitation": {
      "type": "object",
      "required": [
        "invite",
        "organisation"
      ],
      "properties": {
        "invite": {
          "$ref": "#/definitions/OrganisationInvitation"
        },
        "organisation": {
          "$ref": "#/definitions/OrganisationSummary"
        }
      }
    },
    "UserRequestsToJoinOrganisation": {
      "type": "object",
      "required": [
        "id",
        "organisation"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "organisation": {
          "$ref": "#/definitions/OrganisationSummary"
        }
      }
    },
    "UserResponse": {
      "type": "object",
      "required": [
        "user",
        "organisations"
      ],
      "properties": {
        "organisations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OrganisationSummary"
          }
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      }
    },
    "Usergroup": {
      "type": "object",
      "required": [
        "id",
        "organisationID",
        "name",
        "memberUserIDs"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "memberUserIDs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "name": {
          "type": "string"
        },
        "organisationID": {
          "type": "string"
        }
      }
    },
    "VoicePart": {
      "type": "object",
      "required": [
        "name",
        "code"
      ],
      "properties": {
        "code": {
          "$ref": "#/definitions/VoicePartCode"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "VoicePartAttendance": {
      "type": "object",
      "required": [
        "voicePart",
        "count"
      ],
      "properties": {
        "count": {
          "type": "integer"
        },
        "voicePart": {
          "$ref": "#/definitions/VoicePart"
        }
      }
    },
    "VoicePartCode": {
      "type": "string"
    },
    "Voicing": {
      "type": "object",
      "required": [
        "id",
        "name",
        "isStandard",
        "voiceParts"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "isStandard": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "voiceParts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/VoicePart"
          }
        }
      }
    }
  },
  "parameters": {
    "header_eventRSVPAuthorization": {
      "type": "string",
      "description": "Opaque event RSVP capability using the format \"RSVP \u003ctoken\u003e\"",
      "name": "Authorization",
      "in": "header",
      "required": true
    },
    "path_attachmentID": {
      "pattern": "^mpa_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the attachment",
      "name": "attachmentID",
      "in": "path",
      "required": true
    },
    "path_directoryID": {
      "pattern": "^ddir_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the directory",
      "name": "directoryID",
      "in": "path",
      "required": true
    },
    "path_documentID": {
      "pattern": "^doc_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the document",
      "name": "documentID",
      "in": "path",
      "required": true
    },
    "path_eventAttachmentID": {
      "pattern": "^eva_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the event attachment",
      "name": "eventAttachmentID",
      "in": "path",
      "required": true
    },
    "path_eventEmailCampaignID": {
      "pattern": "^emc_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the scheduled event email campaign",
      "name": "campaignID",
      "in": "path",
      "required": true
    },
    "path_eventID": {
      "pattern": "^evt_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the event",
      "name": "eventID",
      "in": "path",
      "required": true
    },
    "path_exportID": {
      "pattern": "^exp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the archive export",
      "name": "exportID",
      "in": "path",
      "required": true
    },
    "path_exportPartID": {
      "pattern": "^part-[0-9]{3,}$",
      "type": "string",
      "description": "ID of an archive export part",
      "name": "partID",
      "in": "path",
      "required": true
    },
    "path_inviteID": {
      "pattern": "^oinv_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the invite",
      "name": "inviteID",
      "in": "path",
      "required": true
    },
    "path_memberImportID": {
      "pattern": "^mimp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the temporary member import",
      "name": "importID",
      "in": "path",
      "required": true
    },
    "path_musicPieceID": {
      "pattern": "^mus_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the music piece",
      "name": "musicPieceID",
      "in": "path",
      "required": true
    },
    "path_orgID": {
      "pattern": "^org_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the organisation",
      "name": "organisationID",
      "in": "path",
      "required": true
    },
    "path_programmeID": {
      "pattern": "^prg_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the programme",
      "name": "programmeID",
      "in": "path",
      "required": true
    },
    "path_programmeSectionID": {
      "pattern": "^psec_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the programme section",
      "name": "programmeSectionID",
      "in": "path",
      "required": true
    },
    "path_requestID": {
      "pattern": "^jor_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the request",
      "name": "requestID",
      "in": "path",
      "required": true
    },
    "path_ticketTypeID": {
      "pattern": "^ttyp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the ticket type",
      "name": "ticketTypeID",
      "in": "path",
      "required": true
    },
    "path_userID": {
      "pattern": "^usr_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the user",
      "name": "userID",
      "in": "path",
      "required": true
    },
    "path_usergroupID": {
      "pattern": "^ugrp_(test_)?([a-zA-Z0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$",
      "type": "string",
      "description": "ID of the user group",
      "name": "usergroupID",
      "in": "path",
      "required": true
    }
  },
  "responses": {
    "TierUpgradeRequired": {
      "description": "Your current plan does not support this action. Please upgrade to the Pro tier.",
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "tier_upgrade_required"
          },
          "message": {
            "type": "string",
            "example": "Your current plan does not support this action. Please upgrade to the Pro tier."
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "clerk": {
      "description": "Auth JWT",
      "type": "oauth2",
      "flow": "accessCode",
      "authorizationUrl": "http://example.com/dummy",
      "tokenUrl": "http://example.com/dummy",
      "scopes": {
        "usr": "User"
      }
    }
  }
}