{
  "openapi": "3.0.0",
  "info": {
    "title": "Venturu API Documentation",
    "version": "1.0.0",
    "description": "This is the OpenAPI specification for Venturu."
  },
  "servers": [
    {
      "url": "https://www.venturu.com/api",
      "description": "Production server"
    },
    {
      "url": "http://localhost:3000/api",
      "description": "Local development server"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "putBrokerPathParamsSchema": {
        "type": "object",
        "properties": {
          "externalBrokerId": {
            "type": "string",
            "description": "The ID of the broker from your system."
          }
        },
        "required": [
          "externalBrokerId"
        ]
      },
      "putBrokerRequestSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The full name of the broker."
          },
          "email": {
            "type": "string",
            "description": "The email address of the broker."
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "The phone number of the broker."
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true,
            "description": "A URL to the broker's profile picture."
          },
          "forwardingEmail": {
            "type": "string",
            "nullable": true,
            "description": "If leads should be forwarded to a specific email address (i.e. in case of CRMs), this value can be specified."
          },
          "profile": {
            "type": "object",
            "properties": {
              "bio": {
                "type": "string",
                "nullable": true,
                "description": "A short biography of the broker."
              },
              "website": {
                "type": "string",
                "nullable": true,
                "description": "The broker's personal or professional website."
              },
              "linkedInUrl": {
                "type": "string",
                "nullable": true,
                "description": "The broker's LinkedIn profile URL."
              }
            },
            "nullable": true,
            "description": "Additional profile information about the broker."
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "licenseNumber": {
                  "type": "string",
                  "description": "The license number of the broker."
                },
                "state": {
                  "type": "string",
                  "description": "The state where the license is valid. It is recommended that this is specified as the full name of the state."
                },
                "country": {
                  "type": "string",
                  "description": "The country where the license is valid. It is recommended that this is specified as a two-letter ISO country code."
                }
              },
              "required": [
                "licenseNumber",
                "state",
                "country"
              ],
              "description": "A broker license."
            },
            "nullable": true,
            "description": "A list of licenses held by the broker."
          },
          "serviceAreas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "neighborhood": {
                  "type": "string",
                  "nullable": true,
                  "description": "The neighborhood served by the broker."
                },
                "city": {
                  "type": "string",
                  "nullable": true,
                  "description": "The city served by the broker."
                },
                "county": {
                  "type": "string",
                  "nullable": true,
                  "description": "The county served by the broker."
                },
                "state": {
                  "type": "string",
                  "description": "The state served by the broker. It is recommended that this is specified as the full name of the state."
                },
                "country": {
                  "type": "string",
                  "description": "The country served by the broker. It is recommended that this is specified as a two-letter ISO country code."
                }
              },
              "required": [
                "state",
                "country"
              ],
              "description": "A service area served by the broker. The highest service area level that needs to be specified is 'state'."
            },
            "nullable": true,
            "description": "A list of service areas covered by the broker."
          }
        },
        "required": [
          "name",
          "email"
        ]
      },
      "putBrokerResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success"
            ],
            "description": "Indicates that the operation has succeeded."
          },
          "message": {
            "type": "string",
            "description": "A message providing additional information about the operation."
          },
          "venturuBrokerId": {
            "type": "string",
            "nullable": true,
            "description": "The Venturu ID of the created or updated broker, if the operation was successful."
          },
          "venturuProfileUrl": {
            "type": "string",
            "nullable": true,
            "description": "A URL to the broker's Venturu profile, if the operation was successful."
          }
        },
        "required": [
          "status",
          "message"
        ]
      },
      "getHealthResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success"
            ],
            "description": "Indicates that you can successfully connect to the API."
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The permissions granted to the key."
          },
          "timestamp": {
            "type": "string",
            "description": "The current server timestamp in ISO 8601 format."
          }
        },
        "required": [
          "status",
          "permissions",
          "timestamp"
        ]
      },
      "putListingPathParamsSchema": {
        "type": "object",
        "properties": {
          "externalListingId": {
            "type": "string",
            "description": "The ID of the listing from your system."
          }
        },
        "required": [
          "externalListingId"
        ]
      },
      "putListingRequestSchema": {
        "type": "object",
        "properties": {
          "brokerExternalId": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the broker this listing belongs to (from your system). Use this if the broker already exists."
          },
          "broker": {
            "allOf": [
              {
                "$ref": "#/components/schemas/inlineBrokerSchema"
              }
            ],
            "description": "A complete broker object to create or update along with the listing. Use this to create both broker and listing in a single call."
          },
          "status": {
            "type": "object"
          },
          "title": {
            "type": "string",
            "nullable": true,
            "description": "A short title for the listing. Note that this title will not be used publicly."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "A detailed description of the listing. Note that we may optimize the description based on the listing's overall parameters."
          },
          "businessType": {
            "type": "string",
            "description": "The type of business being listed (e.g., 'Restaurant', etc.)."
          },
          "establishedAt": {
            "type": "object",
            "nullable": true,
            "description": "The date when the business was established (ISO 8601 format)."
          },
          "location": {
            "type": "object",
            "properties": {
              "streetAddress1": {
                "type": "string",
                "nullable": true,
                "description": "The primary street address of the business."
              },
              "streetAddress2": {
                "type": "string",
                "nullable": true,
                "description": "The secondary street address of the business."
              },
              "city": {
                "type": "string",
                "nullable": true,
                "description": "The city where the business is located."
              },
              "state": {
                "type": "string",
                "nullable": true,
                "description": "The state where the business is located. It is recommended that this is specified as the full name of the state."
              },
              "postalCode": {
                "type": "string",
                "nullable": true,
                "description": "The postal/ZIP code of the business."
              },
              "country": {
                "type": "string",
                "description": "The country where the business is located. It is recommended that this is specified as a two-letter ISO country code."
              },
              "visibility": {
                "type": "object"
              }
            },
            "required": [
              "country",
              "visibility"
            ],
            "description": "Location information about the business."
          },
          "financials": {
            "type": "object",
            "properties": {
              "askingPrice": {
                "type": "number",
                "nullable": true,
                "description": "The asking price of the listing in dollars."
              },
              "revenue": {
                "type": "number",
                "nullable": true,
                "description": "The annual revenue of the business in dollars."
              },
              "profit": {
                "type": "number",
                "nullable": true,
                "description": "The annual profit of the business in dollars."
              },
              "sde": {
                "type": "number",
                "nullable": true,
                "description": "The Seller's Discretionary Earnings (SDE) of the business in dollars."
              },
              "inventory": {
                "type": "number",
                "nullable": true,
                "description": "The value of the inventory included in the sale in dollars."
              },
              "ffande": {
                "type": "number",
                "nullable": true,
                "description": "The value of furniture, fixtures, and equipment (FF&E) included in the sale in dollars."
              }
            },
            "nullable": true,
            "default": {},
            "description": "Financial details of the listing."
          },
          "training": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean",
                "description": "Indicates if training is provided to the new business owner."
              },
              "description": {
                "type": "string",
                "nullable": true,
                "description": "A description of the training provided."
              },
              "duration": {
                "type": "string",
                "nullable": true,
                "description": "The duration of the training (e.g., '2 Weeks')."
              },
              "cost": {
                "type": "number",
                "nullable": true,
                "description": "The cost of the training in dollars. If not provided or zero, training is assumed to be free."
              }
            },
            "required": [
              "available"
            ],
            "nullable": true,
            "description": "Details about training provided to the new business owner."
          },
          "property": {
            "type": "object",
            "properties": {
              "propertyKind": {
                "type": "object"
              },
              "areaSqft": {
                "type": "number",
                "nullable": true,
                "description": "The area of the property in square feet."
              },
              "rentData": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "nullable": true,
                    "description": "The rent amount in dollars."
                  },
                  "frequency": {
                    "type": "object"
                  },
                  "leaseRenewable": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Whether or not the lease is renewable."
                  },
                  "leaseNegotiable": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Whether or not the lease terms are negotiable."
                  },
                  "leaseExpiration": {
                    "type": "object",
                    "nullable": true,
                    "description": "The expiration date of the lease (ISO 8601 format)."
                  },
                  "leaseDetails": {
                    "type": "string",
                    "nullable": true,
                    "description": "Additional details about the lease."
                  }
                },
                "required": [
                  "frequency"
                ],
                "nullable": true,
                "description": "Information about the rented property. Recommended to provide if propertyKind is 'RENTED'."
              },
              "ownedData": {
                "type": "object",
                "properties": {
                  "propertyIncludedInPrice": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Indicates if the property is included in the listing's asking price."
                  },
                  "propertyAskingPrice": {
                    "type": "number",
                    "nullable": true,
                    "description": "The asking price for the property in dollars, if sold separately."
                  },
                  "propertyDetails": {
                    "type": "string",
                    "nullable": true,
                    "description": "Additional details about the owned property."
                  }
                },
                "nullable": true,
                "description": "Information about the owned property. Recommended to provide if propertyKind is 'OWNED'."
              }
            },
            "required": [
              "propertyKind"
            ],
            "nullable": true,
            "description": "Information about a business' property."
          },
          "financing": {
            "type": "object",
            "properties": {
              "financingAvailable": {
                "type": "boolean",
                "description": "Indicates if buyer financing options are available for the listing."
              },
              "sbaPrequalified": {
                "type": "boolean",
                "nullable": true,
                "description": "Indicates if the business is prequalified for SBA loans."
              },
              "minimumDownPayment": {
                "type": "number",
                "nullable": true,
                "description": "The minimum down payment required from the buyer in dollars."
              },
              "buyerCanAssumeLoan": {
                "type": "boolean",
                "nullable": true,
                "description": "Indicates if the buyer can assume existing loans on the business."
              }
            },
            "required": [
              "financingAvailable"
            ],
            "nullable": true,
            "description": "Details about financing options available for the listing."
          },
          "photos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "The URL of the photo."
                },
                "sortKey": {
                  "type": "number",
                  "description": "The sort order of the photo."
                }
              },
              "required": [
                "url",
                "sortKey"
              ],
              "description": "A photo associated with the listing."
            },
            "nullable": true,
            "description": "A list of photos associated with the listing."
          }
        },
        "required": [
          "status",
          "businessType",
          "location"
        ]
      },
      "putListingResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success"
            ],
            "description": "Indicates that the operation was successful."
          },
          "message": {
            "type": "string",
            "description": "A message providing additional information about the operation."
          },
          "venturuListingId": {
            "type": "number",
            "nullable": true,
            "description": "The Venturu ID of the listing."
          },
          "venturuListingUrl": {
            "type": "string",
            "nullable": true,
            "description": "The URL of the listing on Venturu. Note that this field may be missing if we failed to generate a slug for the listing but may show up later."
          }
        },
        "required": [
          "status",
          "message"
        ]
      },
      "getLeadsForOfficePathParamsSchema": {
        "type": "object",
        "properties": {
          "officeId": {
            "type": "string",
            "description": "The Venturu ID of the office to get leads for."
          }
        },
        "required": [
          "officeId"
        ]
      },
      "getLeadsForOfficeResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success"
            ],
            "description": "Indicates that the request was successful."
          },
          "officeId": {
            "type": "number",
            "description": "The Venturu ID of the office."
          },
          "officeName": {
            "type": "string",
            "description": "The name of the office."
          },
          "totalLeads": {
            "type": "number",
            "description": "The total number of leads for the office."
          }
        },
        "required": [
          "status",
          "officeId",
          "officeName",
          "totalLeads"
        ]
      },
      "getLeadsForOrganizationPathParamsSchema": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "description": "The Venturu ID of the organization to get leads for."
          }
        },
        "required": [
          "organizationId"
        ]
      },
      "getLeadsForOrganizationResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success"
            ],
            "description": "Indicates that the request was successful."
          },
          "organizationId": {
            "type": "number",
            "description": "The Venturu ID of the organization."
          },
          "organizationName": {
            "type": "string",
            "description": "The name of the organization."
          },
          "totalLeads": {
            "type": "number",
            "description": "The total number of leads for the organization."
          },
          "officeBreakdown": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "officeId": {
                  "type": "number",
                  "description": "The Venturu ID of the office."
                },
                "officeName": {
                  "type": "string",
                  "description": "The name of the office."
                },
                "totalLeads": {
                  "type": "number",
                  "description": "The total number of leads for the office."
                }
              },
              "required": [
                "officeId",
                "officeName",
                "totalLeads"
              ]
            },
            "description": "A breakdown of leads by office within the organization."
          }
        },
        "required": [
          "status",
          "organizationId",
          "organizationName",
          "totalLeads",
          "officeBreakdown"
        ]
      },
      "putBrokerErrorResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Indicates that an error occurred during the operation."
          },
          "message": {
            "type": "string",
            "description": "A message describing the error that occurred."
          }
        },
        "required": [
          "status",
          "message"
        ]
      },
      "getHealthErrorResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Indicates that an error occurred."
          },
          "error": {
            "type": "string",
            "description": "A description of the error that occurred."
          }
        },
        "required": [
          "status",
          "error"
        ]
      },
      "putListingErrorResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Indicates that an error occurred during the operation."
          },
          "message": {
            "type": "string",
            "description": "A message describing the error that occurred."
          }
        },
        "required": [
          "status",
          "message"
        ]
      },
      "PutListingRequest": {
        "type": "object",
        "properties": {
          "brokerExternalId": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the broker this listing belongs to (from your system). Use this if the broker already exists."
          },
          "broker": {
            "type": "object",
            "description": "A complete broker object to create or update along with the listing. Use this to create both broker and listing in a single call."
          },
          "status": {
            "type": "object"
          },
          "title": {
            "type": "string",
            "nullable": true,
            "description": "A short title for the listing. Note that this title will not be used publicly."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "A detailed description of the listing. Note that we may optimize the description based on the listing's overall parameters."
          },
          "businessType": {
            "type": "string",
            "description": "The type of business being listed (e.g., 'Restaurant', etc.)."
          },
          "establishedAt": {
            "type": "object",
            "nullable": true,
            "description": "The date when the business was established (ISO 8601 format)."
          },
          "location": {
            "type": "object",
            "properties": {
              "streetAddress1": {
                "type": "string",
                "nullable": true,
                "description": "The primary street address of the business."
              },
              "streetAddress2": {
                "type": "string",
                "nullable": true,
                "description": "The secondary street address of the business."
              },
              "city": {
                "type": "string",
                "nullable": true,
                "description": "The city where the business is located."
              },
              "state": {
                "type": "string",
                "nullable": true,
                "description": "The state where the business is located. It is recommended that this is specified as the full name of the state."
              },
              "postalCode": {
                "type": "string",
                "nullable": true,
                "description": "The postal/ZIP code of the business."
              },
              "country": {
                "type": "string",
                "description": "The country where the business is located. It is recommended that this is specified as a two-letter ISO country code."
              },
              "visibility": {
                "type": "object"
              }
            },
            "required": [
              "country",
              "visibility"
            ],
            "description": "Location information about the business."
          },
          "financials": {
            "type": "object",
            "properties": {
              "askingPrice": {
                "type": "number",
                "nullable": true,
                "description": "The asking price of the listing in dollars."
              },
              "revenue": {
                "type": "number",
                "nullable": true,
                "description": "The annual revenue of the business in dollars."
              },
              "profit": {
                "type": "number",
                "nullable": true,
                "description": "The annual profit of the business in dollars."
              },
              "sde": {
                "type": "number",
                "nullable": true,
                "description": "The Seller's Discretionary Earnings (SDE) of the business in dollars."
              },
              "inventory": {
                "type": "number",
                "nullable": true,
                "description": "The value of the inventory included in the sale in dollars."
              },
              "ffande": {
                "type": "number",
                "nullable": true,
                "description": "The value of furniture, fixtures, and equipment (FF&E) included in the sale in dollars."
              }
            },
            "nullable": true,
            "default": {},
            "description": "Financial details of the listing."
          },
          "training": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean",
                "description": "Indicates if training is provided to the new business owner."
              },
              "description": {
                "type": "string",
                "nullable": true,
                "description": "A description of the training provided."
              },
              "duration": {
                "type": "string",
                "nullable": true,
                "description": "The duration of the training (e.g., '2 Weeks')."
              },
              "cost": {
                "type": "number",
                "nullable": true,
                "description": "The cost of the training in dollars. If not provided or zero, training is assumed to be free."
              }
            },
            "required": [
              "available"
            ],
            "nullable": true,
            "description": "Details about training provided to the new business owner."
          },
          "property": {
            "type": "object",
            "properties": {
              "propertyKind": {
                "type": "object"
              },
              "areaSqft": {
                "type": "number",
                "nullable": true,
                "description": "The area of the property in square feet."
              },
              "rentData": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "nullable": true,
                    "description": "The rent amount in dollars."
                  },
                  "frequency": {
                    "type": "object"
                  },
                  "leaseRenewable": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Whether or not the lease is renewable."
                  },
                  "leaseNegotiable": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Whether or not the lease terms are negotiable."
                  },
                  "leaseExpiration": {
                    "type": "object",
                    "nullable": true,
                    "description": "The expiration date of the lease (ISO 8601 format)."
                  },
                  "leaseDetails": {
                    "type": "string",
                    "nullable": true,
                    "description": "Additional details about the lease."
                  }
                },
                "required": [
                  "frequency"
                ],
                "nullable": true,
                "description": "Information about the rented property. Recommended to provide if propertyKind is 'RENTED'."
              },
              "ownedData": {
                "type": "object",
                "properties": {
                  "propertyIncludedInPrice": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Indicates if the property is included in the listing's asking price."
                  },
                  "propertyAskingPrice": {
                    "type": "number",
                    "nullable": true,
                    "description": "The asking price for the property in dollars, if sold separately."
                  },
                  "propertyDetails": {
                    "type": "string",
                    "nullable": true,
                    "description": "Additional details about the owned property."
                  }
                },
                "nullable": true,
                "description": "Information about the owned property. Recommended to provide if propertyKind is 'OWNED'."
              }
            },
            "required": [
              "propertyKind"
            ],
            "nullable": true,
            "description": "Information about a business' property."
          },
          "financing": {
            "type": "object",
            "properties": {
              "financingAvailable": {
                "type": "boolean",
                "description": "Indicates if buyer financing options are available for the listing."
              },
              "sbaPrequalified": {
                "type": "boolean",
                "nullable": true,
                "description": "Indicates if the business is prequalified for SBA loans."
              },
              "minimumDownPayment": {
                "type": "number",
                "nullable": true,
                "description": "The minimum down payment required from the buyer in dollars."
              },
              "buyerCanAssumeLoan": {
                "type": "boolean",
                "nullable": true,
                "description": "Indicates if the buyer can assume existing loans on the business."
              }
            },
            "required": [
              "financingAvailable"
            ],
            "nullable": true,
            "description": "Details about financing options available for the listing."
          },
          "photos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "The URL of the photo."
                },
                "sortKey": {
                  "type": "number",
                  "description": "The sort order of the photo."
                }
              },
              "required": [
                "url",
                "sortKey"
              ],
              "description": "A photo associated with the listing."
            },
            "nullable": true,
            "description": "A list of photos associated with the listing."
          }
        },
        "required": [
          "status",
          "businessType",
          "location"
        ]
      },
      "PutListingRouteParams": {
        "type": "object",
        "properties": {
          "externalListingId": {
            "type": "string",
            "description": "The ID of the listing from your system."
          }
        },
        "required": [
          "externalListingId"
        ]
      },
      "inlineBrokerSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The full name of the broker."
          },
          "email": {
            "type": "string",
            "description": "The email address of the broker."
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "The phone number of the broker."
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true,
            "description": "A URL to the broker's profile picture."
          },
          "forwardingEmail": {
            "type": "string",
            "nullable": true,
            "description": "If leads should be forwarded to a specific email address (i.e. in case of CRMs), this value can be specified."
          },
          "profile": {
            "type": "object",
            "properties": {
              "bio": {
                "type": "string",
                "nullable": true,
                "description": "A short biography of the broker."
              },
              "website": {
                "type": "string",
                "nullable": true,
                "description": "The broker's personal or professional website."
              },
              "linkedInUrl": {
                "type": "string",
                "nullable": true,
                "description": "The broker's LinkedIn profile URL."
              }
            },
            "nullable": true,
            "description": "Additional profile information about the broker."
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "licenseNumber": {
                  "type": "string",
                  "description": "The license number of the broker."
                },
                "state": {
                  "type": "string",
                  "description": "The state where the license is valid. It is recommended that this is specified as the full name of the state."
                },
                "country": {
                  "type": "string",
                  "description": "The country where the license is valid. It is recommended that this is specified as a two-letter ISO country code."
                }
              },
              "required": [
                "licenseNumber",
                "state",
                "country"
              ],
              "description": "A broker license."
            },
            "nullable": true,
            "description": "A list of licenses held by the broker."
          },
          "serviceAreas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "neighborhood": {
                  "type": "string",
                  "nullable": true,
                  "description": "The neighborhood served by the broker."
                },
                "city": {
                  "type": "string",
                  "nullable": true,
                  "description": "The city served by the broker."
                },
                "county": {
                  "type": "string",
                  "nullable": true,
                  "description": "The county served by the broker."
                },
                "state": {
                  "type": "string",
                  "description": "The state served by the broker. It is recommended that this is specified as the full name of the state."
                },
                "country": {
                  "type": "string",
                  "description": "The country served by the broker. It is recommended that this is specified as a two-letter ISO country code."
                }
              },
              "required": [
                "state",
                "country"
              ],
              "description": "A service area served by the broker. The highest service area level that needs to be specified is 'state'."
            },
            "nullable": true,
            "description": "A list of service areas covered by the broker."
          }
        },
        "required": [
          "name",
          "email"
        ]
      },
      "getLeadsForOfficeQueryParamsSchema": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Optional start date for filtering leads (ISO 8601 format). If not provided, returns all leads."
          },
          "endDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Optional end date for filtering leads (ISO 8601 format). If not provided, defaults to current date."
          }
        }
      },
      "getLeadsForOfficeErrorResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Indicates that an error occurred."
          },
          "error": {
            "type": "string",
            "description": "A description of the error that occurred."
          }
        },
        "required": [
          "status",
          "error"
        ]
      },
      "getLeadsForOrganizationQueryParamsSchema": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Optional start date for filtering leads (ISO 8601 format). If not provided, returns all leads."
          },
          "endDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Optional end date for filtering leads (ISO 8601 format). If not provided, defaults to current date."
          }
        }
      },
      "getLeadsForOrganizationErrorResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Indicates that an error occurred."
          },
          "error": {
            "type": "string",
            "description": "A description of the error that occurred."
          }
        },
        "required": [
          "status",
          "error"
        ]
      }
    },
    "responses": {}
  },
  "paths": {
    "/partner/v1/health": {
      "get": {
        "operationId": "get-partner-v1-health",
        "summary": "Get health",
        "description": "Get information about the health of the API. Useful to verify if the API is reachable and you can successfully authenticate against it.",
        "tags": [
          "Partner"
        ],
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/getHealthResponseSchema"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/getHealthErrorResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/brokers/{externalBrokerId}": {
      "put": {
        "operationId": "put-partner-v1-brokers-{externalBrokerId}",
        "summary": "Create or update broker",
        "description": "Create or update a broker in Venturu's system. If the broker with the specified external ID already exists, their information will be updated. If not, a new broker will be created.",
        "tags": [
          "Partner"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalBrokerId",
            "schema": {
              "type": "string",
              "description": "The ID of the broker from your system."
            },
            "required": true,
            "description": "The ID of the broker from your system.",
            "example": "123"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/putBrokerRequestSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/putBrokerResponseSchema"
                }
              }
            }
          },
          "201": {
            "description": "HTTP 201",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/putBrokerResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/listings/{externalListingId}": {
      "put": {
        "operationId": "put-partner-v1-listings-{externalListingId}",
        "summary": "Create or update listing",
        "description": "Create or update a listing in Venturu's system. If the listing with the specified external ID already exists, its information will be updated. If not, a new listing will be created.",
        "tags": [
          "Partner"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalListingId",
            "schema": {
              "type": "string",
              "description": "The ID of the listing from your system."
            },
            "required": true,
            "description": "The ID of the listing from your system.",
            "example": "123"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/putListingRequestSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/putListingResponseSchema"
                }
              }
            }
          },
          "201": {
            "description": "HTTP 201",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/putListingResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/offices/{officeId}/leads/count": {
      "get": {
        "operationId": "get-partner-v1-offices-{officeId}-leads-count",
        "summary": "Get leads for office",
        "description": "Get lead statistics for a specific partner agent organization office. This endpoint may not be supported for all Venturu partners.",
        "tags": [
          "Partner"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "officeId",
            "schema": {
              "type": "string",
              "description": "The Venturu ID of the office to get leads for."
            },
            "required": true,
            "description": "The Venturu ID of the office to get leads for.",
            "example": "123"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/getLeadsForOfficeResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/getLeadsForOfficeErrorResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/organizations/{organizationId}/leads/count": {
      "get": {
        "operationId": "get-partner-v1-organizations-{organizationId}-leads-count",
        "summary": "Get leads for organization",
        "description": "Get lead statistics and per-office breakdowns for a specific partner agent organization. This endpoint may not be supported for all Venturu partners.",
        "tags": [
          "Partner"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "schema": {
              "type": "string",
              "description": "The Venturu ID of the organization to get leads for."
            },
            "required": true,
            "description": "The Venturu ID of the organization to get leads for.",
            "example": "123"
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/getLeadsForOrganizationResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/getLeadsForOrganizationErrorResponseSchema"
                }
              }
            }
          }
        }
      }
    }
  }
}