{
  "openapi": "3.1.0",
  "info": {
    "title": "Modiqo Website API",
    "version": "1.0.0",
    "description": "The public HTTP contract for the Modiqo website. The current API accepts pricing and sales inquiries for rote.",
    "contact": {
      "name": "Modiqo",
      "email": "sales@modiqo.ai",
      "url": "https://www.modiqo.ai/contact"
    }
  },
  "servers": [
    {"url": "https://www.modiqo.ai", "description": "Production"}
  ],
  "paths": {
    "/api/sales-leads": {
      "post": {
        "operationId": "submitSalesLead",
        "summary": "Send a pricing or sales inquiry",
        "description": "Validates one inquiry, sends it to the Modiqo sales team, and returns the public scheduling URL. Requests are limited to five per source address per minute and to 16 KiB.",
        "tags": ["Sales"],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": false,
            "description": "The browser origin. Browser requests must come from an approved Modiqo origin.",
            "schema": {"type": "string", "format": "uri"}
          }
        ],
        "requestBody": {
          "required": true,
          "description": "A pricing or sales inquiry.",
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/SalesLeadRequest"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "The inquiry was accepted.",
            "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SalesLeadSuccess"}}}
          },
          "400": {"$ref": "#/components/responses/BadRequest"},
          "403": {"$ref": "#/components/responses/Forbidden"},
          "405": {"$ref": "#/components/responses/MethodNotAllowed"},
          "413": {"$ref": "#/components/responses/PayloadTooLarge"},
          "415": {"$ref": "#/components/responses/UnsupportedMediaType"},
          "429": {"$ref": "#/components/responses/RateLimited"},
          "502": {"$ref": "#/components/responses/DeliveryUnavailable"},
          "503": {"$ref": "#/components/responses/DeliveryUnavailable"}
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SalesLeadRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["first_name", "last_name", "work_email", "company_website", "plan", "billing", "team_size", "organization_count", "need", "stage", "details"],
        "properties": {
          "first_name": {"type": "string", "minLength": 1, "maxLength": 80, "description": "The sender's first name."},
          "last_name": {"type": "string", "minLength": 1, "maxLength": 80, "description": "The sender's last name."},
          "work_email": {"type": "string", "format": "email", "maxLength": 254, "description": "The sender's work email address."},
          "company_website": {"type": "string", "format": "uri", "maxLength": 300, "description": "The sender's company website."},
          "plan": {"type": "string", "enum": ["community", "team", "growth", "business", "enterprise"], "description": "The plan under review."},
          "billing": {"type": "string", "enum": ["free", "monthly", "annual", "custom"], "description": "The preferred billing period."},
          "team_size": {"type": "integer", "minimum": 1, "maximum": 100000, "description": "The number of people on the team."},
          "organization_count": {"type": "integer", "minimum": 1, "maximum": 1000, "description": "The number of rote organizations required."},
          "need": {"type": "string", "enum": ["start-free", "verified-collaboration", "sso-governance", "advanced-control", "enterprise-boundary"], "description": "The main capability the sender needs."},
          "stage": {"type": "string", "enum": ["evaluating", "piloting", "production", "scaling"], "description": "The sender's current adoption stage."},
          "details": {"type": "string", "minLength": 10, "maxLength": 3000, "description": "A plain-language description of the work and requirements."},
          "source_url": {"type": "string", "format": "uri", "maxLength": 500, "description": "The Modiqo page that opened the inquiry form."},
          "company_fax": {"type": "string", "maxLength": 200, "description": "A honeypot field. Human and agent clients must omit it or send an empty string."}
        }
      },
      "SalesLeadSuccess": {
        "type": "object",
        "additionalProperties": false,
        "required": ["ok", "schedulerUrl"],
        "properties": {
          "ok": {"type": "boolean", "const": true},
          "schedulerUrl": {"type": "string", "format": "uri", "description": "The public Modiqo scheduling URL."}
        }
      },
      "ErrorDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": ["code", "message", "resolution"],
        "properties": {
          "code": {"type": "string", "description": "A stable machine-readable error code."},
          "message": {"type": "string", "description": "A short explanation of the error."},
          "resolution": {"type": "string", "description": "A concrete action that can resolve the error."}
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["ok", "error"],
        "properties": {
          "ok": {"type": "boolean", "const": false},
          "error": {"$ref": "#/components/schemas/ErrorDetail"}
        }
      }
    },
    "responses": {
      "BadRequest": {"description": "The JSON body or one of its fields is invalid.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
      "Forbidden": {"description": "The request origin is not allowed.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
      "MethodNotAllowed": {"description": "The HTTP method is not supported.", "headers": {"Allow": {"schema": {"type": "string"}, "description": "The accepted HTTP method."}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
      "PayloadTooLarge": {"description": "The request is larger than 16 KiB.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
      "UnsupportedMediaType": {"description": "The request does not use application/json.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
      "RateLimited": {"description": "The per-address request limit was reached.", "headers": {"Retry-After": {"schema": {"type": "integer"}, "description": "Seconds to wait before retrying."}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
      "DeliveryUnavailable": {"description": "The inquiry could not be delivered.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}
    }
  },
  "tags": [
    {"name": "Sales", "description": "Contact Modiqo about rote plans and deployment."}
  ]
}
