{
  "openapi": "3.1.0",
  "info": {
    "title": "WouldTheyBuy API",
    "version": "1.0.0",
    "description": "Programmatic access for testing product ideas and retrieving directional purchase-intent feedback."
  },
  "servers": [
    {
      "url": "https://wouldtheybuy.com"
    }
  ],
  "paths": {
    "/api/score-campaign": {
      "post": {
        "operationId": "scoreCampaign",
        "summary": "Test a product idea",
        "description": "Submit a product concept and receive directional purchase-intent feedback.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["name", "headline", "body", "cta", "offer"],
                "properties": {
                  "name": { "type": "string" },
                  "headline": { "type": "string" },
                  "body": { "type": "string" },
                  "cta": { "type": "string" },
                  "offer": { "type": "string" },
                  "disclaimers": { "type": "string" },
                  "seed": { "type": "integer" },
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign scoring job accepted or completed."
          }
        },
        "x-payment-info": {
          "intent": "charge",
          "method": "card",
          "amount": "0.00",
          "currency": "USD",
          "description": "Public demo access"
        }
      }
    },
    "/api/campaigns": {
      "get": {
        "operationId": "listCampaigns",
        "summary": "List recent campaigns",
        "responses": {
          "200": {
            "description": "Recent campaign summaries."
          }
        }
      }
    },
    "/api/jobs/{id}": {
      "get": {
        "operationId": "getJobStatus",
        "summary": "Get campaign job status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Current job status."
          }
        }
      }
    }
  }
}
