{
  "openapi": "3.1.0",
  "info": {
    "title": "Autonomous-Sales-Machine API (W4-F03)",
    "version": "1.0.0",
    "description": "4-stage B2B outbound Proof Teardown Microsite compiler & resumable batch waterfall API. Read-only public HTTPS GET, public DoH DNS, and stdlib TLS inspection only. Strictly $0 billed on dead, NXDOMAIN, fake-200, WAF, parked, or SSRF-blocked rows. Zero spam sending, zero intrusive probing, zero prospect or customer data resale."
  },
  "servers": [
    {
      "url": "https://outbound.fastmesh.dev",
      "description": "Production HTTPS Public Gateway"
    },
    {
      "url": "http://127.0.0.1:9023",
      "description": "Local Engine"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service health, archive cache stats, batch ledger stats, and compliance flags",
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "summary": "OpenAPI 3.1.0 schema document",
        "responses": {
          "200": {
            "description": "OpenAPI JSON"
          }
        }
      }
    },
    "/v1/prospect/run": {
      "post": {
        "operationId": "runProspect",
        "summary": "Run single-domain or pasted-CSV preview Proof Teardown Microsite compilation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Public company domain or http(s) URL"
                  },
                  "csv_text": {
                    "type": "string",
                    "description": "Optional small pasted CSV preview (<= 10 rows)"
                  },
                  "vertical_id": {
                    "type": "string"
                  },
                  "tenant_id": {
                    "type": "string"
                  },
                  "seller_name": {
                    "type": "string"
                  },
                  "seller_offer": {
                    "type": "string"
                  },
                  "cta_url": {
                    "type": "string"
                  },
                  "cta_label": {
                    "type": "string"
                  },
                  "bypass_cache": {
                    "type": "boolean"
                  },
                  "include_html": {
                    "type": "boolean"
                  },
                  "include_markdown": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified dossier or unverified $0 report"
          },
          "422": {
            "description": "Invalid input or SSRF-blocked target ($0)"
          }
        }
      }
    },
    "/v1/batch/quote": {
      "post": {
        "operationId": "quoteBatch",
        "summary": "Zero-cost ($0) pre-flight quote across CSV, TSV, JSON, JSONL, SQLite, or inline rows",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pre-flight batch cost and cache hit estimate"
          },
          "422": {
            "description": "Invalid input ($0)"
          }
        }
      }
    },
    "/v1/batch/submit": {
      "post": {
        "operationId": "submitBatch",
        "summary": "Execute resumable SQLite WAL batch waterfall with hard max_budget_micros cap",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "csv_text": {
                    "type": "string"
                  },
                  "tsv_text": {
                    "type": "string"
                  },
                  "jsonl_text": {
                    "type": "string"
                  },
                  "rows": {
                    "type": "array"
                  },
                  "targets": {
                    "type": "array"
                  },
                  "sqlite_path": {
                    "type": "string"
                  },
                  "sqlite_table": {
                    "type": "string"
                  },
                  "domain_column": {
                    "type": "string"
                  },
                  "tenant_id": {
                    "type": "string"
                  },
                  "max_budget_micros": {
                    "type": "integer"
                  },
                  "vertical_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed or budget-paused batch job snapshot"
          },
          "422": {
            "description": "Invalid batch input"
          }
        }
      }
    },
    "/v1/batch/{job_id}": {
      "get": {
        "operationId": "getBatchStatus",
        "summary": "Retrieve batch job status, budget telemetry, and per-row dossier metadata",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch job snapshot"
          },
          "404": {
            "description": "Job not found"
          }
        }
      }
    },
    "/v1/batch/{job_id}/resume": {
      "post": {
        "operationId": "resumeBatch",
        "summary": "Resume a paused_budget batch job without re-executing completed rows",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "max_budget_micros": {
                    "type": "integer"
                  },
                  "add_budget_micros": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated batch job snapshot"
          },
          "404": {
            "description": "Job not found"
          }
        }
      }
    },
    "/microsite/{dossier_id}": {
      "get": {
        "operationId": "getProofMicrosite",
        "summary": "Serve standalone zero-external-dependency HTML Proof Teardown Microsite",
        "parameters": [
          {
            "name": "dossier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Standalone HTML Proof Microsite"
          },
          "404": {
            "description": "Dossier not found"
          }
        }
      }
    },
    "/webhooks/creem": {
      "post": {
        "operationId": "handleCreemWebhook",
        "summary": "HMAC-SHA256 verified idempotent Creem credit pack ledger webhook",
        "responses": {
          "200": {
            "description": "Webhook processed idempotently"
          },
          "401": {
            "description": "Invalid signature"
          },
          "503": {
            "description": "Webhook secret not configured"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "handleMcpJsonRpc",
        "summary": "Native MCP JSON-RPC 2.0 endpoint (direct flat tools + DualMcpFacade meta-tools)",
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response"
          }
        }
      }
    }
  }
}