{
  "openapi": "3.1.0",
  "info": {
    "title": "SellMyData estimate API",
    "version": "1.0.0",
    "description": "Request an estimated price range for licensing a company’s de-identified business data to AI labs. A person reviews every request and replies by email. Docs: https://sellmydata.com/api/",
    "contact": {
      "email": "micki@sellmydata.com"
    }
  },
  "servers": [
    {
      "url": "https://sellmydata.com"
    }
  ],
  "paths": {
    "/api/estimate": {
      "post": {
        "operationId": "requestEstimate",
        "summary": "Request an estimate for a company’s data",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EstimateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EstimateRequest": {
        "type": "object",
        "required": [
          "email",
          "industry",
          "team_size",
          "years_history",
          "tools"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Work email the estimate is sent to."
          },
          "industry": {
            "type": "string",
            "maxLength": 120,
            "example": "Field services"
          },
          "team_size": {
            "type": "string",
            "enum": [
              "1–10",
              "11–50",
              "51–200",
              "200+"
            ]
          },
          "years_history": {
            "type": "string",
            "enum": [
              "Under 1 year",
              "1–2 years",
              "3–5 years",
              "5+ years"
            ],
            "description": "Based on the oldest tool in use."
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 60
            },
            "minItems": 1,
            "maxItems": 60,
            "example": [
              "Slack",
              "QuickBooks",
              "ServiceTitan"
            ]
          },
          "website": {
            "type": "string",
            "maxLength": 200,
            "description": "Company website (optional)."
          },
          "notes": {
            "type": "string",
            "maxLength": 2000,
            "description": "Rough volumes or anything else useful (optional). Do not include personal data."
          },
          "agent": {
            "type": "string",
            "maxLength": 120,
            "description": "Name of the agent or tool making the request (optional)."
          }
        }
      },
      "EstimateResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "message": {
            "type": "string"
          },
          "received": {
            "type": "object"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}