{
  "openapi": "3.1.0",
  "info": {
    "title": "Switchboard Finance API",
    "version": "1.0.0",
    "description": "Business-finance routing for Australian self-employed borrowers and ABN holders. General information only; not a credit decision, offer or advice. Switchboard Finance Pty Ltd, Credit Representative 576702 of Australian Credit Licence 517192. Every enquiry is assessed by a licensed broker.",
    "contact": {
      "name": "Switchboard Finance",
      "url": "https://www.switchboardfinance.com.au"
    }
  },
  "servers": [
    {
      "url": "https://switchboard-agent-api.spring-cake-1609.workers.dev"
    }
  ],
  "paths": {
    "/v1/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "Business-finance lanes with panel-observed ranges, method and disclosure. No lender is named.",
        "responses": {
          "200": {
            "description": "Lanes, method and disclosure"
          }
        }
      }
    },
    "/v1/eligibility": {
      "post": {
        "operationId": "checkFit",
        "summary": "Check whether a business-purpose finance scenario is in scope and which lanes apply. Not a credit decision.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Scenario"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fit, relevant lanes and next step"
          }
        }
      }
    },
    "/v1/enquiry": {
      "post": {
        "operationId": "requestCallback",
        "summary": "With the borrower's explicit consent, send the scenario to a licensed broker. Returns a reference number.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Enquiry"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received, with reference number and response time"
          },
          "400": {
            "description": "Missing fields or consent not given"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Model Context Protocol endpoint (JSON-RPC 2.0) exposing list_products, check_fit and request_callback.",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Scenario": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "description": "What the funds are for"
          },
          "security": {
            "type": "string",
            "description": "Property, asset, or none"
          },
          "amount": {
            "type": "number",
            "description": "Amount sought in AUD"
          },
          "borrower_type": {
            "type": "string",
            "description": "company, trust, sole trader or partnership"
          },
          "situation": {
            "type": "string",
            "description": "ATO debt, low doc, declined by a bank, urgency, anything else"
          }
        }
      },
      "Enquiry": {
        "type": "object",
        "required": [
          "name",
          "phone",
          "email",
          "scenario",
          "consent"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "business_name": {
            "type": "string"
          },
          "abn": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "scenario": {
            "type": "string"
          },
          "consent": {
            "type": "boolean",
            "description": "True only if the borrower agreed to be contacted by Switchboard Finance about this enquiry by phone, SMS and email, including follow-up emails they can unsubscribe from at any time"
          },
          "agent_name": {
            "type": "string",
            "description": "Assistant submitting on the borrower's behalf, if any"
          }
        }
      }
    }
  }
}