{
  "openapi": "3.0.0",
  "info": {
    "title": "Car Storage Software API",
    "version": "1.2.0",
    "description": "Team-scoped REST API for Car Storage Software. Authenticate with a team API key (`Authorization: Bearer <key>` or `x-api-key: <key>`) created under Settings → Integrations → API. Keys carry granular `read:*` / `write:*` scopes; read never implies write."
  },
  "servers": [
    {
      "url": "https://www.carstoragesoftware.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Team API key from Settings → Integrations. Use `Authorization: Bearer <key>` or `x-api-key`."
      }
    },
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "details": {
            "nullable": true
          }
        },
        "required": [
          "error"
        ]
      },
      "V1Car": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string",
            "nullable": true
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vin": {
            "type": "string",
            "nullable": true
          },
          "stockNumber": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer"
          },
          "make": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "trim": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "licensePlate": {
            "type": "string",
            "nullable": true
          },
          "licensePlateState": {
            "type": "string",
            "nullable": true
          },
          "mileage": {
            "type": "integer",
            "nullable": true
          },
          "mileageUnits": {
            "type": "string",
            "nullable": true
          },
          "parkingSpot": {
            "type": "string",
            "nullable": true
          },
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isForSale": {
            "type": "boolean"
          },
          "declaredValueCents": {
            "type": "integer",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "customerId",
          "locationId",
          "vin",
          "stockNumber",
          "year",
          "make",
          "model",
          "trim",
          "color",
          "licensePlate",
          "licensePlateState",
          "mileage",
          "mileageUnits",
          "parkingSpot",
          "parkingSpotId",
          "parkingZoneId",
          "vendorId",
          "isForSale",
          "declaredValueCents",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1CarCreate": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "minimum": 1886,
            "maximum": 2100
          },
          "make": {
            "type": "string",
            "minLength": 1
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "trim": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "vin": {
            "type": "string",
            "nullable": true
          },
          "stockNumber": {
            "type": "string",
            "nullable": true
          },
          "licensePlate": {
            "type": "string",
            "nullable": true
          },
          "licensePlateState": {
            "type": "string",
            "nullable": true
          },
          "mileage": {
            "type": "integer",
            "nullable": true
          },
          "mileageUnits": {
            "type": "string",
            "enum": [
              "mi",
              "km"
            ]
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isForSale": {
            "type": "boolean"
          },
          "declaredValueCents": {
            "type": "integer",
            "nullable": true
          }
        },
        "required": [
          "year",
          "make",
          "model"
        ]
      },
      "V1CarUpdate": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "minimum": 1886,
            "maximum": 2100
          },
          "make": {
            "type": "string",
            "minLength": 1
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "trim": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "vin": {
            "type": "string",
            "nullable": true
          },
          "stockNumber": {
            "type": "string",
            "nullable": true
          },
          "licensePlate": {
            "type": "string",
            "nullable": true
          },
          "licensePlateState": {
            "type": "string",
            "nullable": true
          },
          "mileage": {
            "type": "integer",
            "nullable": true
          },
          "mileageUnits": {
            "type": "string",
            "enum": [
              "mi",
              "km"
            ]
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isForSale": {
            "type": "boolean"
          },
          "declaredValueCents": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "V1CarsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Car"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CarResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Car"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string",
            "nullable": true
          },
          "userId": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "deletedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "userId",
          "locationId",
          "firstName",
          "lastName",
          "companyName",
          "email",
          "phone",
          "address",
          "city",
          "state",
          "zip",
          "country",
          "isActive",
          "deletedAt",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1CustomerCreate": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1
          },
          "lastName": {
            "type": "string",
            "minLength": 1
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true,
            "format": "email"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isActive": {
            "type": "boolean"
          }
        },
        "required": [
          "firstName",
          "lastName"
        ]
      },
      "V1CustomerUpdate": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1
          },
          "lastName": {
            "type": "string",
            "minLength": 1
          },
          "companyName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true,
            "format": "email"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isActive": {
            "type": "boolean"
          },
          "restore": {
            "type": "boolean"
          },
          "deletedAt": {
            "nullable": true
          }
        }
      },
      "V1CustomersResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Customer"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CustomerResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Customer"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string",
            "enum": [
              "primary",
              "spouse",
              "child",
              "son",
              "daughter",
              "family_member",
              "bookkeeper",
              "vehicle_handler",
              "family_office",
              "accountant",
              "assistant",
              "collection_manager",
              "other"
            ]
          },
          "roleDescription": {
            "type": "string",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean"
          },
          "canAccessPortal": {
            "type": "boolean"
          },
          "communicationPreferences": {
            "type": "object",
            "nullable": true,
            "properties": {
              "invoices": {
                "type": "boolean"
              },
              "estimates": {
                "type": "boolean"
              },
              "scheduling": {
                "type": "boolean"
              },
              "carUpdates": {
                "type": "boolean"
              },
              "contracts": {
                "type": "boolean"
              },
              "socialEvents": {
                "type": "boolean"
              },
              "marketing": {
                "type": "boolean"
              }
            },
            "required": [
              "invoices",
              "estimates",
              "scheduling",
              "carUpdates",
              "contracts",
              "socialEvents",
              "marketing"
            ]
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "customerId",
          "firstName",
          "lastName",
          "email",
          "phone",
          "role",
          "roleDescription",
          "isPrimary",
          "canAccessPortal",
          "communicationPreferences",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1ContactCreate": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "firstName": {
            "type": "string",
            "minLength": 1
          },
          "lastName": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "nullable": true,
            "format": "email"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string",
            "enum": [
              "primary",
              "spouse",
              "child",
              "son",
              "daughter",
              "family_member",
              "bookkeeper",
              "vehicle_handler",
              "family_office",
              "accountant",
              "assistant",
              "collection_manager",
              "other"
            ]
          },
          "roleDescription": {
            "type": "string",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean"
          },
          "canAccessPortal": {
            "type": "boolean"
          },
          "communicationPreferences": {
            "type": "object",
            "properties": {
              "invoices": {
                "type": "boolean"
              },
              "estimates": {
                "type": "boolean"
              },
              "scheduling": {
                "type": "boolean"
              },
              "carUpdates": {
                "type": "boolean"
              },
              "contracts": {
                "type": "boolean"
              },
              "socialEvents": {
                "type": "boolean"
              },
              "marketing": {
                "type": "boolean"
              }
            },
            "required": [
              "invoices",
              "estimates",
              "scheduling",
              "carUpdates",
              "contracts",
              "socialEvents",
              "marketing"
            ]
          }
        },
        "required": [
          "customerId",
          "firstName",
          "lastName"
        ]
      },
      "V1ContactUpdate": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1
          },
          "lastName": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "nullable": true,
            "format": "email"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string",
            "enum": [
              "primary",
              "spouse",
              "child",
              "son",
              "daughter",
              "family_member",
              "bookkeeper",
              "vehicle_handler",
              "family_office",
              "accountant",
              "assistant",
              "collection_manager",
              "other"
            ]
          },
          "roleDescription": {
            "type": "string",
            "nullable": true
          },
          "isPrimary": {
            "type": "boolean"
          },
          "canAccessPortal": {
            "type": "boolean"
          },
          "communicationPreferences": {
            "type": "object",
            "properties": {
              "invoices": {
                "type": "boolean"
              },
              "estimates": {
                "type": "boolean"
              },
              "scheduling": {
                "type": "boolean"
              },
              "carUpdates": {
                "type": "boolean"
              },
              "contracts": {
                "type": "boolean"
              },
              "socialEvents": {
                "type": "boolean"
              },
              "marketing": {
                "type": "boolean"
              }
            },
            "required": [
              "invoices",
              "estimates",
              "scheduling",
              "carUpdates",
              "contracts",
              "socialEvents",
              "marketing"
            ]
          }
        }
      },
      "V1ContactsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Contact"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1ContactResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Contact"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "name",
          "address",
          "city",
          "state",
          "zip",
          "phone",
          "timezone",
          "isActive",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1LocationCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer"
          }
        },
        "required": [
          "name"
        ]
      },
      "V1LocationUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer"
          }
        }
      },
      "V1LocationsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Location"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1LocationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Location"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1ParkingZone": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "additionalCapacity": {
            "type": "integer",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "locationId",
          "name",
          "description",
          "additionalCapacity",
          "color",
          "isActive",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1ParkingZoneCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "additionalCapacity": {
            "type": "integer",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      },
      "V1ParkingZoneUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "additionalCapacity": {
            "type": "integer",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "V1ParkingZonesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1ParkingZone"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1ParkingZoneResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1ParkingZone"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1ParkingSpot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "reservedCarId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "reservedCustomerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "isLiftSpot": {
            "type": "boolean",
            "nullable": true
          },
          "liftHeight": {
            "type": "integer",
            "nullable": true
          },
          "isMotorcycleSpot": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "locationId",
          "name",
          "description",
          "customerId",
          "reservedCarId",
          "reservedCustomerId",
          "isActive",
          "sortOrder",
          "tags",
          "isLiftSpot",
          "liftHeight",
          "isMotorcycleSpot",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1ParkingSpotCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "reservedCarId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "reservedCustomerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isLiftSpot": {
            "type": "boolean"
          },
          "liftHeight": {
            "type": "integer",
            "nullable": true
          },
          "isMotorcycleSpot": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      },
      "V1ParkingSpotUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "reservedCarId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "reservedCustomerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isLiftSpot": {
            "type": "boolean"
          },
          "liftHeight": {
            "type": "integer",
            "nullable": true
          },
          "isMotorcycleSpot": {
            "type": "boolean"
          }
        }
      },
      "V1ParkingSpotsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1ParkingSpot"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1ParkingSpotResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1ParkingSpot"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1ParkingAssignment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "assignmentType": {
            "type": "string"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "locationId",
          "parkingSpotId",
          "parkingZoneId",
          "vendorId",
          "customerId",
          "carId",
          "startDate",
          "endDate",
          "assignmentType",
          "notes",
          "status",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1ParkingAssignmentCreate": {
        "type": "object",
        "properties": {
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "assignmentType": {
            "type": "string"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "startDate"
        ]
      },
      "V1ParkingAssignmentUpdate": {
        "type": "object",
        "properties": {
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "assignmentType": {
            "type": "string"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          }
        }
      },
      "V1ParkingAssignmentsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1ParkingAssignment"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1ParkingAssignmentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1ParkingAssignment"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1MarketingTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "nullable": true
          },
          "designJson": {
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "name",
          "subject",
          "body",
          "isDefault",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1MarketingTemplateCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean"
          },
          "designJson": {
            "nullable": true
          }
        },
        "required": [
          "name"
        ]
      },
      "V1MarketingTemplateUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean"
          },
          "designJson": {
            "nullable": true
          }
        }
      },
      "V1MarketingTemplatesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1MarketingTemplate"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1MarketingTemplateResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1MarketingTemplate"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "socialEventId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "metadata": {
            "nullable": true
          },
          "lastRunAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "name",
          "description",
          "status",
          "type",
          "channel",
          "startDate",
          "endDate",
          "socialEventId",
          "lastRunAt",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1CampaignCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "push"
            ]
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "socialEventId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "goal": {
                "type": "string"
              },
              "targetAudienceSize": {
                "type": "number"
              }
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "V1CampaignUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "push"
            ]
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "socialEventId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "goal": {
                "type": "string"
              },
              "targetAudienceSize": {
                "type": "number"
              }
            }
          }
        }
      },
      "V1CampaignSchedule": {
        "type": "object",
        "properties": {
          "scheduledAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "scheduledAt"
        ]
      },
      "V1CampaignDuplicate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "scheduledAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "V1CampaignAudienceBulkCreate": {
        "type": "object",
        "properties": {
          "customerIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1
          }
        },
        "required": [
          "customerIds"
        ]
      },
      "V1SocialPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "campaignId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "platform": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "mediaUrls": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "linkUrl": {
            "type": "string",
            "nullable": true
          },
          "scheduledFor": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "providerId": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "campaignId",
          "platform",
          "content",
          "mediaUrls",
          "hashtags",
          "linkUrl",
          "scheduledFor",
          "status",
          "publishedAt",
          "providerId",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1SocialPostCreate": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1
          },
          "mediaUrls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Public image or video URLs. Videos are detected by extension (.mp4, .mov, .m4v, .webm)."
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "publishNow": {
            "type": "boolean"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "hashtags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "postType": {
            "type": "string",
            "enum": [
              "post",
              "reel",
              "story"
            ],
            "description": "Instagram/Facebook format. `reel` needs a video, `story` needs media; other platforms always get a regular post. Defaults to `post`."
          }
        },
        "required": [
          "body",
          "accountIds"
        ]
      },
      "V1SocialPostUpdate": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "mediaUrls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "publishNow": {
            "type": "boolean"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "postType": {
            "type": "string",
            "enum": [
              "post",
              "reel",
              "story"
            ],
            "description": "Instagram/Facebook format. `reel` needs a video, `story` needs media; other platforms always get a regular post. On update, send `accountIds` too."
          }
        }
      },
      "V1SocialPostsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1SocialPost"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1SocialPostResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1SocialPost"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignTestEmail": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "format": "email"
          },
          "subject": {
            "type": "string",
            "minLength": 1
          },
          "html": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "to",
          "subject",
          "html"
        ]
      },
      "V1CampaignTestSms": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "minLength": 1
          },
          "body": {
            "type": "string",
            "minLength": 1
          },
          "mediaUrls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "to",
          "body"
        ]
      },
      "V1CampaignTestPush": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1
          },
          "body": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string"
          },
          "userId": {
            "type": "string",
            "minLength": 1
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "title",
          "body"
        ]
      },
      "V1CampaignsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Campaign"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CampaignResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Campaign"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignStep": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "campaignId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "nullable": true
          },
          "order": {
            "type": "integer"
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "templateId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "campaignId",
          "type",
          "name",
          "order",
          "scheduledAt",
          "templateId",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1CampaignStepCreate": {
        "type": "object",
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "email",
                  "sms",
                  "push",
                  "social"
                ]
              },
              {
                "type": "string",
                "minLength": 1
              }
            ]
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          },
          "order": {
            "type": "integer"
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "templateId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        },
        "required": [
          "type",
          "content"
        ]
      },
      "V1CampaignStepUpdate": {
        "type": "object",
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "email",
                  "sms",
                  "push",
                  "social"
                ]
              },
              {
                "type": "string",
                "minLength": 1
              }
            ]
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          },
          "order": {
            "type": "integer"
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "templateId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        }
      },
      "V1CampaignStepsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CampaignStep"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CampaignStepResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CampaignStep"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignAudience": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "campaignId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "currentStepOrder": {
            "type": "integer",
            "nullable": true
          },
          "nextStepAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "joinedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "unsubscribedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "campaignId",
          "customerId",
          "status",
          "currentStepOrder",
          "nextStepAt",
          "joinedAt",
          "completedAt",
          "unsubscribedAt"
        ]
      },
      "V1CampaignAudienceCreate": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "customerId"
        ]
      },
      "V1CampaignAudiencesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CampaignAudience"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CampaignAudienceResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CampaignAudience"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignAudienceBulkResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "added": {
                "type": "integer"
              },
              "removed": {
                "type": "integer"
              },
              "audience": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/V1CampaignAudience"
                }
              }
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignPreview": {
        "type": "object",
        "properties": {
          "canPublish": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "recipientCount": {
            "type": "integer"
          },
          "stepCount": {
            "type": "integer"
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "channel": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "canPublish",
          "recipientCount",
          "stepCount",
          "scheduledAt"
        ]
      },
      "V1CampaignPreviewResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CampaignPreview"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignActivityItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "channel": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerName": {
            "type": "string",
            "nullable": true
          },
          "recipientAddress": {
            "type": "string",
            "nullable": true
          },
          "scheduledFor": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "sentAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "deliveredAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "openCount": {
            "type": "integer"
          },
          "clickCount": {
            "type": "integer"
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "stepId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "stepName": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "channel",
          "status",
          "customerId",
          "customerName",
          "recipientAddress",
          "scheduledFor",
          "sentAt",
          "deliveredAt",
          "openCount",
          "clickCount",
          "error",
          "stepId",
          "stepName",
          "createdAt"
        ]
      },
      "V1CampaignActivityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CampaignActivityItem"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CampaignTestEmailResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            },
            "required": [
              "success",
              "email"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignTestSmsResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "to": {
                "type": "string"
              },
              "messageSid": {
                "type": "string"
              }
            },
            "required": [
              "success",
              "to"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CampaignTestPushResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "sent": {
                "type": "integer"
              }
            },
            "required": [
              "success",
              "sent"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1SocialAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "platform",
          "username",
          "name"
        ]
      },
      "V1SocialAccountsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "profileId": {
                "type": "string",
                "nullable": true
              },
              "accounts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/V1SocialAccount"
                }
              }
            },
            "required": [
              "profileId",
              "accounts"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CommunicationThread": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "externalPhone": {
            "type": "string",
            "nullable": true
          },
          "assignedUserId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "lastMessageAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "lastMessagePreview": {
            "type": "string",
            "nullable": true
          },
          "unreadCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "channel",
          "customerId",
          "externalPhone",
          "assignedUserId",
          "status",
          "lastMessageAt",
          "lastMessagePreview",
          "unreadCount",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1CommunicationThreadCreate": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "sms",
              "email"
            ],
            "default": "sms"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "externalPhone": {
            "type": "string",
            "nullable": true
          },
          "assignedUserId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          }
        }
      },
      "V1CommunicationThreadUpdate": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "sms",
              "email"
            ],
            "default": "sms"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "externalPhone": {
            "type": "string",
            "nullable": true
          },
          "assignedUserId": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          }
        }
      },
      "V1CommunicationThreadsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CommunicationThread"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CommunicationThreadResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CommunicationThread"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CommunicationMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "threadId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "channel": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "nullable": true
          },
          "to": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "htmlBody": {
            "type": "string",
            "nullable": true
          },
          "textBody": {
            "type": "string",
            "nullable": true
          },
          "mediaUrls": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "provider": {
            "type": "string",
            "nullable": true
          },
          "providerMessageSid": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "threadId",
          "customerId",
          "channel",
          "direction",
          "from",
          "to",
          "body",
          "subject",
          "htmlBody",
          "textBody",
          "mediaUrls",
          "status",
          "provider",
          "providerMessageSid",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1CommunicationMessageCreate": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string"
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "htmlBody": {
            "type": "string",
            "nullable": true
          },
          "textBody": {
            "type": "string",
            "nullable": true
          },
          "mediaUrls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "send": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "V1CommunicationMessageUpdate": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "htmlBody": {
            "type": "string",
            "nullable": true
          },
          "textBody": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          }
        }
      },
      "V1CommunicationMessagesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CommunicationMessage"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1CommunicationMessageResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CommunicationMessage"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1Appointment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "appointmentTypeId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "optionId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "pending_approval",
              "accepted",
              "declined",
              "checked_in",
              "in_progress",
              "completed",
              "cancelled",
              "no_show"
            ]
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "secondaryCarId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "startAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "recurrenceFrequency": {
            "type": "string",
            "nullable": true,
            "enum": [
              "daily",
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "yearly",
              null
            ]
          },
          "recurrenceInterval": {
            "type": "integer",
            "nullable": true
          },
          "recurrenceDaysOfWeek": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "integer"
            }
          },
          "recurrenceDayOfMonth": {
            "type": "integer",
            "nullable": true
          },
          "recurrenceEndDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "recurrenceCount": {
            "type": "integer",
            "nullable": true
          },
          "recurrenceSeriesId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "locationId",
          "appointmentTypeId",
          "optionId",
          "status",
          "carId",
          "secondaryCarId",
          "customerId",
          "startAt",
          "endAt",
          "title",
          "notes",
          "recurrenceFrequency",
          "recurrenceInterval",
          "recurrenceDaysOfWeek",
          "recurrenceDayOfMonth",
          "recurrenceEndDate",
          "recurrenceCount",
          "recurrenceSeriesId",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1AppointmentCreate": {
        "type": "object",
        "properties": {
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "pending_approval",
              "accepted",
              "declined",
              "checked_in",
              "in_progress",
              "completed",
              "cancelled",
              "no_show"
            ]
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "appointmentTypeId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "optionId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "secondaryCarId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "recurrenceFrequency": {
            "type": "string",
            "nullable": true,
            "enum": [
              "daily",
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "yearly",
              null
            ]
          },
          "recurrenceInterval": {
            "type": "integer",
            "nullable": true,
            "minimum": 1
          },
          "recurrenceDaysOfWeek": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            }
          },
          "recurrenceDayOfMonth": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 31
          },
          "recurrenceEndDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "recurrenceCount": {
            "type": "integer",
            "nullable": true,
            "minimum": 1
          },
          "recurrenceSeriesId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "eventTypeId": {
            "type": "string",
            "format": "uuid",
            "description": "Event type id (from the event types list). Alternative to appointmentTypeId."
          },
          "eventType": {
            "type": "string",
            "minLength": 1,
            "description": "Event type `value` (e.g. `vehicle_pick_up`). Alternative to eventTypeId."
          }
        },
        "required": [
          "startAt",
          "endAt"
        ]
      },
      "V1AppointmentUpdate": {
        "type": "object",
        "properties": {
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "pending_approval",
              "accepted",
              "declined",
              "checked_in",
              "in_progress",
              "completed",
              "cancelled",
              "no_show"
            ]
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "appointmentTypeId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "optionId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "secondaryCarId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "recurrenceFrequency": {
            "type": "string",
            "nullable": true,
            "enum": [
              "daily",
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "yearly",
              null
            ]
          },
          "recurrenceInterval": {
            "type": "integer",
            "nullable": true,
            "minimum": 1
          },
          "recurrenceDaysOfWeek": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            }
          },
          "recurrenceDayOfMonth": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 31
          },
          "recurrenceEndDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "recurrenceCount": {
            "type": "integer",
            "nullable": true,
            "minimum": 1
          },
          "recurrenceSeriesId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        }
      },
      "V1AppointmentsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Appointment"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1AppointmentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Appointment"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1Form": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "visibility": {
            "type": "string"
          },
          "inviteCode": {
            "type": "string",
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "nullable": true
              }
            }
          },
          "settings": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          },
          "themePrimaryColor": {
            "type": "string",
            "nullable": true
          },
          "themeBackgroundColor": {
            "type": "string",
            "nullable": true
          },
          "successMessage": {
            "type": "string",
            "nullable": true
          },
          "closeAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "maxResponses": {
            "type": "integer",
            "nullable": true
          },
          "responseCount": {
            "type": "integer"
          },
          "requireEmail": {
            "type": "boolean"
          },
          "requireName": {
            "type": "boolean"
          },
          "requirePhone": {
            "type": "boolean"
          },
          "allowMultipleSubmissions": {
            "type": "boolean"
          },
          "publishedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "name",
          "slug",
          "description",
          "status",
          "visibility",
          "inviteCode",
          "fields",
          "settings",
          "themePrimaryColor",
          "themeBackgroundColor",
          "successMessage",
          "closeAt",
          "maxResponses",
          "responseCount",
          "requireEmail",
          "requireName",
          "requirePhone",
          "allowMultipleSubmissions",
          "publishedAt",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1FormCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "purpose": {
            "type": "string",
            "enum": [
              "default",
              "event_questionnaire"
            ]
          }
        },
        "required": [
          "name"
        ]
      },
      "V1FormUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "closed"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "invite_only",
              "customers_only"
            ]
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "nullable": true
              }
            }
          },
          "settings": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          },
          "themePrimaryColor": {
            "type": "string",
            "nullable": true
          },
          "themeBackgroundColor": {
            "type": "string",
            "nullable": true
          },
          "successMessage": {
            "type": "string",
            "nullable": true
          },
          "closeAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "maxResponses": {
            "type": "integer",
            "nullable": true
          },
          "requireEmail": {
            "type": "boolean"
          },
          "requireName": {
            "type": "boolean"
          },
          "requirePhone": {
            "type": "boolean"
          },
          "allowMultipleSubmissions": {
            "type": "boolean"
          },
          "regenerateInviteCode": {
            "type": "boolean"
          }
        }
      },
      "V1FormSubmission": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "formId": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "respondentEmail": {
            "type": "string",
            "nullable": true
          },
          "respondentName": {
            "type": "string",
            "nullable": true
          },
          "respondentPhone": {
            "type": "string",
            "nullable": true
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          },
          "fieldSnapshot": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "nullable": true
              }
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          },
          "submittedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "formId",
          "teamId",
          "customerId",
          "respondentEmail",
          "respondentName",
          "respondentPhone",
          "values",
          "fieldSnapshot",
          "metadata",
          "submittedAt"
        ]
      },
      "V1FormSubmissionPatch": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        },
        "required": [
          "customerId"
        ]
      },
      "V1FormSubmissionCreate": {
        "type": "object",
        "properties": {
          "values": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "default": {},
            "description": "Answers keyed by form field id (see the form's `fields`)."
          },
          "respondentEmail": {
            "type": "string",
            "nullable": true,
            "format": "email"
          },
          "respondentName": {
            "type": "string",
            "nullable": true,
            "maxLength": 200
          },
          "respondentPhone": {
            "type": "string",
            "nullable": true,
            "maxLength": 50
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid",
            "description": "Attach to this customer. Omit to match or create one from `respondentEmail`."
          },
          "source": {
            "type": "string",
            "maxLength": 200,
            "description": "Where the response came from, e.g. `website-contact-form`. Saved in `metadata.source`."
          },
          "sendNotifications": {
            "type": "boolean",
            "description": "Email the form's staff recipients. Defaults to true."
          }
        }
      },
      "V1FormsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Form"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1FormResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1Form"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1FormSubmissionsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1FormSubmission"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1FormSubmissionResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1FormSubmission"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1SocialEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "maxAttendees": {
            "type": "integer",
            "nullable": true
          },
          "enableWaitlist": {
            "type": "boolean"
          },
          "allowMultiOptionRsvp": {
            "type": "boolean"
          },
          "allowRsvpNotes": {
            "type": "boolean"
          },
          "rsvpEnabled": {
            "type": "boolean"
          },
          "ticketsEnabled": {
            "type": "boolean"
          },
          "cost": {
            "type": "integer",
            "nullable": true
          },
          "photoUrl": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string"
          },
          "inviteAccessMode": {
            "type": "string"
          },
          "isPublished": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "questionnaireFormId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "name",
          "description",
          "location",
          "startTime",
          "endTime",
          "maxAttendees",
          "enableWaitlist",
          "allowMultiOptionRsvp",
          "allowRsvpNotes",
          "rsvpEnabled",
          "ticketsEnabled",
          "cost",
          "photoUrl",
          "visibility",
          "inviteAccessMode",
          "isPublished",
          "status",
          "questionnaireFormId",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1SocialEventCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "maxAttendees": {
            "type": "integer",
            "nullable": true
          },
          "enableWaitlist": {
            "type": "boolean"
          },
          "allowMultiOptionRsvp": {
            "type": "boolean"
          },
          "allowRsvpNotes": {
            "type": "boolean"
          },
          "rsvpEnabled": {
            "type": "boolean"
          },
          "ticketsEnabled": {
            "type": "boolean"
          },
          "cost": {
            "type": "integer"
          },
          "photoUrl": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "customers_only",
              "invite_only"
            ]
          },
          "inviteAccessMode": {
            "type": "string",
            "enum": [
              "link",
              "customer_list"
            ]
          },
          "isPublished": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "questionnaireFormId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "questionnaireTiming": {
            "type": "string",
            "enum": [
              "none",
              "during_rsvp",
              "after_rsvp"
            ]
          },
          "questionnaireRequired": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "startTime"
        ]
      },
      "V1SocialEventUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "maxAttendees": {
            "type": "integer",
            "nullable": true
          },
          "enableWaitlist": {
            "type": "boolean"
          },
          "allowMultiOptionRsvp": {
            "type": "boolean"
          },
          "allowRsvpNotes": {
            "type": "boolean"
          },
          "rsvpEnabled": {
            "type": "boolean"
          },
          "ticketsEnabled": {
            "type": "boolean"
          },
          "cost": {
            "type": "integer"
          },
          "photoUrl": {
            "type": "string",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "customers_only",
              "invite_only"
            ]
          },
          "inviteAccessMode": {
            "type": "string",
            "enum": [
              "link",
              "customer_list"
            ]
          },
          "isPublished": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "questionnaireFormId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "questionnaireTiming": {
            "type": "string",
            "enum": [
              "none",
              "during_rsvp",
              "after_rsvp"
            ]
          },
          "questionnaireRequired": {
            "type": "boolean"
          }
        }
      },
      "V1SocialEventRsvpOption": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "socialEventId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "isPublic": {
            "type": "boolean"
          },
          "maxAttendees": {
            "type": "integer",
            "nullable": true
          },
          "sortOrder": {
            "type": "integer"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "socialEventId",
          "label",
          "amount",
          "isPublic",
          "maxAttendees",
          "sortOrder",
          "isActive",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1SocialEventRsvpOptionsPut": {
        "type": "object",
        "properties": {
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "amount": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 0
                },
                "isPublic": {
                  "type": "boolean"
                },
                "maxAttendees": {
                  "type": "integer",
                  "nullable": true
                },
                "sortOrder": {
                  "type": "integer"
                },
                "isActive": {
                  "type": "boolean"
                }
              },
              "required": [
                "label"
              ]
            }
          }
        },
        "required": [
          "options"
        ]
      },
      "V1SocialEventInvitesCreate": {
        "type": "object",
        "properties": {
          "customerIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1
          }
        },
        "required": [
          "customerIds"
        ]
      },
      "V1SocialEventRsvp": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "socialEventId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "rsvpOptionId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "socialEventId",
          "customerId",
          "rsvpOptionId",
          "status",
          "notes",
          "createdAt"
        ]
      },
      "V1SocialEventOptionAudiencePut": {
        "type": "object",
        "properties": {
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "customerIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "V1SocialEventsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1SocialEvent"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1SocialEventResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1SocialEvent"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1SocialEventRsvpOptionsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1SocialEventRsvpOption"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1SocialEventRsvpOptionsItemResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1SocialEventRsvpOption"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "V1SocialEventRsvpsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1SocialEventRsvp"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1SocialEventInvite": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "customerId",
          "createdAt"
        ]
      },
      "V1SocialEventInvitesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1SocialEventInvite"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1SocialEventInvitesCreateResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "added": {
                "type": "integer"
              }
            },
            "required": [
              "added"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1SocialEventOptionAudienceResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "success"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1DeletedOk": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "deleted": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "id",
              "deleted"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1InviteDeletedOk": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "customerId": {
                "type": "string",
                "format": "uuid"
              },
              "deleted": {
                "type": "boolean",
                "enum": [
                  true
                ]
              }
            },
            "required": [
              "customerId",
              "deleted"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1MarketingAssetsLinkPhotosResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "added": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              }
            },
            "required": [
              "added",
              "skipped"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1AssetFolder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "parentId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "parentId",
          "name",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1AssetFolderCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "parentId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        },
        "required": [
          "name"
        ]
      },
      "V1AssetFolderUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "parentId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        }
      },
      "V1MarketingAsset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string"
          },
          "folderId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "mediaId": {
            "type": "string",
            "format": "uuid"
          },
          "sourcePhotoId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "proxyUrl": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "size": {
            "type": "integer",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "teamId",
          "folderId",
          "mediaId",
          "sourcePhotoId",
          "name",
          "description",
          "proxyUrl",
          "contentType",
          "size",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1MarketingAssetCreate": {
        "type": "object",
        "properties": {
          "mediaProxyUrl": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "folderId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "mediaProxyUrl",
          "name"
        ]
      },
      "V1MarketingAssetUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "folderId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        }
      },
      "V1MarketingAssetsLinkPhotos": {
        "type": "object",
        "properties": {
          "photoIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1
          },
          "folderId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        },
        "required": [
          "photoIds"
        ]
      },
      "V1AssetFoldersResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1AssetFolder"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1AssetFolderResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1AssetFolder"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1MarketingAssetsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1MarketingAsset"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1MarketingAssetResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1MarketingAsset"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CalendarItem": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "campaign",
              "social_event",
              "social_post"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "startAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "channel": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "kind",
          "id",
          "title",
          "startAt",
          "endAt",
          "status",
          "channel"
        ]
      },
      "V1CalendarResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CalendarItem"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "V1EventTypeConfig": {
        "type": "object",
        "properties": {
          "hasChecklist": {
            "type": "boolean"
          },
          "hasPhotoRules": {
            "type": "boolean"
          },
          "requiresSignature": {
            "type": "boolean"
          },
          "odometerRequired": {
            "type": "boolean"
          },
          "fuelLevelRequired": {
            "type": "boolean"
          },
          "requiresParkingSpot": {
            "type": "boolean"
          },
          "removesParkingSpotOnComplete": {
            "type": "boolean"
          },
          "hasVinScanning": {
            "type": "boolean"
          },
          "allowCreateCarOnVin": {
            "type": "boolean"
          },
          "isTransportWorkflow": {
            "type": "boolean"
          },
          "allowsCustomerScheduling": {
            "type": "boolean"
          }
        },
        "required": [
          "hasChecklist",
          "hasPhotoRules",
          "requiresSignature",
          "odometerRequired",
          "fuelLevelRequired",
          "requiresParkingSpot",
          "removesParkingSpotOnComplete",
          "hasVinScanning",
          "allowCreateCarOnVin",
          "isTransportWorkflow",
          "allowsCustomerScheduling"
        ]
      },
      "V1EventType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "scope": {
            "type": "string",
            "enum": [
              "vehicle",
              "customer",
              "facility"
            ]
          },
          "vehicleRequired": {
            "type": "boolean"
          },
          "config": {
            "$ref": "#/components/schemas/V1EventTypeConfig"
          }
        },
        "required": [
          "id",
          "name",
          "value",
          "description",
          "scope",
          "vehicleRequired",
          "config"
        ]
      },
      "V1EventTypesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1EventType"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CarEventCreate": {
        "type": "object",
        "properties": {
          "eventTypeId": {
            "type": "string",
            "format": "uuid"
          },
          "activityType": {
            "type": "string",
            "minLength": 1
          },
          "parkingSpotId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "parkingZoneId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "uploaded",
              "completed"
            ]
          }
        }
      },
      "V1CarEvent": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "appointmentId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "eventTypeName": {
            "type": "string"
          },
          "activityType": {
            "type": "string",
            "nullable": true
          },
          "carLabel": {
            "type": "string",
            "nullable": true
          },
          "spotName": {
            "type": "string",
            "nullable": true
          },
          "zoneName": {
            "type": "string",
            "nullable": true
          },
          "navigationUrl": {
            "type": "string"
          }
        },
        "required": [
          "sessionId",
          "appointmentId",
          "eventTypeName",
          "activityType",
          "navigationUrl"
        ]
      },
      "V1CarEventResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CarEvent"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CarPhotoCreate": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "contentType": {
            "type": "string",
            "minLength": 1
          },
          "dataBase64": {
            "type": "string",
            "minLength": 1
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "photoRuleLocation": {
            "type": "string",
            "nullable": true
          },
          "photoRuleNotes": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "filename",
          "contentType"
        ]
      },
      "V1CarPhoto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "blobUrl": {
            "type": "string"
          },
          "filename": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "size": {
            "type": "integer",
            "nullable": true
          },
          "photoRuleLocation": {
            "type": "string",
            "nullable": true
          },
          "photoRuleNotes": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "sessionId",
          "blobUrl",
          "filename",
          "contentType",
          "size",
          "photoRuleLocation",
          "photoRuleNotes",
          "createdAt"
        ]
      },
      "V1CarPhotoResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1CarPhoto"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1CarPhotosResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CarPhoto"
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1BillingPrice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "amountCents": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "billingInterval": {
            "type": "string",
            "nullable": true
          },
          "billingIntervalCount": {
            "type": "integer",
            "nullable": true
          },
          "paymentMethod": {
            "type": "string",
            "nullable": true,
            "description": "`base`, `card`, or `ach`."
          },
          "isCurrentPrice": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "amountCents",
          "currency",
          "billingInterval",
          "billingIntervalCount",
          "paymentMethod",
          "isCurrentPrice"
        ]
      },
      "V1BillingProduct": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "locationId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "description": "`recurring` or `one_off`."
          },
          "priceCents": {
            "type": "integer",
            "nullable": true
          },
          "currency": {
            "type": "string"
          },
          "billingInterval": {
            "type": "string",
            "nullable": true
          },
          "billingIntervalCount": {
            "type": "integer",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1BillingPrice"
            }
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "locationId",
          "name",
          "description",
          "type",
          "priceCents",
          "currency",
          "billingInterval",
          "billingIntervalCount",
          "isActive",
          "prices",
          "updatedAt"
        ]
      },
      "V1BillingProductsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1BillingProduct"
            }
          },
          "page": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1BillingSubscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "carId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "`active`, `paused`, `past_due`, `unpaid`, `canceled`, …"
          },
          "currentPriceCents": {
            "type": "integer",
            "nullable": true
          },
          "currentPeriodStart": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "currentPeriodEnd": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "canceledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "stripeSubscriptionId": {
            "type": "string",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "productId": {
                  "type": "string",
                  "format": "uuid"
                },
                "productName": {
                  "type": "string",
                  "nullable": true
                },
                "carId": {
                  "type": "string",
                  "nullable": true,
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer"
                },
                "netAmountCents": {
                  "type": "integer",
                  "nullable": true
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "productId",
                "productName",
                "carId",
                "quantity",
                "netAmountCents",
                "currency"
              ]
            }
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "customerId",
          "productId",
          "productName",
          "carId",
          "status",
          "currentPriceCents",
          "currentPeriodStart",
          "currentPeriodEnd",
          "cancelAtPeriodEnd",
          "canceledAt",
          "stripeSubscriptionId",
          "items",
          "createdAt",
          "updatedAt"
        ]
      },
      "V1BillingSubscriptionsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1BillingSubscription"
            }
          },
          "page": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "data",
          "page",
          "limit",
          "total"
        ]
      },
      "V1BillingSubscriptionResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1BillingSubscription"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1BillingInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stripe invoice id (`in_…`)."
          },
          "number": {
            "type": "string",
            "nullable": true
          },
          "customerId": {
            "type": "string",
            "nullable": true,
            "format": "uuid",
            "description": "Car Storage Software customer id, when linked."
          },
          "status": {
            "type": "string",
            "nullable": true,
            "description": "`draft`, `open`, `paid`, `void`, or `uncollectible`."
          },
          "currency": {
            "type": "string"
          },
          "totalCents": {
            "type": "integer"
          },
          "amountDueCents": {
            "type": "integer"
          },
          "amountPaidCents": {
            "type": "integer"
          },
          "amountRemainingCents": {
            "type": "integer"
          },
          "dueDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "paidAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "hostedInvoiceUrl": {
            "type": "string",
            "nullable": true
          },
          "subscriptionId": {
            "type": "string",
            "nullable": true,
            "description": "Stripe subscription id, when recurring."
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "nullable": true
                },
                "amountCents": {
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer",
                  "nullable": true
                }
              },
              "required": [
                "description",
                "amountCents",
                "quantity"
              ]
            }
          }
        },
        "required": [
          "id",
          "number",
          "customerId",
          "status",
          "currency",
          "totalCents",
          "amountDueCents",
          "amountPaidCents",
          "amountRemainingCents",
          "dueDate",
          "createdAt",
          "paidAt",
          "hostedInvoiceUrl",
          "subscriptionId"
        ]
      },
      "V1BillingInvoicesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1BillingInvoice"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextStartingAfter": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "hasMore",
          "nextStartingAfter"
        ]
      },
      "V1BillingInvoiceResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1BillingInvoice"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1BillingActionResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "success"
            ],
            "additionalProperties": {
              "nullable": true
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "V1BillingCustomerSummary": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "hasStripeCustomer": {
            "type": "boolean"
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "openInvoiceCount": {
            "type": "integer"
          },
          "amountDueCents": {
            "type": "integer"
          },
          "pastDueInvoiceCount": {
            "type": "integer"
          },
          "pastDueAmountCents": {
            "type": "integer"
          },
          "activeSubscriptionCount": {
            "type": "integer"
          },
          "hasDefaultPaymentMethod": {
            "type": "boolean"
          }
        },
        "required": [
          "customerId",
          "hasStripeCustomer",
          "currency",
          "openInvoiceCount",
          "amountDueCents",
          "pastDueInvoiceCount",
          "pastDueAmountCents",
          "activeSubscriptionCount",
          "hasDefaultPaymentMethod"
        ]
      },
      "V1BillingCustomerSummaryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1BillingCustomerSummary"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1BillingPlanChangeResult": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/V1BillingPlanChange"
          }
        },
        "required": [
          "data"
        ]
      },
      "V1BillingPlanChange": {
        "type": "object",
        "properties": {
          "applied": {
            "type": "boolean",
            "description": "False for a preview (nothing changed); true once applied."
          },
          "summary": {
            "type": "string",
            "description": "Plain-language description to show the user before confirming."
          },
          "action": {
            "type": "string",
            "description": "Short form, e.g. `Add Valet at $50.00`."
          },
          "previewToken": {
            "type": "string",
            "description": "Pass back with `confirm: true` to apply exactly this change."
          },
          "customerName": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "description": "Billing period, e.g. `month` or `3 months`."
          },
          "nextBillAt": {
            "type": "string",
            "nullable": true,
            "description": "When the change takes effect (next bill)."
          },
          "before": {
            "type": "object",
            "properties": {
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "lineId": {
                      "type": "string"
                    },
                    "productName": {
                      "type": "string"
                    },
                    "unitAmountCents": {
                      "type": "integer"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "carLabel": {
                      "type": "string",
                      "nullable": true
                    },
                    "change": {
                      "type": "string",
                      "enum": [
                        "added",
                        "removed",
                        "price_changed",
                        "swapped_in",
                        "swapped_out"
                      ]
                    }
                  },
                  "required": [
                    "lineId",
                    "productName",
                    "unitAmountCents",
                    "quantity",
                    "carLabel"
                  ]
                }
              },
              "totalCents": {
                "type": "integer"
              }
            },
            "required": [
              "lines",
              "totalCents"
            ]
          },
          "after": {
            "type": "object",
            "properties": {
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "lineId": {
                      "type": "string"
                    },
                    "productName": {
                      "type": "string"
                    },
                    "unitAmountCents": {
                      "type": "integer"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "carLabel": {
                      "type": "string",
                      "nullable": true
                    },
                    "change": {
                      "type": "string",
                      "enum": [
                        "added",
                        "removed",
                        "price_changed",
                        "swapped_in",
                        "swapped_out"
                      ]
                    }
                  },
                  "required": [
                    "lineId",
                    "productName",
                    "unitAmountCents",
                    "quantity",
                    "carLabel"
                  ]
                }
              },
              "totalCents": {
                "type": "integer"
              }
            },
            "required": [
              "lines",
              "totalCents"
            ]
          },
          "newPriceWillBeCreated": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "description": "Set once applied."
          }
        },
        "required": [
          "applied",
          "summary",
          "action",
          "previewToken",
          "customerName",
          "currency",
          "interval",
          "nextBillAt",
          "before",
          "after",
          "newPriceWillBeCreated"
        ]
      },
      "V1BillingNextBillChargesCreated": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "billingOption": {
                "type": "string",
                "enum": [
                  "next_bill"
                ]
              },
              "charges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Next-bill charge id."
                    },
                    "onOpenBill": {
                      "type": "boolean",
                      "description": "True when the plan's bill was already being prepared and the line went straight onto it."
                    }
                  },
                  "required": [
                    "id",
                    "onOpenBill"
                  ]
                }
              },
              "plan": {
                "type": "object",
                "properties": {
                  "subscriptionId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Plan id from `list_billing_subscriptions`."
                  },
                  "name": {
                    "type": "string"
                  },
                  "nextBillAt": {
                    "type": "string",
                    "description": "When the plan's next bill is created (ISO 8601)."
                  },
                  "currency": {
                    "type": "string"
                  }
                },
                "required": [
                  "subscriptionId",
                  "name",
                  "nextBillAt",
                  "currency"
                ]
              }
            },
            "required": [
              "billingOption",
              "charges",
              "plan"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "V1BillingInvoiceCreated": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/V1BillingInvoice"
              },
              {
                "type": "object",
                "properties": {
                  "dashboardUrl": {
                    "type": "string",
                    "description": "The draft in Payments, where staff can review and send it."
                  }
                },
                "required": [
                  "dashboardUrl"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ]
      }
    },
    "parameters": {}
  },
  "paths": {
    "/api/v1/cars": {
      "get": {
        "summary": "List cars",
        "description": "Requires `read:cars`. List the facility's cars.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "cars returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create car",
        "description": "Requires `write:cars`. Create a car record.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CarCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cars/{id}": {
      "get": {
        "summary": "Get car",
        "description": "Requires `read:cars`.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update car",
        "description": "Requires `write:cars`.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CarUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete car",
        "description": "Requires `write:cars`.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/event-types": {
      "get": {
        "summary": "List event types",
        "description": "Requires `read:cars` or `read:appointments`. List the facility's active event types (Vehicle Drop Off, Pickup, Interior Cleaning, etc.): the reusable events the team does now as car events or schedules for later as appointments. `config.requiresParkingSpot` is true for types that need a parking spot or zone.",
        "tags": [
          "Event types"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "vehicle",
                "customer",
                "facility"
              ]
            },
            "required": false,
            "name": "scope",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Event types.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EventTypesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cars/{id}/events": {
      "post": {
        "summary": "Create car event (drop-off / intake)",
        "description": "Requires `write:cars`. Records an event done at the facility now (drop-off, pickup, cleaning…), with a photo session; scheduling for later is an appointment. Pass `activityType` (e.g. `vehicle_drop_off`) or `eventTypeId`. A drop-off takes exactly one of `parkingSpotId` or `parkingZoneId`, and assigning parking also needs the write:parking scope. Optional `occurredAt` backdates the event. The default status `uploaded` leaves the session open for photos.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CarEventCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Event created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarEventResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cars/{id}/photos": {
      "get": {
        "summary": "List car photos",
        "description": "Requires `read:cars`. List photos attached to the car's event sessions (facility gallery), newest first. Optional `sessionId` filter.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "sessionId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Photos.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarPhotosResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Upload car photo",
        "description": "Requires `write:cars`. Attach one image to a car's photo gallery, in a JSON body. Takes `dataBase64` or a public `sourceUrl`, plus `filename` and `contentType`. `sessionId` picks the car event session; without it, an open session is reused or a documentation session is created. Up to about 3MB per image, one image per call.",
        "tags": [
          "Cars"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CarPhotoCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Photo attached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CarPhotoResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers": {
      "get": {
        "summary": "List customers",
        "description": "Requires `read:customers`.",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "includeDeleted",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "customers returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CustomersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create customer",
        "description": "Requires `write:customers`.",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CustomerCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}": {
      "get": {
        "summary": "Get customer",
        "description": "Requires `read:customers`.",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update customer",
        "description": "Requires `write:customers`.",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CustomerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete customer",
        "description": "Requires `write:customers`. Archives the customer (`deletedAt`) and disconnects them: live recurring plans are canceled, open and draft invoices voided, cars archived and open agreements voided. If the customer has live plans or open invoices the key also needs `write:billing`, and if they have cars it needs `write:cars`; otherwise it returns 403. Restore with PATCH `{ \"restore\": true }` or `{ \"deletedAt\": null }`.",
        "tags": [
          "Customers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts": {
      "get": {
        "summary": "List contacts",
        "description": "Requires `read:contacts`.",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "customerId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "contacts returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ContactsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create contact",
        "description": "Requires `write:contacts`.",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ContactCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ContactResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts/{id}": {
      "get": {
        "summary": "Get contact",
        "description": "Requires `read:contacts`.",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ContactResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update contact",
        "description": "Requires `write:contacts`.",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ContactUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ContactResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete contact",
        "description": "Requires `write:contacts`. Permanently deletes the record.",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/locations": {
      "get": {
        "summary": "List locations",
        "description": "Requires `read:locations`.",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "includeInactive",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "locations returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1LocationsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create location",
        "description": "Requires `write:locations`.",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1LocationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1LocationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/locations/{id}": {
      "get": {
        "summary": "Get location",
        "description": "Requires `read:locations`.",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1LocationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update location",
        "description": "Requires `write:locations`.",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1LocationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1LocationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete location",
        "description": "Requires `write:locations`. Soft-deactivates by default (`isActive: false`). Pass `hard=true` to hard-delete.",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "hard",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parking-zones": {
      "get": {
        "summary": "List parking zones",
        "description": "Requires `read:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "parking zones returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingZonesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create parking zone",
        "description": "Requires `write:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ParkingZoneCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingZoneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parking-zones/{id}": {
      "get": {
        "summary": "Get parking zone",
        "description": "Requires `read:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingZoneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update parking zone",
        "description": "Requires `write:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ParkingZoneUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingZoneResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete parking zone",
        "description": "Requires `write:parking`. Soft-deactivates by default (`isActive: false`). Pass `hard=true` to hard-delete.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "hard",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parking-spots": {
      "get": {
        "summary": "List parking spots",
        "description": "Requires `read:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "parking spots returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingSpotsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create parking spot",
        "description": "Requires `write:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ParkingSpotCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingSpotResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parking-spots/{id}": {
      "get": {
        "summary": "Get parking spot",
        "description": "Requires `read:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingSpotResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update parking spot",
        "description": "Requires `write:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ParkingSpotUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingSpotResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete parking spot",
        "description": "Requires `write:parking`. Soft-deactivates by default (`isActive: false`). Pass `hard=true` to hard-delete.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "hard",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parking-assignments": {
      "get": {
        "summary": "List parking assignments",
        "description": "Requires `read:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "carId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "parkingSpotId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "parking assignments returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingAssignmentsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create parking assignment",
        "description": "Requires `write:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ParkingAssignmentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingAssignmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/parking-assignments/{id}": {
      "get": {
        "summary": "Get parking assignment",
        "description": "Requires `read:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingAssignmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update parking assignment",
        "description": "Requires `write:parking`.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ParkingAssignmentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ParkingAssignmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete parking assignment",
        "description": "Requires `write:parking`. Permanently deletes the record.",
        "tags": [
          "Parking"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/templates": {
      "get": {
        "summary": "List marketing templates",
        "description": "Requires `read:templates`. Team-wide reusable email template library (not per-campaign content).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "marketing templates returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingTemplatesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create marketing template",
        "description": "Requires `write:templates`. Create a library template (`name`, `subject`, `body`, optional `designJson` / `isDefault`).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1MarketingTemplateCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingTemplateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/templates/{id}": {
      "get": {
        "summary": "Get marketing template",
        "description": "Requires `read:templates`. Includes `designJson` when present.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingTemplateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update marketing template",
        "description": "Requires `write:templates`. Patch library template fields.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1MarketingTemplateUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingTemplateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete marketing template",
        "description": "Requires `write:templates`. Permanently deletes the library template.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns": {
      "get": {
        "summary": "List campaigns",
        "description": "Requires `read:campaigns`. Filter with `status`, `channel`, `ids`, `updatedAfter`, `page`, `limit`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "channel",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "campaigns returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create campaign",
        "description": "Requires `write:campaigns`. Creates a **draft** email, SMS or push campaign. A campaign goes live only after it has content and an audience and is scheduled or sent. Social media posts are separate from campaigns.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}": {
      "get": {
        "summary": "Get campaign",
        "description": "Requires `read:campaigns`. Campaign detail plus a `stats` summary (sent/failed/queued counts).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update campaign",
        "description": "Requires `write:campaigns`. Updates a campaign's draft fields. It can't change the status: scheduling, sending, pausing, resuming and cancelling each have their own action.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete campaign",
        "description": "Requires `write:campaigns`. Cancels pending provider messages, then hard-deletes the campaign (and cascaded steps/audience).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/content": {
      "get": {
        "summary": "List campaign content steps",
        "description": "Requires `read:campaigns`. Ordered campaign steps (email/sms/push body). Single-channel wizards usually have one step.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List campaign content steps",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignStepsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create campaign content step",
        "description": "Requires `write:campaigns`. Body: `type`, channel `content`, optional `templateId` (copies/links a library template), `order`, `scheduledAt`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignStepCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create campaign content step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignStepResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/content/{stepId}": {
      "get": {
        "summary": "Get campaign content step",
        "description": "Requires `read:campaigns`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "stepId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get campaign content step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignStepResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update campaign content step",
        "description": "Requires `write:campaigns`. Patch step type/content/order/schedule/templateId.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "stepId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignStepUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update campaign content step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignStepResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete campaign content step",
        "description": "Requires `write:campaigns`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "stepId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete campaign content step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/audience": {
      "get": {
        "summary": "List campaign audience",
        "description": "Requires `read:campaigns`. Enrolled customers for the campaign.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List campaign audience",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignAudiencesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add campaign audience members",
        "description": "Requires `write:campaigns`. Body `{ customerIds }`. On an active campaign, only newly added members are scheduled.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignAudienceBulkCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Add campaign audience members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignAudienceBulkResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/audience/{audienceId}": {
      "delete": {
        "summary": "Remove campaign audience member",
        "description": "Requires `write:campaigns`. Removes one enrollment by audience row id.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "audienceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Remove campaign audience member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/audience/remove": {
      "post": {
        "summary": "Bulk remove audience members",
        "description": "Requires `write:campaigns`. Body `{ customerIds }`: removes those customers from the campaign's audience.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignAudienceBulkCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk remove audience members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignAudienceBulkResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/schedule": {
      "post": {
        "summary": "Schedule campaign send",
        "description": "Requires `write:campaigns`. Body `{ scheduledAt }`, at least about 30 minutes ahead. Checks the campaign is ready, then schedules it to send at that time.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignSchedule"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Schedule campaign send",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/send": {
      "post": {
        "summary": "Send campaign now",
        "description": "Requires `write:campaigns`. Sends the campaign now by email, SMS or push, after checking its content and audience.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Send campaign now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/cancel": {
      "post": {
        "summary": "Cancel scheduled campaign",
        "description": "Requires `write:campaigns`. Cancels a queued send (≥15 minutes before send when enforced).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancel scheduled campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/pause": {
      "post": {
        "summary": "Pause campaign",
        "description": "Requires `write:campaigns`. Pauses an active campaign and cancels scheduled provider messages.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Pause campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/resume": {
      "post": {
        "summary": "Resume campaign",
        "description": "Requires `write:campaigns`. Resumes a paused campaign after readiness checks.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Resume campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/duplicate": {
      "post": {
        "summary": "Duplicate campaign",
        "description": "Requires `write:campaigns`. Clones campaign + steps into a new draft (no audience, no send).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "201": {
            "description": "Duplicate campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/preview": {
      "get": {
        "summary": "Preview campaign readiness",
        "description": "Requires `read:campaigns`. Publish readiness without sending — audience size, validation errors, step count.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Preview campaign readiness",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignPreviewResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/{id}/activity": {
      "get": {
        "summary": "Campaign activity",
        "description": "Requires `read:campaigns`. Paginated delivery activity (status/channel filters). No provider ids or full message bodies.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "channel",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignActivityResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-posts": {
      "get": {
        "summary": "List social posts",
        "description": "Requires `read:campaigns`. The facility's Instagram, Facebook and other social media posts.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "social posts returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialPostsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create social post",
        "description": "Requires `write:campaigns`. Body: `body`, `accountIds`, optional `mediaUrls`, `scheduledAt`, `publishNow`. Creates, schedules or publishes a post on the facility's connected social accounts.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialPostCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialPostResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-posts/{id}": {
      "get": {
        "summary": "Get social post",
        "description": "Requires `read:campaigns`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialPostResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update social post",
        "description": "Requires `write:campaigns`. Update a post's draft content or its scheduled time.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialPostUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialPostResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete social post",
        "description": "Requires `write:campaigns`. Deletes the post, including from the social scheduler.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-accounts": {
      "get": {
        "summary": "List connected social accounts",
        "description": "Requires `read:campaigns`. The facility's connected social media accounts (`id`, `platform`, `username`). A post's `accountIds` are these ids.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialAccountsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/test/email": {
      "post": {
        "summary": "Send test email",
        "description": "Requires `write:campaigns`. One-off test email (`to`, `subject`, `html`). Does not publish a campaign. `to` must be a team member or customer email for this facility.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignTestEmail"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignTestEmailResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/test/sms": {
      "post": {
        "summary": "Send test SMS",
        "description": "Requires `write:campaigns`. One-off test SMS (`to`, `body`, optional `mediaUrls` as team `/api/media/{uuid}` paths only). Does not publish a campaign. `to` must be a team member or customer phone for this facility.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignTestSms"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignTestSmsResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/campaigns/test/push": {
      "post": {
        "summary": "Send test push notification",
        "description": "Requires `write:campaigns`. One-off test push (`title`, `body`, optional `url`). Provide `customerId` (portal-linked) or `userId`. Does not publish a campaign.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CampaignTestPush"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CampaignTestPushResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/forms": {
      "get": {
        "summary": "List forms",
        "description": "Requires `read:forms`. Staff form definitions. Public submit stays on `/api/forms/...` (not this surface).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "forms returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create form",
        "description": "Requires `write:forms`. Create a staff-managed form definition.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1FormCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/forms/{id}": {
      "get": {
        "summary": "Get form",
        "description": "Requires `read:forms`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update form",
        "description": "Requires `write:forms`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1FormUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete form",
        "description": "Requires `write:forms`. Deletes the form definition (submissions may cascade).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/forms/{id}/submissions": {
      "get": {
        "summary": "List form submissions",
        "description": "Requires `read:forms`. Paginated submissions for a form.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Submissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormSubmissionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Submit form response",
        "description": "Requires `write:forms`. Send a response from your own website or app (server-side; keep the key secret). The form must be published and open. Runs the same checks as the hosted form: required fields, one response per email unless the form allows more, matching or creating the customer from `respondentEmail`, creating vehicles/contacts the form collects, and emailing the form's staff recipients.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1FormSubmissionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved submission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormSubmissionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/forms/{id}/submissions/{submissionId}": {
      "get": {
        "summary": "Get form submission",
        "description": "Requires `read:forms`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "submissionId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Submission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormSubmissionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Link or unlink submission customer",
        "description": "Requires `write:forms`. Body `{ customerId }` only — link or unlink a customer on the submission (`null` to unlink).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "submissionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1FormSubmissionPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1FormSubmissionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events": {
      "get": {
        "summary": "List social events",
        "description": "Requires `read:social-events`. Staff RSVP events. Filter with `status`, `upcomingOnly`, pagination.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "upcomingOnly",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "social events returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create social event",
        "description": "Requires `write:social-events`. Create a staff social event (RSVP party). Public RSVP/checkout stay on public routes.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialEventCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}": {
      "get": {
        "summary": "Get social event",
        "description": "Requires `read:social-events`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update social event",
        "description": "Requires `write:social-events`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialEventUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete social event",
        "description": "Requires `write:social-events`. Deletes the event and related staff data.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}/duplicate": {
      "post": {
        "summary": "Duplicate social event",
        "description": "Requires `write:social-events`. Clones the event (and options where applicable) into a new draft.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "201": {
            "description": "Duplicated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}/rsvp-options": {
      "get": {
        "summary": "List RSVP options",
        "description": "Requires `read:social-events`. Ticket/RSVP options for the event (includes inactive).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventRsvpOptionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Replace RSVP options",
        "description": "Requires `write:social-events`. Body `{ options: [...] }`: replaces the event's RSVP options with this list.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialEventRsvpOptionsPut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventRsvpOptionsItemResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}/invites": {
      "get": {
        "summary": "List event invites",
        "description": "Requires `read:social-events`. Allowed customers for invite-only events.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventInvitesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add event invites",
        "description": "Requires `write:social-events`. Body `{ customerIds }` adds allowed invitees.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialEventInvitesCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventInvitesCreateResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}/invites/{customerId}": {
      "delete": {
        "summary": "Remove event invite",
        "description": "Requires `write:social-events`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "customerId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1InviteDeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}/rsvps": {
      "get": {
        "summary": "List event RSVPs",
        "description": "Requires `read:social-events`. Read-only RSVP roster (no attendee-facing mutate from API keys).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "RSVPs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventRsvpsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/social-events/{id}/rsvp-options/{optionId}/audience": {
      "put": {
        "summary": "Set RSVP option audience",
        "description": "Requires `write:social-events`. Body optional `tagIds` / `customerIds` — replaces allowed tags/customers for that option.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "optionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1SocialEventOptionAudiencePut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1SocialEventOptionAudienceResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/asset-folders": {
      "get": {
        "summary": "List asset folders",
        "description": "Requires `read:marketing-assets`. Browse folders (optional parent filter via query when supported).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "asset folders returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AssetFoldersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create asset folder",
        "description": "Requires `write:marketing-assets`. Body `{ name, parentId? }`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1AssetFolderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AssetFolderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/asset-folders/{id}": {
      "get": {
        "summary": "Get asset folder",
        "description": "Requires `read:marketing-assets`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AssetFolderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update asset folder",
        "description": "Requires `write:marketing-assets`. Rename or move (`parentId`).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1AssetFolderUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AssetFolderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete asset folder",
        "description": "Requires `write:marketing-assets`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/assets": {
      "get": {
        "summary": "List marketing assets",
        "description": "Requires `read:marketing-assets`. List assets (folder/search filters when supported).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "marketing assets returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingAssetsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create marketing asset",
        "description": "Requires `write:marketing-assets`. Create from an existing media proxy URL (`mediaProxyUrl`, `name`, optional `folderId`).",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1MarketingAssetCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingAssetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/assets/{id}": {
      "get": {
        "summary": "Get marketing asset",
        "description": "Requires `read:marketing-assets`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingAssetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update marketing asset",
        "description": "Requires `write:marketing-assets`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1MarketingAssetUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingAssetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete marketing asset",
        "description": "Requires `write:marketing-assets`.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/assets/upload": {
      "post": {
        "summary": "Upload marketing asset",
        "description": "Requires `write:marketing-assets`. Multipart form with `file` (optional `folderId`, `name`, `description`). Stores blob + media + asset row.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingAssetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/assets/link-photos": {
      "post": {
        "summary": "Link platform photos as assets",
        "description": "Requires `write:marketing-assets`. Body `{ photoIds, folderId? }` links existing platform photos into the asset library.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1MarketingAssetsLinkPhotos"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Linked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1MarketingAssetsLinkPhotosResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketing/calendar": {
      "get": {
        "summary": "Marketing calendar aggregate",
        "description": "Requires `read:campaigns` or `read:social-events`. Query `from`/`to` (ISO). Returns typed items `{ kind: campaign|social_event|social_post, ... }` for the date range. Either read scope is enough; each kind is included only when that scope is present.",
        "tags": [
          "Marketing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CalendarResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communication-threads": {
      "get": {
        "summary": "List communication threads",
        "description": "Requires `read:communications`.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "communication threads returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationThreadsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create communication thread",
        "description": "Requires `write:communications`. `externalPhone` (or `customerId`) must match a facility customer contact — arbitrary phone/email addresses are rejected.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CommunicationThreadCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationThreadResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communication-threads/{id}": {
      "get": {
        "summary": "Get communication thread",
        "description": "Requires `read:communications`.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationThreadResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update communication thread",
        "description": "Requires `write:communications`. Changing recipient fields re-validates against team customers.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CommunicationThreadUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationThreadResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete communication thread",
        "description": "Requires `write:communications`. Permanently deletes the record.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communication-threads/{id}/messages": {
      "get": {
        "summary": "List thread messages",
        "description": "Requires `read:communications`.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Messages returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationMessagesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create (and optionally send) outbound message",
        "description": "Requires `write:communications`. Defaults to draft (`send: false`). With `send: true` it is delivered by text or email. `mediaUrls` must be https:// or team-owned `/api/media/{uuid}` paths.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CommunicationMessageCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationMessageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communication-messages/{id}": {
      "get": {
        "summary": "Get message",
        "description": "Requires `read:communications`.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationMessageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update message",
        "description": "Requires `write:communications`.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CommunicationMessageUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CommunicationMessageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete message",
        "description": "Requires `write:communications`.",
        "tags": [
          "Communications"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "deleted": {
                          "type": "boolean",
                          "enum": [
                            true
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "deleted"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/appointments": {
      "get": {
        "summary": "List appointments",
        "description": "Requires `read:appointments`. Calendar bookings (scheduled events). Events done on the spot, like a drop-off with photos, are car events, not appointments.",
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "scheduled",
                "pending_approval",
                "accepted",
                "declined",
                "checked_in",
                "in_progress",
                "completed",
                "cancelled",
                "no_show"
              ]
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "customerId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "carId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "appointments returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AppointmentsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create appointment",
        "description": "Requires `write:appointments`. Schedule an event for later, by `eventTypeId`, `eventType` (an event type's `value`) or `appointmentTypeId`. Typed appointments get their event session created right away. Booking an appointment doesn't change parking.",
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1AppointmentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AppointmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/appointments/{id}": {
      "get": {
        "summary": "Get appointment",
        "description": "Requires `read:appointments`.",
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AppointmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update appointment",
        "description": "Requires `write:appointments`.",
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1AppointmentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AppointmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete appointment",
        "description": "Requires `write:appointments`.",
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1DeletedOk"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/products": {
      "get": {
        "summary": "List billing products",
        "description": "Requires `read:billing`. Storage plans and one-off services the facility sells, with their active prices (amounts in cents). Inactive products are hidden unless `includeInactive=true`.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "required": false,
            "name": "includeInactive",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Products.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingProductsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/subscriptions": {
      "get": {
        "summary": "List subscriptions",
        "description": "Requires `read:billing`. Customers' recurring storage subscriptions. Filter with `customerId` or `status` (e.g. `active`, `past_due`, `canceled`).",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "updatedAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "customerId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by status, e.g. `active`."
            },
            "required": false,
            "description": "Filter by status, e.g. `active`.",
            "name": "status",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingSubscriptionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/subscriptions/{id}": {
      "get": {
        "summary": "Get subscription",
        "description": "Requires `read:billing`. One subscription with its line items.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingSubscriptionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/invoices": {
      "get": {
        "summary": "List invoices",
        "description": "Requires `read:billing`. Invoices from the facility's Stripe account, newest first. Cursor pagination: pass the previous response's `nextStartingAfter` as `startingAfter`. Filter with `customerId` (our customer id) or `status`.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Cursor: the last invoice id from the previous page."
            },
            "required": false,
            "description": "Cursor: the last invoice id from the previous page.",
            "name": "startingAfter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false,
            "name": "customerId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "open",
                "paid",
                "void",
                "uncollectible"
              ]
            },
            "required": false,
            "name": "status",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Invoices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingInvoicesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create draft invoice or add to next bill",
        "description": "Requires `write:billing`. Creates a one-off invoice **as a draft** for a customer, from one-time products (default or chosen price, or a custom amount) and/or custom lines (`description` + `amountCents`), with an optional car per line, due date and memo. Nothing is sent or charged; sending is a separate action, and staff can also finish it at `dashboardUrl`. Tax and processing fees follow the facility's settings. With `billingOption: \"next_bill\"` no invoice is created: the lines are added to the customer's next monthly plan bill and charged with it (409 `no_eligible_plan` when there is no active monthly plan).",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customerId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Customer id from `list_customers`."
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "productId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "One-time product (from `list_billing_products`, type `one_off`)."
                        },
                        "priceId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "One of the product's prices; defaults to the product's price."
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500,
                          "description": "Line text. Required for a custom line (no productId), e.g. `Battery tender install`."
                        },
                        "amountCents": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10000000,
                          "description": "Unit price in cents, before tax and processing fees. Required for a custom line; with a productId it overrides the product's price."
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        },
                        "carId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Car this line is for."
                        }
                      }
                    },
                    "minItems": 1,
                    "maxItems": 25
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Due date (YYYY-MM-DD). Defaults to the facility's usual terms."
                  },
                  "memo": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Note shown on the invoice."
                  },
                  "billingOption": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "next_bill"
                    ],
                    "description": "`draft` (default) creates a draft invoice. `next_bill` creates no invoice: each line is added to the customer's next monthly plan bill and charged with it (one charge per line). Answers 409 (`code: no_eligible_plan`) when the customer has no active monthly plan to add to, 409 (`code: out_of_stock`) when a capped product is sold out, 409 (`code: idempotency_conflict`) when `idempotencyKey` was already used for different lines, 409 (`code: busy`) when the plan's add-ons are being changed (retry shortly), or 409 (`code: needs_confirmation`) for a large amount sent without `confirmedLargeAmount: true`. `dueDate` and `memo` are ignored."
                  },
                  "subscriptionId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "`next_bill` only: the plan to add to (from `list_billing_subscriptions`). Defaults to the plan that renews soonest."
                  },
                  "addOnsGetPlanDiscount": {
                    "type": "boolean",
                    "description": "`next_bill` only: when the plan has a percent-off discount on the whole plan, whether these lines get it too. Saved on the plan and used for later add-ons. Without an answer, add-ons pay full price."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "`next_bill` only: send the same key when retrying so each line is stored once."
                  },
                  "confirmedLargeAmount": {
                    "type": "boolean",
                    "description": "`next_bill` only: set to `true` to add a large amount: any line over the facility's line amount, or lines that take the plan's waiting add-ons over its plan amount (set in Billing settings; $10,000 and $25,000 unless changed, and either can be turned off). Without it such a request stores nothing and answers 409 (`code: needs_confirmation`, `details.largeAmount` with the amount and the facility's limit as `thresholdCents`). Confirm with the person asking, then resend with the same `idempotencyKey`."
                  }
                },
                "required": [
                  "customerId",
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Draft invoice created, or (`next_bill`) the lines added to the next bill.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/V1BillingInvoiceCreated"
                    },
                    {
                      "$ref": "#/components/schemas/V1BillingNextBillChargesCreated"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/invoices/{id}": {
      "get": {
        "summary": "Get invoice",
        "description": "Requires `read:billing`. One invoice with its line items and hosted payment link.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Stripe invoice id (`in_…`)."
            },
            "required": true,
            "description": "Stripe invoice id (`in_…`).",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingInvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/invoices/{id}/send": {
      "post": {
        "summary": "Send invoice",
        "description": "Requires `write:billing`. **This emails the customer.** A draft is sent the way staff send it from the invoice page: the customer gets an email and picks how to pay from `allowedPaymentMethods`. An open invoice is emailed again (or, when it's waiting for the customer to choose a payment method, that reminder). It never charges the customer.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Stripe invoice id (`in_…`)."
            },
            "required": true,
            "description": "Stripe invoice id (`in_…`).",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allowedPaymentMethods": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "card",
                        "bank",
                        "cash_check",
                        "bank_transfer"
                      ]
                    },
                    "minItems": 1,
                    "description": "Drafts only: how the customer may pay. Defaults to the invoice's or facility's usual methods."
                  },
                  "notifyCustomer": {
                    "type": "boolean",
                    "description": "Drafts only: email the customer (default true)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email sent (or skipped when nothing is due).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingActionResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/invoices/{id}/void": {
      "post": {
        "summary": "Void invoice",
        "description": "Requires `write:billing`. Voids an open invoice so it is no longer owed, or removes a draft. Cannot be undone. Paid invoices can't be voided (refunds stay in the dashboard).",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Stripe invoice id (`in_…`)."
            },
            "required": true,
            "description": "Stripe invoice id (`in_…`).",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Optional note stored on the invoice."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Voided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingActionResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/customers/{id}": {
      "get": {
        "summary": "Get customer billing summary",
        "description": "Requires `read:billing`. What a customer owes: open and past-due invoice counts and amounts (cents), active subscriptions, and whether a default payment method is on file.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Billing summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingCustomerSummaryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/subscriptions/{id}/add-item": {
      "post": {
        "summary": "Add a line to a plan",
        "description": "Requires `write:billing`. Add a recurring product (e.g. another car's storage at $350/month) to a customer's existing plan. `amountCents` sets a custom price; a matching existing price is reused, otherwise one is created (hidden from the customer shop). Without `confirm`, nothing changes and the response has a plain-language `summary`, the plan `before` and `after`, and a `previewToken`. Calling again with the same arguments plus `confirm: true` and that `previewToken` applies the change. Takes effect with the next bill (no proration, nothing charged now). A stale token (the plan changed since the preview) is refused with 409; preview again.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Subscription id from `list_billing_subscriptions`."
            },
            "required": true,
            "description": "Subscription id from `list_billing_subscriptions`.",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Recurring product to add (from `list_billing_products`)."
                  },
                  "amountCents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000,
                    "description": "Price per billing period in cents (e.g. 35000 = $350.00), before tax and processing fees."
                  },
                  "priceId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "An existing price to use (alternative to `amountCents`)."
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "carId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Car this line bills for."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Leave out (or false) to preview: nothing changes, and the response has a `summary` and `previewToken`. With `confirm: true` and that `previewToken`, the change is applied."
                  },
                  "previewToken": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "From the preview. Required with `confirm: true`; refused if the plan or the change differs from what was previewed."
                  }
                },
                "required": [
                  "productId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview (`applied: false`) or applied change (`applied: true`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingPlanChangeResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/subscriptions/{id}/remove-item": {
      "post": {
        "summary": "Remove a line from a plan",
        "description": "Requires `write:billing`. Remove one line from a customer's plan (e.g. a car that was sold). The only line on a plan can't be removed (cancelling a plan is done in the dashboard). Without `confirm`, nothing changes and the response has a plain-language `summary`, the plan `before` and `after`, and a `previewToken`. Calling again with the same arguments plus `confirm: true` and that `previewToken` applies the change. Takes effect with the next bill (no proration, nothing charged now). A stale token (the plan changed since the preview) is refused with 409; preview again.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Subscription id from `list_billing_subscriptions`."
            },
            "required": true,
            "description": "Subscription id from `list_billing_subscriptions`.",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "line": {
                    "type": "object",
                    "properties": {
                      "lineId": {
                        "type": "string",
                        "pattern": "^si_[A-Za-z0-9]+$",
                        "description": "Plan line id (`si_…`) from a previous preview's `before.lines`."
                      },
                      "productId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Pick the line by its product."
                      },
                      "carId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Pick the line by the car it bills for."
                      }
                    },
                    "description": "Which line of the plan to change. Optional when the plan has one line; otherwise pass one of these."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Leave out (or false) to preview: nothing changes, and the response has a `summary` and `previewToken`. With `confirm: true` and that `previewToken`, the change is applied."
                  },
                  "previewToken": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "From the preview. Required with `confirm: true`; refused if the plan or the change differs from what was previewed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview (`applied: false`) or applied change (`applied: true`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingPlanChangeResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/subscriptions/{id}/change-price": {
      "post": {
        "summary": "Change a line's price",
        "description": "Requires `write:billing`. Change the recurring price of one line (e.g. monthly storage from $350 to $400). Without `confirm`, nothing changes and the response has a plain-language `summary`, the plan `before` and `after`, and a `previewToken`. Calling again with the same arguments plus `confirm: true` and that `previewToken` applies the change. Takes effect with the next bill (no proration, nothing charged now). A stale token (the plan changed since the preview) is refused with 409; preview again.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Subscription id from `list_billing_subscriptions`."
            },
            "required": true,
            "description": "Subscription id from `list_billing_subscriptions`.",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "line": {
                    "type": "object",
                    "properties": {
                      "lineId": {
                        "type": "string",
                        "pattern": "^si_[A-Za-z0-9]+$",
                        "description": "Plan line id (`si_…`) from a previous preview's `before.lines`."
                      },
                      "productId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Pick the line by its product."
                      },
                      "carId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Pick the line by the car it bills for."
                      }
                    },
                    "description": "Which line of the plan to change. Optional when the plan has one line; otherwise pass one of these."
                  },
                  "amountCents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000,
                    "description": "Price per billing period in cents (e.g. 35000 = $350.00), before tax and processing fees."
                  },
                  "priceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Leave out (or false) to preview: nothing changes, and the response has a `summary` and `previewToken`. With `confirm: true` and that `previewToken`, the change is applied."
                  },
                  "previewToken": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "From the preview. Required with `confirm: true`; refused if the plan or the change differs from what was previewed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview (`applied: false`) or applied change (`applied: true`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingPlanChangeResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/subscriptions/{id}/swap-product": {
      "post": {
        "summary": "Replace a line's product",
        "description": "Requires `write:billing`. Replace one line's product with another (e.g. indoor storage becomes outdoor storage), keeping its quantity and car. Without `confirm`, nothing changes and the response has a plain-language `summary`, the plan `before` and `after`, and a `previewToken`. Calling again with the same arguments plus `confirm: true` and that `previewToken` applies the change. Takes effect with the next bill (no proration, nothing charged now). A stale token (the plan changed since the preview) is refused with 409; preview again.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Subscription id from `list_billing_subscriptions`."
            },
            "required": true,
            "description": "Subscription id from `list_billing_subscriptions`.",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "line": {
                    "type": "object",
                    "properties": {
                      "lineId": {
                        "type": "string",
                        "pattern": "^si_[A-Za-z0-9]+$",
                        "description": "Plan line id (`si_…`) from a previous preview's `before.lines`."
                      },
                      "productId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Pick the line by its product."
                      },
                      "carId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Pick the line by the car it bills for."
                      }
                    },
                    "description": "Which line of the plan to change. Optional when the plan has one line; otherwise pass one of these."
                  },
                  "newProductId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Product that replaces the line (e.g. outdoor storage replacing indoor storage)."
                  },
                  "amountCents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000,
                    "description": "Price for the new line; defaults to the product's price."
                  },
                  "priceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Leave out (or false) to preview: nothing changes, and the response has a `summary` and `previewToken`. With `confirm: true` and that `previewToken`, the change is applied."
                  },
                  "previewToken": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "From the preview. Required with `confirm: true`; refused if the plan or the change differs from what was previewed."
                  }
                },
                "required": [
                  "newProductId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview (`applied: false`) or applied change (`applied: true`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1BillingPlanChangeResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked, or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "API key missing required scope, or API disabled for team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Payments aren't set up for this facility (no connected Stripe account).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    }
  }
}
