{
  "openapi": "3.0.0",
  "components": {
    "schemas": {
      "Organisation": {
        "type": "object",
        "required": [
          "org_id",
          "name"
        ],
        "properties": {
          "org_id": {
            "type": "string",
            "description": "Unique identifier for an organisation on your end",
            "example": "org_12345"
          },
          "name": {
            "type": "string",
            "description": "Organisation name",
            "example": "Example Org"
          }
        }
      },
      "Facility": {
        "type": "object",
        "required": [
          "org_id",
          "name",
          "timezone"
        ],
        "properties": {
          "facility_id": {
            "type": "string",
            "description": "Unique identifier for a facility on your end",
            "example": "facility_67890"
          },
          "org_id": {
            "type": "string",
            "description": "Unique identifier for an organisation where the facility belongs to",
            "example": "org_12345"
          },
          "name": {
            "type": "string",
            "description": "Facility name",
            "example": "ExampleBrand Melbourne Central"
          },
          "brand": {
            "type": "string",
            "description": "The brand name used by the facility",
            "example": "ExampleBrand"
          },
          "website_url": {
            "type": "string",
            "description": "Facility website URL",
            "example": "https://examplebrand.com.au/melbourne-central"
          },
          "timezone": {
            "type": "string",
            "description": "Time zone in IANA format, e.g. \"America/New_York\"",
            "example": "Australia/Melbourne"
          },
          "social_links": {
            "type": "object",
            "description": "See Social Links structure",
            "example": {
              "instagram": {
                "handle": "@examplebrand_melbourne"
              },
              "facebook": {
                "handle": "ExampleBrand Melbourne"
              },
              "youtube": {
                "handle": "@examplebrandmelbourne"
              },
              "tiktok": {
                "handle": "@examplebrand_melbourne"
              },
              "linkedin": {
                "handle": "ExampleBrand Melbourne"
              }
            },
            "properties": {
              "instagram": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "Instagram account handle"
                  }
                }
              },
              "facebook": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "Facebook account handle"
                  }
                }
              },
              "youtube": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "YouTube channel handle"
                  }
                }
              },
              "tiktok": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "TikTok account handle"
                  }
                }
              },
              "linkedin": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "LinkedIn page handle"
                  }
                }
              }
            }
          },
          "place_data": {
            "type": "object",
            "description": "Location data from Google Places API",
            "example": {
              "address_1": "15 Brook Street",
              "address_2": "Kingston Upon Thames",
              "city": {
                "full_name": "Greater London",
                "short_name": "Greater London"
              },
              "country": {
                "en_full_name": "United Kingdom",
                "full_name": "United Kingdom",
                "iso_code": "GB"
              },
              "formatted_address": "15 Brook Street, Kingston Upon Thames",
              "google_place_id": "EihBc2hkb3duIFJkLCBLaW5nc3RvbiB1cG9uIFRoYW1lcyBLVDEsIFVLIi4qLAoUChIJ5XqBMMALdkgRbwQ2ree4VcgSFAoSCT3_FXzmC3ZIETWtjqonXJ7S",
              "isManual": true,
              "postcode": "KT1 2EY",
              "province": {
                "abbreviation": "England",
                "full_name": "England"
              }
            },
            "properties": {
              "address_1": {
                "type": "string",
                "description": "Primary street address"
              },
              "address_2": {
                "type": "string",
                "description": "Secondary address information"
              },
              "city": {
                "type": "object",
                "properties": {
                  "full_name": {
                    "type": "string",
                    "description": "Full city/locality name"
                  },
                  "short_name": {
                    "type": "string",
                    "description": "Short city/locality name"
                  }
                }
              },
              "country": {
                "type": "object",
                "properties": {
                  "en_full_name": {
                    "type": "string",
                    "description": "Country name in English"
                  },
                  "full_name": {
                    "type": "string",
                    "description": "Full country name"
                  },
                  "iso_code": {
                    "type": "string",
                    "description": "ISO 3166-1 alpha-2 country code"
                  }
                }
              },
              "formatted_address": {
                "type": "string",
                "description": "Full formatted address from Google Places"
              },
              "google_place_id": {
                "type": "string",
                "description": "Google Place ID for the location"
              },
              "isManual": {
                "type": "boolean",
                "description": "Whether the address was manually entered"
              },
              "postcode": {
                "type": "string",
                "description": "Postal code or ZIP code"
              },
              "province": {
                "type": "object",
                "properties": {
                  "abbreviation": {
                    "type": "string",
                    "description": "Province/state abbreviation"
                  },
                  "full_name": {
                    "type": "string",
                    "description": "Full province/state name"
                  }
                }
              }
            }
          }
        }
      },
      "Member": {
        "type": "object",
        "required": [
          "member_id",
          "first_name",
          "last_name"
        ],
        "properties": {
          "member_id": {
            "type": "string",
            "description": "Unique identifier of a member",
            "example": "member_11111"
          },
          "facility_id": {
            "type": "string",
            "description": "Unique identifier for a facility",
            "example": "facility_67890"
          },
          "linking_identifier": {
            "type": "string",
            "description": "Required for linking identifier type integration for facility resolution",
            "example": "branch_downtown"
          },
          "first_name": {
            "type": "string",
            "description": "First name",
            "example": "John"
          },
          "last_name": {
            "type": "string",
            "description": "Last name",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "john.smith@email.com"
          },
          "mobile_phone": {
            "type": "string",
            "description": "Mobile phone number in E.123 format (e.g. +1 415 555 2671)",
            "example": "+61 412 345 678"
          },
          "date_of_birth": {
            "type": "string",
            "description": "Date of birth in YYYY-MM-DD format",
            "example": "1985-06-15"
          },
          "gender": {
            "type": "string",
            "description": "One of: male | female | non_binary | prefer_not_to_say | unknown",
            "example": "male"
          },
          "type": {
            "type": "string",
            "description": "Member type (e.g. staff, member, prospect)",
            "example": "member"
          },
          "tags": {
            "type": "array",
            "description": "Quick helper strings or texts to categorise and identify specific members",
            "example": [
              "vip",
              "personal-training",
              "student"
            ],
            "items": {
              "type": "string"
            }
          },
          "profile_picture": {
            "type": "string",
            "description": "Image Base64 string",
            "example": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..."
          },
          "membership_status": {
            "type": "string",
            "description": "Latest membership status (e.g. current, expired, on hold)",
            "example": "current"
          },
          "access_time_windows_revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Monotonically increasing JSON safe integer for this partner/member snapshot stream. Required whenever access_time_windows is present. Reusing a revision is idempotent only when the normalized complete snapshot is unchanged.",
            "example": 1737417600000
          },
          "access_time_windows": {
            "type": "array",
            "maxItems": 50,
            "description": "Complete vendor-neutral Access Time Windows snapshot. Omit this field to preserve the stored snapshot; send [] with a newer revision to clear it. A newer revision replaces all windows, an older revision is skipped as stale, and the same revision with different normalized content conflicts. Window bounds are half-open. Payloads cannot contain Performance Hub facility, door, or Access Scope IDs.",
            "example": [
              {
                "external_id": "event_2026_09_10",
                "kind": "absolute",
                "from": 1788976800,
                "to": 1788984000,
                "timezone": "Australia/Melbourne",
                "scope_key": "main_entry",
                "label": "Evening access"
              },
              {
                "external_id": "weekly_mornings",
                "kind": "weekly",
                "timezone": "America/New_York",
                "access_hours": {
                  "sun": [],
                  "mon": [
                    [
                      "06:00",
                      "08:00"
                    ]
                  ],
                  "tue": [
                    [
                      "06:00",
                      "08:00"
                    ]
                  ],
                  "wed": [
                    [
                      "06:00",
                      "08:00"
                    ]
                  ],
                  "thu": [
                    [
                      "06:00",
                      "08:00"
                    ]
                  ],
                  "fri": [
                    [
                      "06:00",
                      "08:00"
                    ]
                  ],
                  "sat": []
                },
                "active_from": 1788211200,
                "active_until": 1790812800,
                "scope_key": "default",
                "label": "Weekday mornings"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "external_id",
                "kind"
              ],
              "additionalProperties": false,
              "properties": {
                "external_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120,
                  "description": "Stable identifier unique within this member snapshot"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "absolute",
                    "weekly"
                  ]
                },
                "from": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9999999999,
                  "description": "Absolute-window start as integer Unix seconds; inclusive"
                },
                "to": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9999999999,
                  "description": "Absolute-window end as integer Unix seconds; exclusive"
                },
                "timezone": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120,
                  "default": "UTC",
                  "description": "Valid IANA timezone. Defaults to UTC. For absolute windows this is display/audit metadata only; for weekly windows it defines wall-clock and DST behavior."
                },
                "access_hours": {
                  "type": "object",
                  "required": [
                    "sun",
                    "mon",
                    "tue",
                    "wed",
                    "thu",
                    "fri",
                    "sat"
                  ],
                  "additionalProperties": false,
                  "description": "Weekly wall-clock blocks. Each [from, to] pair is half-open, must use strict zero-padded HH:mm, cannot overlap, and cannot run overnight. Use 24:00 only as an end value when splitting an overnight interval across two days.",
                  "properties": {
                    "sun": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    },
                    "mon": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    },
                    "tue": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    },
                    "wed": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    },
                    "thu": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    },
                    "fri": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    },
                    "sat": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                        }
                      }
                    }
                  }
                },
                "active_from": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9999999999,
                  "description": "Optional inclusive weekly validity bound as integer Unix seconds"
                },
                "active_until": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9999999999,
                  "description": "Optional exclusive weekly validity bound as integer Unix seconds"
                },
                "scope_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120,
                  "default": "default",
                  "description": "Stable partner-defined logical scope mapped by a facility administrator"
                },
                "label": {
                  "type": "string",
                  "maxLength": 120,
                  "description": "Optional human-readable label"
                }
              },
              "oneOf": [
                {
                  "title": "Absolute Access Time Window",
                  "required": [
                    "from",
                    "to"
                  ]
                },
                {
                  "title": "Weekly Access Time Window",
                  "required": [
                    "access_hours"
                  ]
                }
              ]
            }
          },
          "created": {
            "type": "string",
            "description": "Timestamp (ISO 8601)",
            "example": "2024-01-15T10:30:00Z"
          },
          "updated": {
            "type": "string",
            "description": "Timestamp (ISO 8601)",
            "example": "2024-01-20T14:45:00Z"
          },
          "address": {
            "type": "object",
            "description": "Optional physical address. Intentionally not strictly validated — if the object is malformed (wrong value types, unexpected fields, or values that do not match the documented shape) every provided value is collapsed into address_line_1 so no data is lost. Expected fields: address_line_1, address_line_2 (optional), city, state, postal_code, country (ISO 3166-1 alpha-2, e.g. \"AU\", \"US\"), country_name (optional).",
            "example": {
              "address_line_1": "456 Bourke Street",
              "address_line_2": "Apt 12",
              "city": "Melbourne",
              "state": "VIC",
              "postal_code": "3000",
              "country": "AU",
              "country_name": "Australia"
            }
          },
          "membership_plans": {
            "type": "array",
            "description": "Array of all plans the member has enrolled in; one marked active",
            "example": [
              {
                "membership_plan_id": "plan_99999",
                "name": "Unlimited Monthly",
                "start_date": "2024-01-01T00:00:00Z",
                "status": "current",
                "is_current": true,
                "end_date": null
              },
              {
                "membership_plan_id": "plan_88888",
                "name": "10 Class Pack",
                "start_date": "2023-11-01T00:00:00Z",
                "end_date": "2023-12-31T23:59:59Z",
                "status": "expired",
                "is_current": false
              }
            ],
            "items": {
              "type": "object",
              "properties": {
                "membership_plan_id": {
                  "type": "string",
                  "description": "Unique identifier of the membership plan"
                },
                "name": {
                  "type": "string",
                  "description": "Membership plan name"
                },
                "start_date": {
                  "type": "string",
                  "description": "Start date timestamp (ISO 8601)",
                  "nullable": true
                },
                "end_date": {
                  "type": "string",
                  "description": "End date timestamp (ISO 8601) or null for ongoing",
                  "nullable": true
                },
                "status": {
                  "type": "string",
                  "description": "Plan status (e.g. current, expired, cancelled, on hold)"
                },
                "is_current": {
                  "type": "boolean",
                  "description": "Boolean flag indicating the active plan"
                }
              }
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "access_time_windows",
              "access_time_windows_revision"
            ]
          },
          {
            "not": {
              "required": [
                "access_time_windows"
              ]
            }
          }
        ]
      },
      "MembershipPlan": {
        "type": "object",
        "required": [
          "membership_plan_id",
          "name"
        ],
        "properties": {
          "membership_plan_id": {
            "type": "string",
            "description": "Unique identifier of a membership plan",
            "example": "plan_99999"
          },
          "facility_id": {
            "type": "string",
            "description": "Unique identifier for a facility",
            "example": "facility_67890"
          },
          "linking_identifier": {
            "type": "string",
            "description": "Required for linking identifier type integration for facility resolution",
            "example": "branch_downtown"
          },
          "name": {
            "type": "string",
            "description": "Human-readable label (e.g. Unlimited Monthly, 10 Class Pack)",
            "example": "Unlimited Monthly"
          },
          "description": {
            "type": "string",
            "description": "Optional marketing or internal description",
            "example": "Unlimited access to all gym facilities and group classes"
          },
          "billing_cycle": {
            "type": "string",
            "description": "One of: weekly | fortnightly | monthly | annually | one_time",
            "example": "monthly"
          },
          "price": {
            "type": "integer",
            "description": "Base cost",
            "example": 8900
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217), e.g. AUD, USD",
            "example": "AUD"
          },
          "class_limit": {
            "type": "integer",
            "description": "Number of classes allowed (e.g. 10 for packs, null for unlimited)",
            "example": null
          },
          "duration_days": {
            "type": "integer",
            "description": "Validity in days (e.g. 30, 90). Optional for recurring",
            "example": 30
          },
          "is_recurring": {
            "type": "boolean",
            "description": "Whether the plan auto-renews",
            "example": true
          },
          "is_trial": {
            "type": "boolean",
            "description": "Whether this is a trial offering",
            "example": false
          },
          "visible_to_public": {
            "type": "boolean",
            "description": "Whether available for self-service purchase",
            "example": true
          },
          "active_members": {
            "type": "integer",
            "description": "Number of active members with this membership",
            "example": 245
          },
          "access_zones": {
            "type": "array",
            "example": [
              {
                "name": "Main Gym Floor",
                "description": "Full access to cardio and weight training equipment",
                "access_hours": {
                  "mon": [
                    [
                      "05:00",
                      "22:00"
                    ]
                  ],
                  "tue": [
                    [
                      "05:00",
                      "22:00"
                    ]
                  ],
                  "wed": [
                    [
                      "05:00",
                      "22:00"
                    ]
                  ],
                  "thu": [
                    [
                      "05:00",
                      "22:00"
                    ]
                  ],
                  "fri": [
                    [
                      "05:00",
                      "22:00"
                    ]
                  ],
                  "sat": [
                    [
                      "06:00",
                      "20:00"
                    ]
                  ],
                  "sun": [
                    [
                      "07:00",
                      "18:00"
                    ]
                  ]
                }
              },
              {
                "name": "Group Fitness Studio",
                "description": "Access to group fitness classes",
                "access_hours": {
                  "mon": [],
                  "tue": [],
                  "wed": [],
                  "thu": [],
                  "fri": [],
                  "sat": [
                    [
                      "06:00",
                      "20:00"
                    ]
                  ],
                  "sun": [
                    [
                      "07:00",
                      "18:00"
                    ]
                  ]
                }
              }
            ],
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the access zone"
                },
                "description": {
                  "type": "string",
                  "description": "Description of the access zone"
                },
                "access_hours": {
                  "type": "object",
                  "description": "Access hours for this zone. Each day is an array of time ranges in HH:MM format. Empty array means no access.",
                  "properties": {
                    "mon": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Monday (e.g. [[\"04:00\",\"12:00\"]])"
                    },
                    "tue": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Tuesday"
                    },
                    "wed": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Wednesday"
                    },
                    "thu": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Thursday"
                    },
                    "fri": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Friday"
                    },
                    "sat": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Saturday"
                    },
                    "sun": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": "Array of time ranges allowed on Sunday"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "CheckIn": {
        "type": "object",
        "required": [
          "member_id",
          "timestamp"
        ],
        "properties": {
          "check_in_id": {
            "type": "string",
            "description": "Unique identifier of the check-in (if applicable)",
            "example": "checkin_22222"
          },
          "member_id": {
            "type": "string",
            "description": "Unique identifier of a member",
            "example": "member_11111"
          },
          "facility_id": {
            "type": "string",
            "description": "Unique identifier for a facility",
            "example": "facility_67890"
          },
          "linking_identifier": {
            "type": "string",
            "description": "Required for linking identifier type integration for facility resolution",
            "example": "branch_downtown"
          },
          "check_in_type": {
            "type": "string",
            "description": "Type of check-in (e.g. member, class, staff, guest, trial)",
            "example": "member"
          },
          "source": {
            "type": "string",
            "description": "Source of check-in (e.g. manual, tag, rfid, kiosk, app)",
            "example": "app"
          },
          "class_id": {
            "type": "string",
            "description": "Class booking/attendance identifier if applicable",
            "example": "class_33333"
          },
          "timestamp": {
            "type": "string",
            "description": "Timestamp (ISO 8601)",
            "example": "2024-01-20T08:30:00Z"
          }
        }
      },
      "Door": {
        "type": "object",
        "properties": {
          "door_id": {
            "type": "string",
            "description": "Door/Gate Controller identifier used for unlock requests",
            "example": "577393ce6ec584aa4e2e2b1d1e73934c"
          },
          "facility_id": {
            "type": "string",
            "description": "Performance Hub facility ID",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "linking_identifier": {
            "type": "string",
            "description": "Partner facility identifier when configured",
            "example": "branch_downtown"
          },
          "name": {
            "type": "string",
            "description": "Door/Gate Controller display name",
            "example": "Front Door"
          },
          "zone": {
            "type": "string",
            "description": "Door zone or location label",
            "example": "Entrance"
          },
          "location": {
            "type": "string",
            "description": "Door location label",
            "example": "Entrance"
          },
          "status": {
            "type": "string",
            "description": "Door controller connectivity status",
            "enum": [
              "online",
              "offline"
            ],
            "example": "online"
          },
          "online": {
            "type": "boolean",
            "description": "Whether the door controller is currently online",
            "example": true
          },
          "relay_state": {
            "type": "string",
            "description": "Latest relay state",
            "enum": [
              "locked",
              "unlocked",
              "unknown"
            ],
            "example": "locked"
          },
          "maintenance_mode": {
            "type": "string",
            "description": "Current maintenance override mode",
            "enum": [
              "off",
              "force-open",
              "force-closed"
            ],
            "example": "off"
          },
          "hold_time_seconds": {
            "type": "integer",
            "description": "Default unlock hold time",
            "example": 10
          },
          "last_seen": {
            "type": "string",
            "description": "Last metadata beacon timestamp",
            "example": "2026-05-01T04:30:00.000Z"
          },
          "device_serial_number": {
            "type": "string",
            "description": "Physical device serial number",
            "example": "10000000d6bac67a"
          }
        }
      },
      "DoorUnlockRequest": {
        "type": "object",
        "required": [
          "member_id",
          "first_name",
          "last_name"
        ],
        "properties": {
          "facility_id": {
            "type": "string",
            "description": "Performance Hub facility ID. Required unless using linking_identifier.",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "linking_identifier": {
            "type": "string",
            "description": "Partner facility identifier. Required unless using facility_id.",
            "example": "branch_downtown"
          },
          "member_id": {
            "type": "string",
            "description": "Partner member ID for audit/linking",
            "example": "member_11111"
          },
          "first_name": {
            "type": "string",
            "description": "First name of the person being granted access",
            "example": "Jane"
          },
          "last_name": {
            "type": "string",
            "description": "Last name of the person being granted access",
            "example": "Smith"
          },
          "full_name": {
            "type": "string",
            "description": "Optional full name. If omitted, first and last name are joined.",
            "example": "Jane Smith"
          },
          "check_in_id": {
            "type": "string",
            "description": "Optional partner check-in ID to correlate with this unlock.",
            "example": "checkin_abc123"
          },
          "source": {
            "type": "string",
            "description": "Source of the unlock request",
            "example": "door_reader"
          },
          "idempotency_key": {
            "type": "string",
            "description": "Optional replay protection key for this partner/facility/door action",
            "example": "unlock_20260501_0001"
          },
          "metadata": {
            "type": "object",
            "description": "Optional partner metadata for audit/debugging"
          }
        }
      },
      "LambdaSuccessResponse": {
        "type": "object"
      },
      "LambdaGet": {
        "type": "object"
      },
      "LambdaErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false,
            "description": "True/False response from API"
          },
          "error": {
            "type": "object",
            "description": "Description (or object) of the error response from Lambda"
          }
        }
      },
      "PingResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Success message confirming authentication",
            "example": "You are successfully authorised"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message describing what went wrong",
            "example": "Invalid secret key"
          },
          "message": {
            "type": "string",
            "description": "Additional error details (optional)",
            "example": "The provided secret key is not valid or has expired"
          }
        }
      },
      "FacilityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "Array of facility objects",
            "items": {
              "type": "object",
              "properties": {
                "facility_id": {
                  "type": "string",
                  "description": "Unique facility identifier",
                  "example": "facility_12345"
                },
                "name": {
                  "type": "string",
                  "description": "Facility name",
                  "example": "ExampleBrand Melbourne Central"
                },
                "brand": {
                  "type": "string",
                  "description": "Brand name",
                  "example": "ExampleBrand"
                },
                "latitude": {
                  "type": "number",
                  "description": "Latitude coordinate",
                  "example": -37.8136
                },
                "longitude": {
                  "type": "number",
                  "description": "Longitude coordinate",
                  "example": 144.9631
                },
                "place_data": {
                  "type": "object",
                  "description": "Additional location data"
                }
              }
            }
          }
        }
      },
      "DoorListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "door_id": {
                  "type": "string",
                  "description": "Door/Gate Controller identifier used for unlock requests",
                  "example": "577393ce6ec584aa4e2e2b1d1e73934c"
                },
                "facility_id": {
                  "type": "string",
                  "description": "Performance Hub facility ID",
                  "example": "550e8400-e29b-41d4-a716-446655440000"
                },
                "linking_identifier": {
                  "type": "string",
                  "description": "Partner facility identifier when configured",
                  "example": "branch_downtown"
                },
                "name": {
                  "type": "string",
                  "description": "Door/Gate Controller display name",
                  "example": "Front Door"
                },
                "zone": {
                  "type": "string",
                  "description": "Door zone or location label",
                  "example": "Entrance"
                },
                "location": {
                  "type": "string",
                  "description": "Door location label",
                  "example": "Entrance"
                },
                "status": {
                  "type": "string",
                  "description": "Door controller connectivity status",
                  "enum": [
                    "online",
                    "offline"
                  ],
                  "example": "online"
                },
                "online": {
                  "type": "boolean",
                  "description": "Whether the door controller is currently online",
                  "example": true
                },
                "relay_state": {
                  "type": "string",
                  "description": "Latest relay state",
                  "enum": [
                    "locked",
                    "unlocked",
                    "unknown"
                  ],
                  "example": "locked"
                },
                "maintenance_mode": {
                  "type": "string",
                  "description": "Current maintenance override mode",
                  "enum": [
                    "off",
                    "force-open",
                    "force-closed"
                  ],
                  "example": "off"
                },
                "hold_time_seconds": {
                  "type": "integer",
                  "description": "Default unlock hold time",
                  "example": 10
                },
                "last_seen": {
                  "type": "string",
                  "description": "Last metadata beacon timestamp",
                  "example": "2026-05-01T04:30:00.000Z"
                },
                "device_serial_number": {
                  "type": "string",
                  "description": "Physical device serial number",
                  "example": "10000000d6bac67a"
                }
              }
            }
          }
        }
      },
      "DoorResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "door_id": {
                "type": "string",
                "description": "Door/Gate Controller identifier used for unlock requests",
                "example": "577393ce6ec584aa4e2e2b1d1e73934c"
              },
              "facility_id": {
                "type": "string",
                "description": "Performance Hub facility ID",
                "example": "550e8400-e29b-41d4-a716-446655440000"
              },
              "linking_identifier": {
                "type": "string",
                "description": "Partner facility identifier when configured",
                "example": "branch_downtown"
              },
              "name": {
                "type": "string",
                "description": "Door/Gate Controller display name",
                "example": "Front Door"
              },
              "zone": {
                "type": "string",
                "description": "Door zone or location label",
                "example": "Entrance"
              },
              "location": {
                "type": "string",
                "description": "Door location label",
                "example": "Entrance"
              },
              "status": {
                "type": "string",
                "description": "Door controller connectivity status",
                "enum": [
                  "online",
                  "offline"
                ],
                "example": "online"
              },
              "online": {
                "type": "boolean",
                "description": "Whether the door controller is currently online",
                "example": true
              },
              "relay_state": {
                "type": "string",
                "description": "Latest relay state",
                "enum": [
                  "locked",
                  "unlocked",
                  "unknown"
                ],
                "example": "locked"
              },
              "maintenance_mode": {
                "type": "string",
                "description": "Current maintenance override mode",
                "enum": [
                  "off",
                  "force-open",
                  "force-closed"
                ],
                "example": "off"
              },
              "hold_time_seconds": {
                "type": "integer",
                "description": "Default unlock hold time",
                "example": 10
              },
              "last_seen": {
                "type": "string",
                "description": "Last metadata beacon timestamp",
                "example": "2026-05-01T04:30:00.000Z"
              },
              "device_serial_number": {
                "type": "string",
                "description": "Physical device serial number",
                "example": "10000000d6bac67a"
              }
            }
          }
        }
      },
      "DoorUnlockSuccessResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "unlocked"
          },
          "door_id": {
            "type": "string",
            "example": "577393ce6ec584aa4e2e2b1d1e73934c"
          },
          "facility_id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "event_id": {
            "type": "string",
            "example": "2d98e9ff-3a2a-46d4-a22f-5f23f7d75b11"
          },
          "command_id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "hold_time_seconds": {
            "type": "integer",
            "example": 10
          },
          "confirmed_at": {
            "type": "string",
            "example": "2026-05-01T04:30:00.000Z"
          }
        }
      },
      "DoorUnlockFailureResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "failed"
          },
          "reason": {
            "type": "string",
            "example": "device_offline"
          },
          "door_id": {
            "type": "string",
            "example": "577393ce6ec584aa4e2e2b1d1e73934c"
          },
          "facility_id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "event_id": {
            "type": "string",
            "example": "2d98e9ff-3a2a-46d4-a22f-5f23f7d75b11"
          }
        }
      },
      "OrganisationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "Array of organisation objects",
            "items": {
              "type": "object",
              "required": [
                "org_id",
                "name"
              ],
              "properties": {
                "org_id": {
                  "type": "string",
                  "description": "Unique organisation identifier",
                  "example": "97a1442e-af14-4746-96d9-7a7c90a72d49"
                },
                "name": {
                  "type": "string",
                  "description": "Organisation name",
                  "example": "FitLife Fitness Group"
                }
              }
            }
          }
        }
      },
      "PostMembersRequest": {
        "type": "object",
        "required": [
          "members"
        ],
        "example": {
          "members": [
            {
              "member_id": "member_11111",
              "facility_id": "facility_67890",
              "first_name": "John",
              "last_name": "Smith",
              "email": "john.smith@email.com",
              "mobile_phone": "+61 412 345 678",
              "date_of_birth": "1985-06-15",
              "gender": "male",
              "type": "member",
              "tags": [
                "vip",
                "personal-training"
              ],
              "profile_picture": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...",
              "membership_status": "current",
              "created": "2024-01-15T10:30:00Z",
              "updated": "2024-01-20T14:45:00Z",
              "access_time_windows_revision": 1737417600000,
              "access_time_windows": [
                {
                  "external_id": "event_2026_09_10",
                  "kind": "absolute",
                  "from": 1788976800,
                  "to": 1788984000,
                  "timezone": "Australia/Melbourne",
                  "scope_key": "main_entry",
                  "label": "Evening access"
                },
                {
                  "external_id": "weekly_mornings",
                  "kind": "weekly",
                  "timezone": "America/New_York",
                  "access_hours": {
                    "sun": [],
                    "mon": [
                      [
                        "06:00",
                        "08:00"
                      ]
                    ],
                    "tue": [
                      [
                        "06:00",
                        "08:00"
                      ]
                    ],
                    "wed": [
                      [
                        "06:00",
                        "08:00"
                      ]
                    ],
                    "thu": [
                      [
                        "06:00",
                        "08:00"
                      ]
                    ],
                    "fri": [
                      [
                        "06:00",
                        "08:00"
                      ]
                    ],
                    "sat": []
                  },
                  "active_from": 1788211200,
                  "active_until": 1790812800,
                  "scope_key": "default",
                  "label": "Weekday mornings"
                }
              ],
              "address": {
                "address_line_1": "456 Bourke Street",
                "address_line_2": "Apt 12",
                "city": "Melbourne",
                "state": "VIC",
                "postal_code": "3000",
                "country": "AU",
                "country_name": "Australia"
              },
              "membership_plans": [
                {
                  "membership_plan_id": "plan_99999",
                  "name": "Unlimited Monthly",
                  "start_date": "2024-01-01T00:00:00Z",
                  "status": "current",
                  "is_current": true,
                  "end_date": null
                }
              ]
            }
          ]
        },
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "member_id",
                "first_name",
                "last_name"
              ],
              "properties": {
                "member_id": {
                  "type": "string",
                  "description": "Unique identifier of a member",
                  "example": "member_11111"
                },
                "facility_id": {
                  "type": "string",
                  "description": "Unique identifier for a facility",
                  "example": "facility_67890"
                },
                "linking_identifier": {
                  "type": "string",
                  "description": "Required for linking identifier type integration for facility resolution",
                  "example": "branch_downtown"
                },
                "first_name": {
                  "type": "string",
                  "description": "First name",
                  "example": "John"
                },
                "last_name": {
                  "type": "string",
                  "description": "Last name",
                  "example": "Smith"
                },
                "email": {
                  "type": "string",
                  "description": "Email address",
                  "example": "john.smith@email.com"
                },
                "mobile_phone": {
                  "type": "string",
                  "description": "Mobile phone number in E.123 format (e.g. +1 415 555 2671)",
                  "example": "+61 412 345 678"
                },
                "date_of_birth": {
                  "type": "string",
                  "description": "Date of birth in YYYY-MM-DD format",
                  "example": "1985-06-15"
                },
                "gender": {
                  "type": "string",
                  "description": "One of: male | female | non_binary | prefer_not_to_say | unknown",
                  "example": "male"
                },
                "type": {
                  "type": "string",
                  "description": "Member type (e.g. staff, member, prospect)",
                  "example": "member"
                },
                "tags": {
                  "type": "array",
                  "description": "Quick helper strings or texts to categorise and identify specific members",
                  "example": [
                    "vip",
                    "personal-training",
                    "student"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "profile_picture": {
                  "type": "string",
                  "description": "Image Base64 string",
                  "example": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..."
                },
                "membership_status": {
                  "type": "string",
                  "description": "Latest membership status (e.g. current, expired, on hold)",
                  "example": "current"
                },
                "access_time_windows_revision": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Monotonically increasing JSON safe integer for this partner/member snapshot stream. Required whenever access_time_windows is present. Reusing a revision is idempotent only when the normalized complete snapshot is unchanged.",
                  "example": 1737417600000
                },
                "access_time_windows": {
                  "type": "array",
                  "maxItems": 50,
                  "description": "Complete vendor-neutral Access Time Windows snapshot. Omit this field to preserve the stored snapshot; send [] with a newer revision to clear it. A newer revision replaces all windows, an older revision is skipped as stale, and the same revision with different normalized content conflicts. Window bounds are half-open. Payloads cannot contain Performance Hub facility, door, or Access Scope IDs.",
                  "example": [
                    {
                      "external_id": "event_2026_09_10",
                      "kind": "absolute",
                      "from": 1788976800,
                      "to": 1788984000,
                      "timezone": "Australia/Melbourne",
                      "scope_key": "main_entry",
                      "label": "Evening access"
                    },
                    {
                      "external_id": "weekly_mornings",
                      "kind": "weekly",
                      "timezone": "America/New_York",
                      "access_hours": {
                        "sun": [],
                        "mon": [
                          [
                            "06:00",
                            "08:00"
                          ]
                        ],
                        "tue": [
                          [
                            "06:00",
                            "08:00"
                          ]
                        ],
                        "wed": [
                          [
                            "06:00",
                            "08:00"
                          ]
                        ],
                        "thu": [
                          [
                            "06:00",
                            "08:00"
                          ]
                        ],
                        "fri": [
                          [
                            "06:00",
                            "08:00"
                          ]
                        ],
                        "sat": []
                      },
                      "active_from": 1788211200,
                      "active_until": 1790812800,
                      "scope_key": "default",
                      "label": "Weekday mornings"
                    }
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "external_id",
                      "kind"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "external_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "description": "Stable identifier unique within this member snapshot"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "absolute",
                          "weekly"
                        ]
                      },
                      "from": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9999999999,
                        "description": "Absolute-window start as integer Unix seconds; inclusive"
                      },
                      "to": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9999999999,
                        "description": "Absolute-window end as integer Unix seconds; exclusive"
                      },
                      "timezone": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "default": "UTC",
                        "description": "Valid IANA timezone. Defaults to UTC. For absolute windows this is display/audit metadata only; for weekly windows it defines wall-clock and DST behavior."
                      },
                      "access_hours": {
                        "type": "object",
                        "required": [
                          "sun",
                          "mon",
                          "tue",
                          "wed",
                          "thu",
                          "fri",
                          "sat"
                        ],
                        "additionalProperties": false,
                        "description": "Weekly wall-clock blocks. Each [from, to] pair is half-open, must use strict zero-padded HH:mm, cannot overlap, and cannot run overnight. Use 24:00 only as an end value when splitting an overnight interval across two days.",
                        "properties": {
                          "sun": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          },
                          "mon": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          },
                          "tue": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          },
                          "wed": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          },
                          "thu": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          },
                          "fri": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          },
                          "sat": {
                            "type": "array",
                            "maxItems": 8,
                            "items": {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": {
                                "type": "string",
                                "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                              }
                            }
                          }
                        }
                      },
                      "active_from": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9999999999,
                        "description": "Optional inclusive weekly validity bound as integer Unix seconds"
                      },
                      "active_until": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9999999999,
                        "description": "Optional exclusive weekly validity bound as integer Unix seconds"
                      },
                      "scope_key": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "default": "default",
                        "description": "Stable partner-defined logical scope mapped by a facility administrator"
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 120,
                        "description": "Optional human-readable label"
                      }
                    },
                    "oneOf": [
                      {
                        "title": "Absolute Access Time Window",
                        "required": [
                          "from",
                          "to"
                        ]
                      },
                      {
                        "title": "Weekly Access Time Window",
                        "required": [
                          "access_hours"
                        ]
                      }
                    ]
                  }
                },
                "created": {
                  "type": "string",
                  "description": "Timestamp (ISO 8601)",
                  "example": "2024-01-15T10:30:00Z"
                },
                "updated": {
                  "type": "string",
                  "description": "Timestamp (ISO 8601)",
                  "example": "2024-01-20T14:45:00Z"
                },
                "address": {
                  "type": "object",
                  "description": "Optional physical address. Intentionally not strictly validated — if the object is malformed (wrong value types, unexpected fields, or values that do not match the documented shape) every provided value is collapsed into address_line_1 so no data is lost. Expected fields: address_line_1, address_line_2 (optional), city, state, postal_code, country (ISO 3166-1 alpha-2, e.g. \"AU\", \"US\"), country_name (optional).",
                  "example": {
                    "address_line_1": "456 Bourke Street",
                    "address_line_2": "Apt 12",
                    "city": "Melbourne",
                    "state": "VIC",
                    "postal_code": "3000",
                    "country": "AU",
                    "country_name": "Australia"
                  }
                },
                "membership_plans": {
                  "type": "array",
                  "description": "Array of all plans the member has enrolled in; one marked active",
                  "example": [
                    {
                      "membership_plan_id": "plan_99999",
                      "name": "Unlimited Monthly",
                      "start_date": "2024-01-01T00:00:00Z",
                      "status": "current",
                      "is_current": true,
                      "end_date": null
                    },
                    {
                      "membership_plan_id": "plan_88888",
                      "name": "10 Class Pack",
                      "start_date": "2023-11-01T00:00:00Z",
                      "end_date": "2023-12-31T23:59:59Z",
                      "status": "expired",
                      "is_current": false
                    }
                  ],
                  "items": {
                    "type": "object",
                    "properties": {
                      "membership_plan_id": {
                        "type": "string",
                        "description": "Unique identifier of the membership plan"
                      },
                      "name": {
                        "type": "string",
                        "description": "Membership plan name"
                      },
                      "start_date": {
                        "type": "string",
                        "description": "Start date timestamp (ISO 8601)",
                        "nullable": true
                      },
                      "end_date": {
                        "type": "string",
                        "description": "End date timestamp (ISO 8601) or null for ongoing",
                        "nullable": true
                      },
                      "status": {
                        "type": "string",
                        "description": "Plan status (e.g. current, expired, cancelled, on hold)"
                      },
                      "is_current": {
                        "type": "boolean",
                        "description": "Boolean flag indicating the active plan"
                      }
                    }
                  }
                }
              },
              "oneOf": [
                {
                  "required": [
                    "access_time_windows",
                    "access_time_windows_revision"
                  ]
                },
                {
                  "not": {
                    "required": [
                      "access_time_windows"
                    ]
                  }
                }
              ]
            }
          }
        }
      },
      "DeleteMembersRequest": {
        "type": "object",
        "required": [
          "members"
        ],
        "example": {
          "members": [
            {
              "member_id": "member_11111",
              "facility_id": "facility_67890"
            },
            {
              "member_id": "member_22222",
              "linking_identifier": "branch_downtown"
            }
          ]
        },
        "properties": {
          "members": {
            "type": "array",
            "description": "Array of member identifiers to delete",
            "items": {
              "type": "object",
              "required": [
                "member_id"
              ],
              "properties": {
                "member_id": {
                  "type": "string",
                  "description": "Unique identifier of the member to delete",
                  "example": "member_11111"
                },
                "facility_id": {
                  "type": "string",
                  "description": "Unique identifier for a facility (required unless using linking_identifier)",
                  "example": "facility_67890"
                },
                "linking_identifier": {
                  "type": "string",
                  "description": "Required for linking identifier type integration for facility resolution",
                  "example": "branch_downtown"
                }
              }
            }
          }
        }
      },
      "PostMembershipPlansRequest": {
        "type": "object",
        "required": [
          "membership_plans"
        ],
        "example": {
          "membership_plans": [
            {
              "membership_plan_id": "plan_99999",
              "facility_id": "facility_67890",
              "name": "Unlimited Monthly",
              "description": "Unlimited access to all gym facilities and group classes",
              "billing_cycle": "monthly",
              "price": 8900,
              "currency": "AUD",
              "duration_days": 30,
              "is_recurring": true,
              "is_trial": false,
              "visible_to_public": true,
              "active_members": 245,
              "access_zones": [
                {
                  "name": "Main Gym Floor",
                  "description": "Full access to cardio and weight training equipment",
                  "access_hours": {
                    "mon": [
                      [
                        "05:00",
                        "22:00"
                      ]
                    ],
                    "tue": [
                      [
                        "05:00",
                        "22:00"
                      ]
                    ],
                    "wed": [
                      [
                        "05:00",
                        "22:00"
                      ]
                    ],
                    "thu": [
                      [
                        "05:00",
                        "22:00"
                      ]
                    ],
                    "fri": [
                      [
                        "05:00",
                        "22:00"
                      ]
                    ],
                    "sat": [
                      [
                        "06:00",
                        "20:00"
                      ]
                    ],
                    "sun": [
                      [
                        "07:00",
                        "18:00"
                      ]
                    ]
                  }
                },
                {
                  "name": "Group Fitness Studio",
                  "description": "Access to group fitness classes",
                  "access_hours": {
                    "sat": [
                      [
                        "06:00",
                        "20:00"
                      ]
                    ],
                    "sun": [
                      [
                        "07:00",
                        "18:00"
                      ]
                    ]
                  }
                }
              ],
              "class_limit": null
            }
          ]
        },
        "properties": {
          "membership_plans": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "membership_plan_id",
                "name"
              ],
              "properties": {
                "membership_plan_id": {
                  "type": "string",
                  "description": "Unique identifier of a membership plan",
                  "example": "plan_99999"
                },
                "facility_id": {
                  "type": "string",
                  "description": "Unique identifier for a facility",
                  "example": "facility_67890"
                },
                "linking_identifier": {
                  "type": "string",
                  "description": "Required for linking identifier type integration for facility resolution",
                  "example": "branch_downtown"
                },
                "name": {
                  "type": "string",
                  "description": "Human-readable label (e.g. Unlimited Monthly, 10 Class Pack)",
                  "example": "Unlimited Monthly"
                },
                "description": {
                  "type": "string",
                  "description": "Optional marketing or internal description",
                  "example": "Unlimited access to all gym facilities and group classes"
                },
                "billing_cycle": {
                  "type": "string",
                  "description": "One of: weekly | fortnightly | monthly | annually | one_time",
                  "example": "monthly"
                },
                "price": {
                  "type": "integer",
                  "description": "Base cost",
                  "example": 8900
                },
                "currency": {
                  "type": "string",
                  "description": "Currency code (ISO 4217), e.g. AUD, USD",
                  "example": "AUD"
                },
                "class_limit": {
                  "type": "integer",
                  "description": "Number of classes allowed (e.g. 10 for packs, null for unlimited)",
                  "example": null
                },
                "duration_days": {
                  "type": "integer",
                  "description": "Validity in days (e.g. 30, 90). Optional for recurring",
                  "example": 30
                },
                "is_recurring": {
                  "type": "boolean",
                  "description": "Whether the plan auto-renews",
                  "example": true
                },
                "is_trial": {
                  "type": "boolean",
                  "description": "Whether this is a trial offering",
                  "example": false
                },
                "visible_to_public": {
                  "type": "boolean",
                  "description": "Whether available for self-service purchase",
                  "example": true
                },
                "active_members": {
                  "type": "integer",
                  "description": "Number of active members with this membership",
                  "example": 245
                },
                "access_zones": {
                  "type": "array",
                  "example": [
                    {
                      "name": "Main Gym Floor",
                      "description": "Full access to cardio and weight training equipment",
                      "access_hours": {
                        "mon": [
                          [
                            "05:00",
                            "22:00"
                          ]
                        ],
                        "tue": [
                          [
                            "05:00",
                            "22:00"
                          ]
                        ],
                        "wed": [
                          [
                            "05:00",
                            "22:00"
                          ]
                        ],
                        "thu": [
                          [
                            "05:00",
                            "22:00"
                          ]
                        ],
                        "fri": [
                          [
                            "05:00",
                            "22:00"
                          ]
                        ],
                        "sat": [
                          [
                            "06:00",
                            "20:00"
                          ]
                        ],
                        "sun": [
                          [
                            "07:00",
                            "18:00"
                          ]
                        ]
                      }
                    },
                    {
                      "name": "Group Fitness Studio",
                      "description": "Access to group fitness classes",
                      "access_hours": {
                        "mon": [],
                        "tue": [],
                        "wed": [],
                        "thu": [],
                        "fri": [],
                        "sat": [
                          [
                            "06:00",
                            "20:00"
                          ]
                        ],
                        "sun": [
                          [
                            "07:00",
                            "18:00"
                          ]
                        ]
                      }
                    }
                  ],
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the access zone"
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the access zone"
                      },
                      "access_hours": {
                        "type": "object",
                        "description": "Access hours for this zone. Each day is an array of time ranges in HH:MM format. Empty array means no access.",
                        "properties": {
                          "mon": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Monday (e.g. [[\"04:00\",\"12:00\"]])"
                          },
                          "tue": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Tuesday"
                          },
                          "wed": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Wednesday"
                          },
                          "thu": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Thursday"
                          },
                          "fri": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Friday"
                          },
                          "sat": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Saturday"
                          },
                          "sun": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "description": "Array of time ranges allowed on Sunday"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PostCheckInsRequest": {
        "type": "object",
        "required": [
          "check_ins"
        ],
        "example": {
          "check_ins": [
            {
              "check_in_id": "checkin_22222",
              "member_id": "member_11111",
              "facility_id": "facility_67890",
              "check_in_type": "member",
              "source": "app",
              "class_id": "class_33333",
              "timestamp": "2024-01-20T08:30:00Z"
            },
            {
              "check_in_id": "checkin_33333",
              "member_id": "member_44444",
              "facility_id": "facility_67890",
              "check_in_type": "class",
              "source": "kiosk",
              "class_id": "class_55555",
              "timestamp": "2024-01-20T09:00:00Z"
            }
          ]
        },
        "properties": {
          "check_ins": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "member_id",
                "timestamp"
              ],
              "properties": {
                "check_in_id": {
                  "type": "string",
                  "description": "Unique identifier of the check-in (if applicable)",
                  "example": "checkin_22222"
                },
                "member_id": {
                  "type": "string",
                  "description": "Unique identifier of a member",
                  "example": "member_11111"
                },
                "facility_id": {
                  "type": "string",
                  "description": "Unique identifier for a facility",
                  "example": "facility_67890"
                },
                "linking_identifier": {
                  "type": "string",
                  "description": "Required for linking identifier type integration for facility resolution",
                  "example": "branch_downtown"
                },
                "check_in_type": {
                  "type": "string",
                  "description": "Type of check-in (e.g. member, class, staff, guest, trial)",
                  "example": "member"
                },
                "source": {
                  "type": "string",
                  "description": "Source of check-in (e.g. manual, tag, rfid, kiosk, app)",
                  "example": "app"
                },
                "class_id": {
                  "type": "string",
                  "description": "Class booking/attendance identifier if applicable",
                  "example": "class_33333"
                },
                "timestamp": {
                  "type": "string",
                  "description": "Timestamp (ISO 8601)",
                  "example": "2024-01-20T08:30:00Z"
                }
              }
            }
          }
        }
      },
      "PostReportSnapshotsRequest": {
        "type": "object",
        "required": [
          "snapshots"
        ],
        "example": {
          "snapshots": [
            {
              "facility_id": "550e8400-e29b-41d4-a716-446655440000",
              "start_date": "2025-01-01",
              "end_date": "2025-01-31",
              "metrics": {
                "members": {
                  "active": 1200,
                  "new": 45,
                  "cancelled": 12
                },
                "revenue": {
                  "total_payments": 289000,
                  "currency": "AUD"
                }
              }
            }
          ]
        },
        "properties": {
          "snapshots": {
            "type": "array",
            "description": "Array of report snapshot objects",
            "items": {
              "type": "object",
              "required": [
                "start_date",
                "end_date",
                "metrics"
              ],
              "properties": {
                "facility_id": {
                  "type": "string",
                  "description": "Facility identifier (UUID or custom ID)",
                  "example": "550e8400-e29b-41d4-a716-446655440000"
                },
                "linking_identifier": {
                  "type": "string",
                  "description": "Optional linking identifier for facility resolution",
                  "example": "branch_downtown"
                },
                "start_date": {
                  "type": "string",
                  "format": "date",
                  "description": "Start date of the reporting period (ISO 8601 date format)",
                  "example": "2025-01-01"
                },
                "end_date": {
                  "type": "string",
                  "format": "date",
                  "description": "End date of the reporting period (ISO 8601 date format)",
                  "example": "2025-01-31"
                },
                "metrics": {
                  "type": "object",
                  "description": "Free-form metrics object containing any business KPIs. Structure is flexible and determined by partner needs.",
                  "example": {
                    "members": {
                      "active": 1200,
                      "new": 45,
                      "cancelled": 12
                    },
                    "revenue": {
                      "total_payments": 289000,
                      "currency": "AUD"
                    },
                    "classes": {
                      "total_sessions": 450,
                      "average_attendance": 15
                    },
                    "retention_rate": 0.92
                  }
                }
              }
            }
          }
        }
      },
      "GenerateSecretKeyRequest": {
        "type": "object",
        "properties": {
          "scopes": {
            "type": "string",
            "description": "Access scopes for the secret key",
            "enum": [
              "partner",
              "organisation"
            ],
            "example": "partner"
          },
          "name": {
            "type": "string",
            "description": "Human-readable name for the secret key",
            "example": "Production API Key"
          },
          "expiresAt": {
            "type": "string",
            "description": "Expiration date in ISO 8601 format (optional)",
            "example": "2025-12-31T23:59:59Z"
          },
          "rolloverOf": {
            "type": "string",
            "description": "Key ID of the key being replaced (optional)",
            "example": "key_abc123def456"
          }
        }
      },
      "SecretKeyResponse": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Unique identifier for the secret key",
            "example": "key_abc123def456"
          },
          "secretKey": {
            "type": "string",
            "description": "The actual secret key (only returned on creation)",
            "example": "sk_live_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"
          },
          "secretRedacted": {
            "type": "string",
            "description": "Safe preview of the secret key for display purposes",
            "example": "sk_live_abc1...wxyz"
          },
          "scopes": {
            "type": "string",
            "description": "Access scopes for the secret key",
            "example": "partner"
          },
          "name": {
            "type": "string",
            "description": "Human-readable name for the secret key",
            "example": "Production API Key"
          },
          "organisationName": {
            "type": "string",
            "description": "Organisation name associated with the secret key",
            "example": "ExampleBrand Gym"
          },
          "status": {
            "type": "string",
            "description": "Current status of the secret key",
            "enum": [
              "active",
              "revoked",
              "expired"
            ],
            "example": "active"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp in ISO 8601 format",
            "example": "2024-01-20T10:30:00Z"
          },
          "expiresAt": {
            "type": "string",
            "description": "Expiration timestamp in ISO 8601 format (optional)",
            "example": "2025-12-31T23:59:59Z"
          },
          "lastUsedAt": {
            "type": "string",
            "description": "Last usage timestamp in ISO 8601 format (optional)",
            "example": "2024-01-20T14:45:00Z"
          },
          "rolloverOf": {
            "type": "string",
            "description": "Key ID of the key being replaced (optional)",
            "example": "key_old123def456"
          }
        }
      },
      "SecretKeysListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "description": "List of secret keys (without secret values)",
            "items": {
              "type": "object",
              "properties": {
                "keyId": {
                  "type": "string",
                  "description": "Unique identifier for the secret key"
                },
                "scopes": {
                  "type": "string",
                  "description": "Access scopes for the secret key"
                },
                "name": {
                  "type": "string",
                  "description": "Human-readable name for the secret key"
                },
                "status": {
                  "type": "string",
                  "description": "Current status of the secret key"
                },
                "createdAt": {
                  "type": "string",
                  "description": "Creation timestamp in ISO 8601 format"
                },
                "expiresAt": {
                  "type": "string",
                  "description": "Expiration timestamp in ISO 8601 format"
                },
                "lastUsedAt": {
                  "type": "string",
                  "description": "Last usage timestamp in ISO 8601 format"
                },
                "rolloverOf": {
                  "type": "string",
                  "description": "Key ID of the key being replaced"
                }
              }
            }
          },
          "count": {
            "type": "integer",
            "description": "Number of items returned",
            "example": 10
          },
          "scannedCount": {
            "type": "integer",
            "description": "Number of items scanned",
            "example": 10
          },
          "lastEvaluatedKey": {
            "type": "string",
            "description": "Pagination token for next page (optional)",
            "example": "eyJrZXlJZCI6ImtleV9hYmMxMjNkZWY0NTYifQ=="
          }
        }
      },
      "UpdateSecretKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Human-readable name for the secret key",
            "example": "Updated API Key Name"
          },
          "status": {
            "type": "string",
            "description": "New status for the secret key",
            "enum": [
              "active",
              "revoked",
              "expired"
            ],
            "example": "active"
          },
          "scopes": {
            "type": "string",
            "description": "Access scopes for the secret key",
            "enum": [
              "partner",
              "organisation"
            ],
            "example": "partner"
          },
          "expiresAt": {
            "type": "string",
            "description": "Expiration date in ISO 8601 format (optional)",
            "example": "2025-12-31T23:59:59Z"
          }
        }
      },
      "OtpResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Success message",
            "example": "OTP sent successfully"
          },
          "partnerId": {
            "type": "string",
            "description": "Partner ID that the OTP was sent to",
            "example": "4b9e7f3a-8c2d-4a1e-b7c3-9f6a2d5e8b0c"
          },
          "email": {
            "type": "string",
            "description": "Email address where OTP was sent",
            "example": "partner@example.com"
          },
          "expiresAt": {
            "type": "number",
            "description": "Unix timestamp when the OTP expires",
            "example": 1759209345
          },
          "messageId": {
            "type": "string",
            "description": "Email service message ID (optional)",
            "example": "0000014a-f4d4-4f7e-8f7e-1234567890ab-000000"
          }
        }
      },
      "AccessNotificationResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Success message",
            "example": "Access notification sent successfully"
          },
          "partnerId": {
            "type": "string",
            "description": "Partner ID that the notification was sent to",
            "example": "4b9e7f3a-8c2d-4a1e-b7c3-9f6a2d5e8b0c"
          },
          "organisationName": {
            "type": "string",
            "description": "Name of the organisation that granted access",
            "example": "Acme Corporation"
          },
          "email": {
            "type": "string",
            "description": "Email address where notification was sent",
            "example": "partner@example.com"
          },
          "consoleUrl": {
            "type": "string",
            "description": "The console URL that was sent to the partner",
            "example": "https://api.performancehub.com/stg/partner/v1/auth/console/4b9e7f3a-8c2d-4a1e-b7c3-9f6a2d5e8b0c"
          },
          "messageId": {
            "type": "string",
            "description": "Email service message ID (optional)",
            "example": "0000014a-f4d4-4f7e-8f7e-1234567890ab-000000"
          }
        }
      },
      "Access-Control-Allow-Origin": {
        "type": "string",
        "default": "*",
        "example": "https://developer.mozilla.org"
      },
      "Access-Control-Allow-Credentials": {
        "type": "boolean",
        "default": true
      },
      "facility_id": {
        "type": "string"
      },
      "linking_identifier": {
        "type": "string"
      },
      "doorId": {
        "type": "string"
      }
    },
    "securitySchemes": {
      "SecretKeyAuth": {
        "description": "Enter your secret key as the username (leave password empty). Format: sk_live_...",
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "info": {
    "title": "Partner API",
    "description": "The Partner API allows third-party systems to sync facility, member, check-in, and membership data into the Performance Hub platform.",
    "version": "1"
  },
  "security": [
    {
      "SecretKeyAuth": []
    }
  ],
  "paths": {
    "/partner/v1/auth/ping": {
      "get": {
        "summary": "Ping endpoint",
        "description": "Test secret key authentication",
        "operationId": "ping",
        "parameters": [],
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Secret key is valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/organisations": {
      "get": {
        "summary": "List organisation data",
        "description": "Retrieves organisations associated with the authenticated partner. Organisations represent top-level business entities that manage one or more facilities.",
        "operationId": "getOrganisations",
        "parameters": [],
        "tags": [
          "Organisation"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "An array of organisation data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request; authentication failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while retrieving organisations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/members": {
      "post": {
        "summary": "Sync member profiles",
        "description": "Creates or updates member records tied to facilities, including profile, contact, membership history, and optional vendor-neutral Access Time Windows complete snapshots. Ordinary member fields remain partial upserts. access_time_windows requires a monotonic access_time_windows_revision; omit the field to preserve the stored snapshot or send [] with a newer revision to clear it.",
        "operationId": "postMembers",
        "parameters": [],
        "tags": [
          "Member"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Payload containing one or more member profiles and enrolment data. A member may include mixed absolute and weekly access_time_windows; epoch values use integer Unix seconds, timezone defaults to UTC, and weekly access_hours are interpreted in the declared IANA timezone with daylight-saving rules.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostMembersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Member profiles synced successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaSuccessResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload; missing or malformed member data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "409": {
            "description": "One or more members reused an access_time_windows_revision with different normalized content. Ordinary member fields were still saved; inspect the per-member results before retrying with a newer revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while syncing member profiles.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete member profiles",
        "description": "Soft-deletes member records by marking them as deleted in the database. Uses deterministic UUID based on partnerId, facilityId, and externalMemberId.",
        "operationId": "deleteMembers",
        "parameters": [],
        "tags": [
          "Member"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Payload containing member identifiers to delete.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteMembersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Member profiles deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaSuccessResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload; missing or malformed member identifiers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while deleting member profiles.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/membership-plans": {
      "post": {
        "summary": "Sync membership plans",
        "description": "Creates or updates purchasable membership offerings. Includes pricing, duration, access schedule, and recurrence flags.",
        "operationId": "postMembershipPlans",
        "parameters": [],
        "tags": [
          "MembershipPlan"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Payload containing one or more membership plan objects.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostMembershipPlansRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Membership plans synced successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaSuccessResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload; missing or malformed membership plan data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while syncing membership plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/report-snapshots": {
      "post": {
        "summary": "Sync facility report snapshots",
        "description": "Creates or updates aggregated metrics for facilities over specified date ranges. Metrics object is free-form and can contain any business KPIs such as member counts, revenue, or attendance data.",
        "operationId": "postReportSnapshots",
        "parameters": [],
        "tags": [
          "ReportSnapshot"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Payload containing one or more report snapshot objects.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostReportSnapshotsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report snapshots synced successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaSuccessResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload; missing or malformed report snapshot data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while syncing report snapshots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/check-ins": {
      "post": {
        "summary": "Log member check-ins",
        "description": "Records check-in events, representing member, guest, or staff presence at facilities or classes. Supports manual, automated, or app-based logs.",
        "operationId": "postCheckIns",
        "parameters": [],
        "tags": [
          "CheckIn"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Payload containing one or more check-in events.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostCheckInsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check-in events logged successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaSuccessResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload; missing or malformed check-in data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while logging check-ins.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/facilities": {
      "get": {
        "summary": "List facility data",
        "description": "List partner facility data that are present in Performance Hub",
        "operationId": "getFacilities",
        "parameters": [],
        "tags": [
          "Facility"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "An array of facility data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacilityResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload; missing or malformed facility data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error encountered while syncing facilities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/access-control/doors": {
      "get": {
        "summary": "List Door/Gate Controllers",
        "description": "Lists Door/Gate Controllers available to the authenticated partner for linked facilities.",
        "operationId": "getAccessControlDoors",
        "parameters": [
          {
            "name": "facility_id",
            "in": "query",
            "description": "Performance Hub facility ID. Required unless using linking_identifier.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/facility_id"
            }
          },
          {
            "name": "linking_identifier",
            "in": "query",
            "description": "Partner location identifier for linking-identifier integrations.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/linking_identifier"
            }
          }
        ],
        "tags": [
          "AccessControl"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Door/Gate Controllers retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorListResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/access-control/doors/{doorId}": {
      "get": {
        "summary": "Get Door/Gate Controller status",
        "description": "Retrieves one Door/Gate Controller status and configuration for a linked facility.",
        "operationId": "getAccessControlDoor",
        "parameters": [
          {
            "name": "doorId",
            "in": "path",
            "description": "Door/Gate Controller ID returned by the list endpoint.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/doorId"
            }
          },
          {
            "name": "facility_id",
            "in": "query",
            "description": "Performance Hub facility ID. Required unless using linking_identifier.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/facility_id"
            }
          },
          {
            "name": "linking_identifier",
            "in": "query",
            "description": "Partner location identifier for linking-identifier integrations.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/linking_identifier"
            }
          }
        ],
        "tags": [
          "AccessControl"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Door/Gate Controller retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "404": {
            "description": "Door/Gate Controller not found for the linked facility.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/access-control/doors/{doorId}/unlock": {
      "post": {
        "summary": "Unlock a Door/Gate Controller",
        "description": "Sends a Door/Gate Controller unlock command and returns only after the device confirms the relay physically unlocked.",
        "operationId": "postAccessControlDoorUnlock",
        "parameters": [
          {
            "name": "doorId",
            "in": "path",
            "description": "Door/Gate Controller ID returned by the list endpoint.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/doorId"
            }
          }
        ],
        "tags": [
          "AccessControl"
        ],
        "security": [
          {
            "SecretKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Unlock request with facility and member identity context.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DoorUnlockRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Door/Gate Controller confirmed unlocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorUnlockSuccessResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorUnlockFailureResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "409": {
            "description": "Door/Gate Controller is in maintenance mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorUnlockFailureResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LambdaErrorResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "503": {
            "description": "Door controller is offline.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorUnlockFailureResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          },
          "504": {
            "description": "Timed out waiting for unlock confirmation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoorUnlockFailureResponse"
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Origin"
                }
              },
              "Access-Control-Allow-Credentials": {
                "description": "The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)",
                "schema": {
                  "$ref": "#/components/schemas/Access-Control-Allow-Credentials"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://stage.partner-api.performancehub.co/",
      "description": "Staging Server"
    },
    {
      "url": "https://partner-api.performancehub.co/",
      "description": "Production API (uses live data)"
    }
  ]
}