{"openapi":"3.1.0","info":{"title":"PlumbDraft Floor Plan CAD & Blueprint API","version":"1.0.0","description":"Compile floor plan geometry, validate residential clearances, calculate material takeoffs, digitize sketches, and export scaled vector PDF, layered AutoCAD R12 DXF, and SVG blueprints."},"servers":[{"url":"https://www.plumbdraft.com","description":"Production"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"pd_live_..."}},"schemas":{"FloorPlanRequest":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["walls"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"scale":{"type":"string","enum":["1/4\"","1/8\""]},"sheetSize":{"type":"string","enum":["ANSI_B","LETTER"]},"ceilingHeightIn":{"type":"number","default":96},"gridSnapIn":{"type":"number","default":6},"walls":{"type":"array","items":{"type":"object"}},"openings":{"type":"array","items":{"type":"object"}},"rooms":{"type":"array","items":{"type":"object"}},"furniture":{"type":"array","items":{"type":"object"}},"notes":{"type":"array","items":{"type":"object"}}}}}},"SketchRequest":{"type":"object","required":["imageBase64"],"properties":{"imageBase64":{"type":"string","description":"Base64-encoded PNG/JPEG/WebP/GIF image (max 8 MB)."},"mimeType":{"type":"string","default":"image/png"},"knownWidthFt":{"type":"number","description":"Optional overall width in feet for scale calibration."},"name":{"type":"string"}}}}},"paths":{"/api/v1/compile":{"post":{"summary":"Compile floor plan geometry","description":"Computes bounds, net room areas, wall linear footage, and sequential door/window tags. Free up to 10/day or unlimited with Bearer API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorPlanRequest"}}}},"responses":{"200":{"description":"CompiledGeometry JSON"},"400":{"description":"Invalid input"},"429":{"description":"Daily free limit reached"}}}},"/api/v1/ergonomics":{"post":{"summary":"Validate residential clearances and ergonomics","description":"Audits hallway widths, door swing conflicts, and fixture clearances. Free up to 10/day or with Bearer API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorPlanRequest"}}}},"responses":{"200":{"description":"ClearanceReport JSON"}}}},"/api/v1/takeoff":{"post":{"summary":"Calculate material takeoff & cost estimate","description":"Computes flooring with waste, drywall sheets, paint gallons, baseboard sticks, door/window schedules, and cost bands. Free up to 10/day or with Bearer API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorPlanRequest"}}}},"responses":{"200":{"description":"MaterialTakeoff JSON"}}}},"/api/v1/export/svg":{"post":{"summary":"Export architectural SVG blueprint","description":"Returns watermarked SVG on free tier (10/day) or clean unwatermarked SVG with Bearer API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorPlanRequest"}}}},"responses":{"200":{"description":"SVG blueprint","content":{"image/svg+xml":{}}}}}},"/api/v1/export/dxf":{"post":{"summary":"Export layered AutoCAD R12 DXF","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorPlanRequest"}}}},"responses":{"200":{"description":"AutoCAD R12 DXF file","content":{"application/dxf":{}}},"401":{"description":"Bearer API key required"}}}},"/api/v1/export/pdf":{"post":{"summary":"Export scaled vector PDF blueprint","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorPlanRequest"}}}},"responses":{"200":{"description":"Vector PDF blueprint","content":{"application/pdf":{}}},"401":{"description":"Bearer API key required"}}}},"/api/v1/sketch-to-plan":{"post":{"summary":"Digitize a hand-drawn floor plan sketch into FloorPlan JSON","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SketchRequest"}}}},"responses":{"200":{"description":"Normalized FloorPlan JSON"},"401":{"description":"Bearer API key required"},"413":{"description":"Image exceeds 8 MB limit"}}}}}}