{
 "openapi": "3.1.0",
 "info": {
  "title": "ProveHound Search API",
  "version": "1.0.0",
  "description": "Search contractors ranked by Proof Score. Send the public anon key in the apikey header."
 },
 "servers": [
  {
   "url": "https://YOUR-PROJECT.supabase.co/rest/v1"
  }
 ],
 "components": {
  "securitySchemes": {
   "apikey": {
    "type": "apiKey",
    "in": "header",
    "name": "apikey"
   }
  }
 },
 "security": [
  {
   "apikey": []
  }
 ],
 "paths": {
  "/rpc/search_pros": {
   "post": {
    "operationId": "searchPros",
    "summary": "Search pros ranked by Proof Score",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "q": {
          "type": "string",
          "description": "What the customer needs"
         },
         "near": {
          "type": "string",
          "description": "City or ZIP (default Denver)"
         },
         "radius_mi": {
          "type": "number"
         },
         "lim": {
          "type": "integer",
          "maximum": 50
         }
        },
        "required": [
         "q"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Ranked pros with receipts"
     }
    }
   }
  },
  "/verify": {
   "servers": [
    {
     "url": "https://www.provehound.com/api"
    }
   ],
   "get": {
    "operationId": "verifyPro",
    "security": [],
    "summary": "Verify one pro by slug, license number or name; returns status, licenses and a signed receipt",
    "parameters": [
     {
      "name": "slug",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "ProveHound listing slug"
     },
     {
      "name": "license",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "License number"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Two-letter state for the license"
     },
     {
      "name": "name",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Business name"
     },
     {
      "name": "city",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "City to narrow a name search"
     }
    ],
    "responses": {
     "200": {
      "description": "Verification result with signedReceipt (vc+jwt)"
     }
    }
   }
  },
  "/rpc/get_pro": {
   "post": {
    "operationId": "getPro",
    "summary": "Full proof record for one pro",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "p_slug": {
          "type": "string"
         }
        },
        "required": [
         "p_slug"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Pro with licenses and confirmed jobs"
     }
    }
   }
  }
 }
}