{
  "openapi": "3.0.3",
  "info": {
    "title": "Ressivo API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://ressivo.com/api"
    }
  ],
  "paths": {
    "/auth": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Authenticate",
        "operationId": "users-authentication",
        "requestBody": {
          "description": "Authentication data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/UsernamePassword"
                  },
                  {
                    "$ref": "#/components/schemas/FBAuth"
                  },
                  {
                    "$ref": "#/components/schemas/GoogleAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AppleAuth"
                  },
                  {
                    "$ref": "#/components/schemas/FallbackAuth"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Logout",
        "operationId": "users-authentication-logout",
        "responses": {
          "204": {
            "description": "Success."
          }
        }
      }
    },
    "/auth/password": {
      "put": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Change Password",
        "operationId": "users-change-password",
        "requestBody": {
          "description": "Password Change Data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "password",
                  "newpassword"
                ],
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "newpassword": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/recover": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Request password recovery",
        "operationId": "users-password-recover",
        "requestBody": {
          "description": "Recovery request",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordRecoverRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/recover/confirm": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Confirm password recovery",
        "operationId": "users-password-recover-confirm",
        "requestBody": {
          "description": "Recovery confirmation",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordRecoverConfirm"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/user": {
      "get": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Authentication",
        "operationId": "users-authentication-data",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Auth data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "type",
                    "organizations",
                    "organizationId"
                  ],
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "user",
                        "superadmin"
                      ]
                    },
                    "organizations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "organizationId"
                        ],
                        "properties": {
                          "organizationId": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "organizationId": {
                      "type": "number"
                    },
                    "apps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/generic/countries": {
      "get": {
        "tags": [
          "Generic",
          "Countries"
        ],
        "summary": "Get countries",
        "operationId": "countries",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Countries information list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Country"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get organization",
        "operationId": "get-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Organizations"
        ],
        "summary": "Create organization",
        "operationId": "create-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          },
          {}
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "taxNumber",
                  "email",
                  "password",
                  "app"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "taxNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string"
                  },
                  "address": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      }
                    }
                  },
                  "key": {
                    "type": "string"
                  },
                  "app": {
                    "type": "string",
                    "enum": [
                      "latea",
                      "barn",
                      "ressivo"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Update organization",
        "operationId": "update-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "taxNumber",
                  "email"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  },
                  "taxNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "address": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/all": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get all organizations (superadmin only)",
        "operationId": "get-organizations",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "Search by name or email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max results (default 20, max 50)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "taxNumber": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/configuration": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get organization configuration",
        "operationId": "get-organization-configuration",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "number"
                    },
                    "atUsername": {
                      "type": "string",
                      "nullable": true
                    },
                    "atPassword": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Update organization configuration",
        "operationId": "update-organization-configuration",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Configuration information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "atUsername",
                  "atPassword"
                ],
                "properties": {
                  "atUsername": {
                    "type": "string"
                  },
                  "atPassword": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "number"
                    },
                    "atUsername": {
                      "type": "string",
                      "nullable": true
                    },
                    "atPassword": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/logo": {
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Update organization logo",
        "operationId": "update-organization-logo",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{id}": {
      "delete": {
        "tags": [
          "Organizations"
        ],
        "summary": "Delete organization",
        "operationId": "delete-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Organization id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/availability": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "List availability rules",
        "operationId": "list-ressivo-availability",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of availability rules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoAvailabilityRule"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Create availability rule",
        "operationId": "create-ressivo-availability",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoAvailabilityInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created availability rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoAvailabilityRule"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update availability rule",
        "operationId": "update-ressivo-availability",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoAvailabilityUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated availability rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoAvailabilityRule"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/availability/exceptions": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "List availability exceptions for a date range",
        "operationId": "list-ressivo-availability-exceptions",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "itemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of availability exceptions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoAvailabilityException"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Toggle a slot exception (disable/re-enable)",
        "operationId": "toggle-ressivo-availability-exception",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listingId",
                  "exceptionDate",
                  "slotTime"
                ],
                "properties": {
                  "listingId": {
                    "type": "number"
                  },
                  "exceptionDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "slotTime": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "itemId": {
                    "type": "number",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Toggled exception",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoAvailabilityException"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update exception reason",
        "operationId": "update-ressivo-availability-exception-reason",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated exception",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoAvailabilityException"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/availability/id/{id}": {
      "delete": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Delete availability rule",
        "operationId": "delete-ressivo-availability",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted availability rule"
          }
        }
      }
    },
    "/ressivo/bookings": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "List bookings",
        "operationId": "list-ressivo-bookings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of bookings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoBooking"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Create a booking as an admin (bypasses payment)",
        "operationId": "create-ressivo-admin-booking",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoAdminBookingInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booking created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoBooking"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update booking status",
        "operationId": "update-ressivo-booking",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoBookingUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated booking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoBooking"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/bookings/{id}": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Get booking",
        "operationId": "get-ressivo-booking",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoBooking"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/items": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "List listing items",
        "operationId": "list-ressivo-items",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoItem"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Create listing item",
        "operationId": "create-ressivo-item",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoItemInput"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "listingId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "bookingType": {
                    "type": "string",
                    "enum": [
                      "single",
                      "group"
                    ]
                  },
                  "capacityMin": {
                    "type": "string"
                  },
                  "capacityMax": {
                    "type": "string"
                  },
                  "sharedCapacity": {
                    "type": "boolean"
                  },
                  "pricingMode": {
                    "type": "string",
                    "enum": [
                      "perSlot",
                      "perGuest",
                      "perBooking"
                    ]
                  },
                  "pricePerSlot": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoItem"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update listing item",
        "operationId": "update-ressivo-item",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoItemUpdate"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "listingId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "bookingType": {
                    "type": "string",
                    "enum": [
                      "single",
                      "group"
                    ]
                  },
                  "capacityMin": {
                    "type": "string"
                  },
                  "capacityMax": {
                    "type": "string"
                  },
                  "sharedCapacity": {
                    "type": "boolean"
                  },
                  "pricingMode": {
                    "type": "string",
                    "enum": [
                      "perSlot",
                      "perGuest",
                      "perBooking"
                    ]
                  },
                  "pricePerSlot": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "imageUrl": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoItem"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/items/id/{id}": {
      "delete": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Delete listing item",
        "operationId": "delete-ressivo-item",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted item"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/listings": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "List listings",
        "operationId": "list-ressivo-listings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of listings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoListing"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Create listing",
        "operationId": "create-ressivo-listing",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoListingInput"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "tagline": {
                    "type": "string"
                  },
                  "primaryColor": {
                    "type": "string"
                  },
                  "secondaryColor": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "contactEmail": {
                    "type": "string"
                  },
                  "cancellationPolicyUrl": {
                    "type": "string"
                  },
                  "refundPolicyUrl": {
                    "type": "string"
                  },
                  "daysOfWeek": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "startTime": {
                    "type": "string"
                  },
                  "endTime": {
                    "type": "string"
                  },
                  "slotDuration": {
                    "type": "number"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "logo": {
                    "type": "string",
                    "format": "binary"
                  },
                  "hero": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created listing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoListing"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update listing",
        "operationId": "update-ressivo-listing",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoListingUpdate"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "tagline": {
                    "type": "string"
                  },
                  "primaryColor": {
                    "type": "string"
                  },
                  "secondaryColor": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "contactEmail": {
                    "type": "string"
                  },
                  "cancellationPolicyUrl": {
                    "type": "string"
                  },
                  "refundPolicyUrl": {
                    "type": "string"
                  },
                  "daysOfWeek": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "startTime": {
                    "type": "string"
                  },
                  "endTime": {
                    "type": "string"
                  },
                  "slotDuration": {
                    "type": "number"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "logoFilename": {
                    "type": "string"
                  },
                  "logo": {
                    "type": "string",
                    "format": "binary"
                  },
                  "hero": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated listing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoListing"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/listings/custom-domain": {
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Set or update custom domain on a listing",
        "operationId": "set-ressivo-custom-domain",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listingId",
                  "customDomain"
                ],
                "properties": {
                  "listingId": {
                    "type": "number"
                  },
                  "customDomain": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain set"
          }
        }
      }
    },
    "/ressivo/listings/custom-domain/verify": {
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Verify DNS for custom domain",
        "operationId": "verify-ressivo-custom-domain",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listingId"
                ],
                "properties": {
                  "listingId": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification result"
          }
        }
      }
    },
    "/ressivo/listings/custom-domain/{id}": {
      "delete": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Remove custom domain from listing",
        "operationId": "remove-ressivo-custom-domain",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain removed"
          }
        }
      }
    },
    "/ressivo/listings/id/{id}": {
      "delete": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Delete listing",
        "operationId": "delete-ressivo-listing",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      }
    },
    "/ressivo/onboarding": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Get first-run onboarding status",
        "operationId": "get-ressivo-onboarding",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoOnboardingStatus"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/onboarding/seed": {
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Apply the sample-data seed for a use case",
        "operationId": "seed-ressivo-onboarding",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoOnboardingSeedInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Seed result (idempotent — repeats report alreadySeeded)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoOnboardingSeedResult"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Remove the organization's sample data",
        "operationId": "remove-ressivo-onboarding-seed",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Removal result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoOnboardingRemoveResult"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/onboarding/skip": {
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Skip first-run onboarding",
        "operationId": "skip-ressivo-onboarding",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding status after skipping",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoOnboardingStatus"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/calendar/{token}.ics": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "iCal feed of a listing's confirmed bookings",
        "operationId": "get-ressivo-calendar-feed",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "iCalendar document",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/resolve-domain": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Resolve a custom domain hostname to a listing slug",
        "operationId": "resolve-ressivo-domain",
        "parameters": [
          {
            "name": "hostname",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved slug",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/availability": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "List public availability rules",
        "operationId": "list-ressivo-public-availability",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of availability rules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoAvailabilityRule"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/availability/exceptions": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "List disabled slot times for a date",
        "operationId": "list-ressivo-public-availability-exceptions",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "itemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of disabled slot times",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/availability/slot-counts": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Per-date count of remaining available slots for a listing",
        "operationId": "list-ressivo-public-slot-counts",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "itemId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Map of date (YYYY-MM-DD) to remaining-slot count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/availability/slot-occupancy": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Summed guest count per slot for an item on one date",
        "operationId": "list-ressivo-public-slot-occupancy",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "itemId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Map of slot time (HH:MM) to summed guest count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/bookings": {
      "post": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Create a booking and return Stripe checkout",
        "operationId": "create-ressivo-public-booking",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoPublicBookingInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booking created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoPublicBookingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/bookings/{id}": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Get booking status",
        "operationId": "get-ressivo-public-booking",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoBooking"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/bookings/{id}/cancel": {
      "post": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Cancel an unpaid booking and release its slots",
        "operationId": "cancel-ressivo-public-booking",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/items": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "List public listing items",
        "operationId": "list-ressivo-public-items",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RessivoItem"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/public/{slug}/settings": {
      "get": {
        "tags": [
          "Ressivo Public"
        ],
        "summary": "Get public settings",
        "operationId": "get-ressivo-public-settings",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoSettings"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/reports": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Booking statistics for a listing and date range",
        "operationId": "get-ressivo-reports",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregated booking statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dateFrom": {
                      "type": "string"
                    },
                    "dateTo": {
                      "type": "string"
                    },
                    "availableSlots": {
                      "type": "number"
                    },
                    "occupancy": {
                      "type": "number",
                      "nullable": true
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "bookings": {
                          "type": "number"
                        },
                        "guests": {
                          "type": "number"
                        },
                        "revenue": {
                          "type": "number"
                        },
                        "bookedValue": {
                          "type": "number"
                        },
                        "cancellations": {
                          "type": "number"
                        },
                        "avgLeadDays": {
                          "type": "number",
                          "nullable": true
                        },
                        "bookedSlots": {
                          "type": "number"
                        }
                      }
                    },
                    "byItem": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "itemId": {
                            "type": "number"
                          },
                          "itemName": {
                            "type": "string"
                          },
                          "bookings": {
                            "type": "number"
                          },
                          "guests": {
                            "type": "number"
                          },
                          "revenue": {
                            "type": "number"
                          },
                          "bookedSlots": {
                            "type": "number"
                          },
                          "occupancy": {
                            "type": "number",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "heatmap": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "dow": {
                            "type": "number"
                          },
                          "hour": {
                            "type": "number"
                          },
                          "count": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/settings": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Get Ressivo settings",
        "operationId": "get-ressivo-settings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ressivo settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoSettings"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/settings/branding": {
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update branding settings",
        "operationId": "update-ressivo-branding-settings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResissvoBrandingInput"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "listingId": {
                    "type": "string"
                  },
                  "tagline": {
                    "type": "string"
                  },
                  "primaryColor": {
                    "type": "string"
                  },
                  "secondaryColor": {
                    "type": "string"
                  },
                  "heroImage": {
                    "type": "string"
                  },
                  "brandingHtml": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoSettings"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/settings/business": {
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update business details",
        "operationId": "update-ressivo-business-settings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoBusinessInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoSettings"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/settings/calendar-token": {
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Regenerate the listing's calendar feed token",
        "operationId": "regenerate-ressivo-calendar-token",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listingId"
                ],
                "properties": {
                  "listingId": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New calendar token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calendarToken": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/settings/payment": {
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update payment settings",
        "operationId": "update-ressivo-payment-settings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RessivoPaymentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoSettings"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/settings/policies": {
      "put": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Update policy settings",
        "operationId": "update-ressivo-policy-settings",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResissvoPolicyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RessivoSettings"
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/stripe-connect/create-account": {
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Create a Stripe Connect account for a listing",
        "operationId": "create-stripe-connect-account",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listingId",
                  "email"
                ],
                "properties": {
                  "listingId": {
                    "type": "number"
                  },
                  "email": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Connected account created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/stripe-connect/onboarding-link": {
      "post": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Create an onboarding link for Stripe Connect",
        "operationId": "create-stripe-onboarding-link",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listingId"
                ],
                "properties": {
                  "listingId": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Onboarding link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ressivo/stripe-connect/status": {
      "get": {
        "tags": [
          "Ressivo"
        ],
        "summary": "Get Stripe Connect account status for a listing",
        "operationId": "get-stripe-connect-status",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "listingId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stripe Connect status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "accountId": {
                      "type": "string",
                      "nullable": true
                    },
                    "chargesEnabled": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "detailsSubmitted": {
                      "type": "boolean",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create subscription",
        "operationId": "create-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Subscription information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "app",
                  "name"
                ],
                "properties": {
                  "app": {
                    "type": "string",
                    "enum": [
                      "barn",
                      "latea",
                      "ressivo"
                    ]
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscription information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "paymentStripeId",
                    "paymentURL"
                  ],
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "paymentStripeId": {
                      "type": "string"
                    },
                    "paymentURL": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/app-plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Get active app plans for organizations",
        "operationId": "get-app-plans-for-org",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "required": true,
            "description": "App name",
            "schema": {
              "type": "string",
              "enum": [
                "barn",
                "latea",
                "ressivo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of active plans for the app",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/organization/{id}/cancel": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Cancel organization subscription at period end",
        "operationId": "cancel-organization-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription cancellation scheduled"
          }
        }
      }
    },
    "/subscriptions/organization/{id}/change-plan": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Change organization subscription plan",
        "operationId": "change-organization-subscription-plan",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "planId"
                ],
                "properties": {
                  "planId": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Subscription updated"
          }
        }
      }
    },
    "/subscriptions/organization/{id}/resume": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Resume organization subscription cancellation",
        "operationId": "resume-organization-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription resumed"
          }
        }
      }
    },
    "/subscriptions/public/app-plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Get public app plans",
        "operationId": "get-public-app-plans",
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "required": true,
            "description": "App name",
            "schema": {
              "type": "string",
              "enum": [
                "barn",
                "latea",
                "ressivo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of active plans for the app",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/{app}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get subscription",
        "operationId": "subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "description": "App name",
            "schema": {
              "type": "string",
              "enum": [
                "barn",
                "latea",
                "ressivo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription meta information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get users",
        "operationId": "get-users",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "User information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create user",
        "operationId": "create-user",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "username",
                  "password"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update user",
        "operationId": "update-user",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "username",
                  "password"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/apikeys": {
      "get": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Get user api keys",
        "operationId": "get-user-api-keys",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The keys of the app the caller is authenticated for. A key belongs to one app and the other apps never see it.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/APIKey"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Create user api key",
        "operationId": "create-user-api-key",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "readOnly": {
                    "type": "boolean",
                    "default": false,
                    "description": "A read-only key may only issue GET, HEAD and OPTIONS requests; anything else is refused with 403 read_only_key. Set on creation and never changed afterwards.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User API Key information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Update user api key",
        "operationId": "update-user-api-key",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User API Key information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/apikeys/{id}": {
      "delete": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Delete user api key",
        "operationId": "delete-user-api-keyu",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/{id}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete user",
        "operationId": "delete-user",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "APIKey": {
        "description": "API key information",
        "required": [
          "id",
          "name",
          "key",
          "readOnly",
          "app"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "readOnly": {
            "type": "boolean",
            "description": "A read-only key may only issue GET, HEAD and OPTIONS requests."
          },
          "app": {
            "type": "string",
            "enum": [
              "latea",
              "barn",
              "ressivo"
            ],
            "description": "The app the key speaks for, taken from the app its creator was authenticated for. Routes of any other app refuse it with 403 app_not_allowed.\n"
          }
        }
      },
      "AppleAuth": {
        "type": "object",
        "required": [
          "appleCredential"
        ],
        "properties": {
          "appleCredential": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      },
      "Country": {
        "description": "App token",
        "required": [
          "countryCode",
          "name"
        ],
        "properties": {
          "countryCode": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "name": {
            "type": "string"
          }
        }
      },
      "FBAuth": {
        "type": "object",
        "required": [
          "facebookCredential"
        ],
        "properties": {
          "facebookCredential": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      },
      "FallbackAuth": {
        "type": "object",
        "required": [
          "fallbackRegistration"
        ],
        "properties": {
          "fallbackRegistration": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "username": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "GoogleAuth": {
        "type": "object",
        "required": [
          "googleCredential"
        ],
        "properties": {
          "googleCredential": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      },
      "Organization": {
        "description": "Organization information",
        "required": [
          "id",
          "name",
          "taxNumber",
          "email"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "taxNumber": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "logofilename": {
            "type": "string",
            "nullable": true
          },
          "addressId": {
            "type": "number",
            "nullable": true
          },
          "address": {
            "type": "object",
            "required": [
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          }
        }
      },
      "PasswordRecoverConfirm": {
        "type": "object",
        "required": [
          "token",
          "password"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "PasswordRecoverRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "app": {
            "type": "string"
          }
        }
      },
      "Plan": {
        "description": "App-level subscription plan",
        "properties": {
          "id": {
            "type": "number"
          },
          "app": {
            "type": "string",
            "enum": [
              "barn",
              "latea",
              "ressivo"
            ]
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "productName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "invoices",
                "exports",
                "basic",
                "custom_domain"
              ]
            }
          },
          "frequency": {
            "type": "string",
            "enum": [
              "monthly",
              "annual"
            ]
          },
          "stripeProductId": {
            "type": "string"
          },
          "stripePriceId": {
            "type": "string"
          },
          "platformFeePercent": {
            "type": "number",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ResissvoBrandingInput": {
        "type": "object",
        "required": [
          "listingId"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "tagline": {
            "type": "string"
          },
          "primaryColor": {
            "type": "string"
          },
          "secondaryColor": {
            "type": "string"
          },
          "heroImage": {
            "type": "string",
            "nullable": true
          },
          "brandingHtml": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ResissvoPolicyInput": {
        "type": "object",
        "required": [
          "listingId"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "cancellationPolicyUrl": {
            "type": "string"
          },
          "refundPolicyUrl": {
            "type": "string"
          },
          "emailNotifications": {
            "type": "boolean"
          },
          "reminderHoursBefore": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RessivoAdminBookingInput": {
        "type": "object",
        "required": [
          "listingId",
          "itemId",
          "bookingDate",
          "slotTimes",
          "customerName",
          "customerEmail"
        ],
        "properties": {
          "listingId": {
            "type": "integer"
          },
          "itemId": {
            "type": "integer"
          },
          "bookingDate": {
            "type": "string",
            "format": "date"
          },
          "slotTimes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "customerName": {
            "type": "string",
            "minLength": 1
          },
          "customerEmail": {
            "type": "string",
            "format": "email"
          },
          "customerPhone": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "numPeople": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "RessivoAvailabilityException": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "organizationId": {
            "type": "number"
          },
          "listingId": {
            "type": "number"
          },
          "exceptionDate": {
            "type": "string",
            "format": "date"
          },
          "slotTime": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "itemId": {
            "type": "number",
            "nullable": true
          },
          "deleted": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RessivoAvailabilityInput": {
        "type": "object",
        "required": [
          "listingId",
          "daysOfWeek"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "daysOfWeek": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "slotDuration": {
            "type": "number"
          },
          "periods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "startTime": {
                  "type": "string"
                },
                "endTime": {
                  "type": "string"
                },
                "slotDuration": {
                  "type": "number"
                }
              }
            }
          },
          "timezone": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "RessivoAvailabilityRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "organizationId": {
            "type": "number"
          },
          "listingId": {
            "type": "number"
          },
          "daysOfWeek": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "slotDuration": {
            "type": "number"
          },
          "timezone": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RessivoAvailabilityUpdate": {
        "type": "object",
        "required": [
          "listingId"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "daysOfWeek": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "slotDuration": {
            "type": "number"
          },
          "periods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "startTime": {
                  "type": "string"
                },
                "endTime": {
                  "type": "string"
                },
                "slotDuration": {
                  "type": "number"
                }
              }
            }
          },
          "timezone": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "RessivoBooking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "organizationId": {
            "type": "number"
          },
          "listingId": {
            "type": "number"
          },
          "itemId": {
            "type": "number"
          },
          "itemName": {
            "type": "string"
          },
          "itemDescription": {
            "type": "string",
            "nullable": true
          },
          "bookingDate": {
            "type": "string",
            "format": "date"
          },
          "slotTimes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startTime": {
            "type": "string",
            "nullable": true
          },
          "endTime": {
            "type": "string",
            "nullable": true
          },
          "pricePerSlot": {
            "type": "number"
          },
          "totalAmount": {
            "type": "number"
          },
          "numPeople": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string"
          },
          "customerName": {
            "type": "string"
          },
          "customerEmail": {
            "type": "string"
          },
          "customerPhone": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "stripeSessionId": {
            "type": "string",
            "nullable": true
          },
          "stripePaymentIntentId": {
            "type": "string",
            "nullable": true
          },
          "stripeCustomerId": {
            "type": "string",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RessivoBookingUpdate": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "listingId": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "RessivoBusinessInput": {
        "type": "object",
        "required": [
          "listingId"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "contactEmail": {
            "type": "string"
          },
          "locationName": {
            "type": "string"
          },
          "latitude": {
            "type": "number",
            "nullable": true
          },
          "longitude": {
            "type": "number",
            "nullable": true
          },
          "timezone": {
            "type": "string"
          },
          "slotMode": {
            "type": "string"
          }
        }
      },
      "RessivoItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "organizationId": {
            "type": "number"
          },
          "listingId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "imageUrl": {
            "type": "string",
            "nullable": true
          },
          "bookingType": {
            "type": "string"
          },
          "capacityMin": {
            "type": "number",
            "nullable": true
          },
          "capacityMax": {
            "type": "number",
            "nullable": true
          },
          "sharedCapacity": {
            "type": "boolean"
          },
          "pricingMode": {
            "type": "string",
            "enum": [
              "perSlot",
              "perGuest",
              "perBooking"
            ]
          },
          "pricePerSlot": {
            "type": "number"
          },
          "active": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RessivoItemInput": {
        "type": "object",
        "required": [
          "listingId",
          "name",
          "pricePerSlot"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "bookingType": {
            "type": "string"
          },
          "capacityMin": {
            "type": "number"
          },
          "capacityMax": {
            "type": "number"
          },
          "sharedCapacity": {
            "type": "boolean"
          },
          "pricingMode": {
            "type": "string",
            "enum": [
              "perSlot",
              "perGuest",
              "perBooking"
            ]
          },
          "pricePerSlot": {
            "type": "number"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "RessivoItemUpdate": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "listingId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string",
            "nullable": true
          },
          "bookingType": {
            "type": "string"
          },
          "capacityMin": {
            "type": "number"
          },
          "capacityMax": {
            "type": "number"
          },
          "sharedCapacity": {
            "type": "boolean"
          },
          "pricingMode": {
            "type": "string",
            "enum": [
              "perSlot",
              "perGuest",
              "perBooking"
            ]
          },
          "pricePerSlot": {
            "type": "number"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "RessivoListing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "organizationId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "logoFilename": {
            "type": "string",
            "nullable": true
          },
          "tagline": {
            "type": "string",
            "nullable": true
          },
          "primaryColor": {
            "type": "string",
            "nullable": true
          },
          "secondaryColor": {
            "type": "string",
            "nullable": true
          },
          "heroImage": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "contactEmail": {
            "type": "string",
            "nullable": true
          },
          "cancellationPolicyUrl": {
            "type": "string",
            "nullable": true
          },
          "refundPolicyUrl": {
            "type": "string",
            "nullable": true
          },
          "daysOfWeek": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "slotDuration": {
            "type": "number"
          },
          "active": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          },
          "updatedDatetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "RessivoListingInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "RessivoListingUpdate": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "logoFilename": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "RessivoOnboardingRemoveResult": {
        "type": "object",
        "required": [
          "removed"
        ],
        "properties": {
          "removed": {
            "type": "boolean",
            "description": "False when there was no sample data left to remove."
          },
          "bookingsRemoved": {
            "type": "number"
          },
          "itemsRemoved": {
            "type": "number"
          },
          "itemsKept": {
            "type": "number",
            "description": "Seeded items kept because a real booking still points at them."
          }
        }
      },
      "RessivoOnboardingSeedInput": {
        "type": "object",
        "required": [
          "useCase",
          "language"
        ],
        "properties": {
          "useCase": {
            "type": "string",
            "enum": [
              "padel",
              "tennis",
              "studios",
              "charters",
              "generic"
            ]
          },
          "language": {
            "description": "The language the sample items are written in.",
            "type": "string",
            "enum": [
              "en",
              "pt",
              "es",
              "fr",
              "de",
              "zh"
            ]
          }
        }
      },
      "RessivoOnboardingSeedResult": {
        "type": "object",
        "required": [
          "status",
          "hasSampleData",
          "sampleData"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "useCase": {
            "type": "string",
            "nullable": true
          },
          "hasSampleData": {
            "type": "boolean"
          },
          "sampleData": {
            "$ref": "#/components/schemas/RessivoSampleDataCounts"
          },
          "alreadySeeded": {
            "type": "boolean"
          },
          "listingId": {
            "type": "number"
          },
          "itemsCreated": {
            "type": "number"
          },
          "bookingsCreated": {
            "type": "number"
          }
        }
      },
      "RessivoOnboardingStatus": {
        "type": "object",
        "required": [
          "status",
          "hasSampleData",
          "sampleData"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "seeded",
              "completed"
            ]
          },
          "useCase": {
            "type": "string",
            "nullable": true
          },
          "hasSampleData": {
            "type": "boolean"
          },
          "sampleData": {
            "$ref": "#/components/schemas/RessivoSampleDataCounts"
          }
        }
      },
      "RessivoPaymentInput": {
        "type": "object",
        "required": [
          "listingId"
        ],
        "properties": {
          "listingId": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "bookingHoldMinutes": {
            "type": "number"
          },
          "paymentMode": {
            "type": "string",
            "enum": [
              "online",
              "onsite"
            ]
          }
        }
      },
      "RessivoPublicBookingInput": {
        "type": "object",
        "required": [
          "itemId",
          "bookingDate",
          "slotTimes",
          "customerName",
          "customerEmail"
        ],
        "properties": {
          "itemId": {
            "type": "integer"
          },
          "bookingDate": {
            "type": "string",
            "format": "date"
          },
          "slotTimes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "customerName": {
            "type": "string",
            "minLength": 1
          },
          "customerEmail": {
            "type": "string",
            "format": "email"
          },
          "customerPhone": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "numPeople": {
            "type": "integer",
            "minimum": 1
          },
          "returnOrigin": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "RessivoPublicBookingResponse": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "number"
          },
          "checkoutUrl": {
            "type": "string",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "RessivoSampleDataCounts": {
        "type": "object",
        "description": "What a sample-data removal would do right now.",
        "required": [
          "listings",
          "items",
          "itemsKept",
          "bookings"
        ],
        "properties": {
          "listings": {
            "type": "number",
            "description": "Seeded booking pages — kept, but no longer marked as sample data."
          },
          "items": {
            "type": "number",
            "description": "Seeded items that would be deleted."
          },
          "itemsKept": {
            "type": "number",
            "description": "Seeded items kept back because a real booking still points at them."
          },
          "bookings": {
            "type": "number",
            "description": "Seeded bookings that would be deleted."
          }
        }
      },
      "RessivoSettings": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "nullable": true
          },
          "organizationId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "tagline": {
            "type": "string",
            "nullable": true
          },
          "primaryColor": {
            "type": "string",
            "nullable": true
          },
          "secondaryColor": {
            "type": "string",
            "nullable": true
          },
          "heroImage": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "contactEmail": {
            "type": "string",
            "nullable": true
          },
          "stripeAccountId": {
            "type": "string",
            "nullable": true
          },
          "bookingHoldMinutes": {
            "type": "number"
          },
          "cancellationPolicyUrl": {
            "type": "string",
            "nullable": true
          },
          "refundPolicyUrl": {
            "type": "string",
            "nullable": true
          },
          "brandingHtml": {
            "type": "string",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "nullable": true
          },
          "longitude": {
            "type": "number",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "nullable": true
          },
          "emailNotifications": {
            "type": "boolean"
          },
          "reminderHoursBefore": {
            "type": "integer",
            "minimum": 0
          },
          "calendarToken": {
            "type": "string"
          },
          "paymentMode": {
            "type": "string",
            "enum": [
              "online",
              "onsite"
            ]
          },
          "subscriptionActive": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          },
          "updatedDatetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "Subscription": {
        "description": "Subscription",
        "required": [
          "app",
          "name"
        ],
        "properties": {
          "id": {
            "type": "number",
            "nullable": true
          },
          "planId": {
            "type": "number",
            "nullable": true
          },
          "app": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "endDatetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "cancelled",
              "past_due",
              "paused"
            ]
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "trialActive": {
            "type": "boolean"
          },
          "trialUnlimited": {
            "type": "boolean"
          },
          "trialEndDatetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "User": {
        "description": "User information",
        "required": [
          "id",
          "name",
          "username",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "user",
              "superadmin"
            ]
          },
          "resetpassword": {
            "type": "boolean"
          }
        }
      },
      "UsernamePassword": {
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      }
    },
    "securitySchemes": {
      "CookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "strangeskills.sid"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "apikey"
      }
    }
  },
  "x-doc-sections": [
    {
      "id": "availability",
      "title": "Availability",
      "group": "Ressivo",
      "paths": [
        "/ressivo/availability",
        "/ressivo/availability/exceptions",
        "/ressivo/availability/id/{id}"
      ]
    },
    {
      "id": "bookings",
      "title": "Bookings",
      "group": "Ressivo",
      "paths": [
        "/ressivo/bookings",
        "/ressivo/bookings/{id}"
      ]
    },
    {
      "id": "items",
      "title": "Items",
      "group": "Ressivo",
      "paths": [
        "/ressivo/items",
        "/ressivo/items/id/{id}"
      ]
    },
    {
      "id": "listings",
      "title": "Listings",
      "group": "Ressivo",
      "paths": [
        "/ressivo/listings",
        "/ressivo/listings/custom-domain",
        "/ressivo/listings/custom-domain/verify",
        "/ressivo/listings/custom-domain/{id}",
        "/ressivo/listings/id/{id}"
      ]
    },
    {
      "id": "onboarding",
      "title": "Onboarding",
      "group": "Ressivo",
      "paths": [
        "/ressivo/onboarding",
        "/ressivo/onboarding/seed",
        "/ressivo/onboarding/skip"
      ]
    },
    {
      "id": "public",
      "title": "Public",
      "group": "Ressivo",
      "paths": [
        "/ressivo/public/calendar/{token}.ics",
        "/ressivo/public/resolve-domain",
        "/ressivo/public/{slug}/availability",
        "/ressivo/public/{slug}/availability/exceptions",
        "/ressivo/public/{slug}/availability/slot-counts",
        "/ressivo/public/{slug}/availability/slot-occupancy",
        "/ressivo/public/{slug}/bookings",
        "/ressivo/public/{slug}/bookings/{id}",
        "/ressivo/public/{slug}/bookings/{id}/cancel",
        "/ressivo/public/{slug}/items",
        "/ressivo/public/{slug}/settings"
      ]
    },
    {
      "id": "reports",
      "title": "Reports",
      "group": "Ressivo",
      "paths": [
        "/ressivo/reports"
      ]
    },
    {
      "id": "settings",
      "title": "Settings",
      "group": "Ressivo",
      "paths": [
        "/ressivo/settings",
        "/ressivo/settings/branding",
        "/ressivo/settings/business",
        "/ressivo/settings/calendar-token",
        "/ressivo/settings/payment",
        "/ressivo/settings/policies"
      ]
    },
    {
      "id": "stripe-connect",
      "title": "Stripe connect",
      "group": "Ressivo",
      "paths": [
        "/ressivo/stripe-connect/create-account",
        "/ressivo/stripe-connect/onboarding-link",
        "/ressivo/stripe-connect/status"
      ]
    },
    {
      "id": "auth",
      "title": "Auth",
      "group": "Account and platform",
      "paths": [
        "/auth",
        "/auth/logout",
        "/auth/password",
        "/auth/recover",
        "/auth/recover/confirm",
        "/auth/user"
      ]
    },
    {
      "id": "generic",
      "title": "Generic",
      "group": "Account and platform",
      "paths": [
        "/generic/countries"
      ]
    },
    {
      "id": "organizations",
      "title": "Organizations",
      "group": "Account and platform",
      "paths": [
        "/organizations",
        "/organizations/all",
        "/organizations/configuration",
        "/organizations/logo",
        "/organizations/{id}"
      ]
    },
    {
      "id": "subscriptions",
      "title": "Subscriptions",
      "group": "Account and platform",
      "paths": [
        "/subscriptions",
        "/subscriptions/app-plans",
        "/subscriptions/organization/{id}/cancel",
        "/subscriptions/organization/{id}/change-plan",
        "/subscriptions/organization/{id}/resume",
        "/subscriptions/public/app-plans",
        "/subscriptions/{app}"
      ]
    },
    {
      "id": "users",
      "title": "Users",
      "group": "Account and platform",
      "paths": [
        "/users",
        "/users/apikeys",
        "/users/apikeys/{id}",
        "/users/{id}"
      ]
    }
  ]
}
