{"openapi":"3.0.3","info":{"title":"Parcel API","version":"1.0.0","description":"One API for every AI tool real estate needs: listing copy, fair-housing checks, photo intelligence, lead qualification, contract extraction, CMAs and property agents."},"servers":[{"url":"https://parcel.westwardconsulting.ai/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/listings/write":{"post":{"operationId":"listingWriter","summary":"Listing Writer","description":"Turns raw property facts into a headline, a full description, MLS-ready public remarks within your character limit, highlights, a social caption, hashtags and an email subject. Uses only the facts you give it and screens every word for fair-housing risk.","tags":["Marketing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"property":{"type":"object","properties":{"address":{"type":"string","maxLength":200},"property_type":{"default":"single_family","type":"string","enum":["single_family","condo","townhouse","multi_family","land","commercial","other"]},"price":{"type":"number","minimum":0,"exclusiveMinimum":true},"beds":{"type":"number","minimum":0,"maximum":100},"baths":{"type":"number","minimum":0,"maximum":100},"sqft":{"type":"number","minimum":0,"exclusiveMinimum":true},"lot_size":{"type":"string","maxLength":60},"year_built":{"type":"integer","minimum":1600,"maximum":2100},"features":{"default":[],"maxItems":80,"type":"array","items":{"type":"string","maxLength":300}},"neighborhood":{"description":"Nearby places and amenities, by name.","type":"string","maxLength":2000},"notes":{"description":"Anything else the agent wants mentioned.","type":"string","maxLength":4000}}},"tone":{"default":"warm","type":"string","enum":["warm","luxury","modern","concise","investor"]},"mls_char_limit":{"default":1000,"type":"integer","minimum":200,"maximum":5000},"language":{"default":"English","type":"string","maxLength":40}},"required":["property"]},"example":{"property":{"address":"418 Alder Lane, Portland, OR 97214","property_type":"single_family","price":849000,"beds":4,"baths":2.5,"sqft":2380,"lot_size":"5,000 sq ft","year_built":1926,"features":["Renovated kitchen with quartz counters and a 36-inch gas range","Original fir floors refinished in 2024","Primary suite with walk-in closet and heated bathroom floors","Covered front porch","Detached garage converted to a studio with power and skylights","New roof (2023) and seismic retrofit"],"neighborhood":"Three blocks to Laurelhurst Park; Belmont Street cafes and shops a short walk away."},"tone":"warm","mls_char_limit":1000}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["listing-writer"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"headline":{"type":"string","description":"Under 70 characters."},"description":{"type":"string","description":"Full marketing description, 120-250 words, 2-3 short paragraphs separated by blank lines."},"mls_remarks":{"type":"string","description":"Plain-text public remarks for the MLS, within the character limit."},"highlights":{"type":"array","items":{"type":"string"},"description":"4-6 short highlight phrases."},"social_caption":{"type":"string","description":"1-3 sentences for Instagram/Facebook. At most 2 emojis."},"hashtags":{"type":"array","items":{"type":"string"},"description":"5-8 hashtags without the # sign."},"email_subject":{"type":"string","description":"Under 60 characters."},"compliance":{"type":"object","properties":{"passed":{"type":"boolean","description":"False when the automated screen found a high-severity phrase."},"flags":{"type":"array","items":{"type":"object","properties":{"phrase":{"type":"string"},"category":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"note":{"type":"string"}},"required":["phrase","category","severity","note"],"additionalProperties":false}}},"required":["passed","flags"],"additionalProperties":false}},"required":["headline","description","mls_remarks","highlights","social_caption","hashtags","email_subject","compliance"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/compliance/fair-housing":{"post":{"operationId":"fairHousing","summary":"Fair Housing Check","description":"Reviews any listing, ad, post, email or rental criteria for fair-housing risk. Returns each problem phrase with the protected class involved, why it matters, compliant wording, and a fully revised version. A deterministic phrase screen runs first; the AI then confirms or dismisses each hit in context.","tags":["Compliance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":30000},"context":{"default":"listing","type":"string","enum":["listing","advertisement","social_post","email","rental_criteria","other"]},"jurisdiction":{"description":"State or city, so local protected classes (e.g. source of income) are considered.","type":"string","maxLength":120}},"required":["text"]},"example":{"text":"Charming 2BR bungalow in a quiet, exclusive neighborhood. Perfect for a young couple or empty nesters! Walking distance to St. Mary's church. Master suite with garden views. Sorry, no Section 8.","context":"listing","jurisdiction":"Washington State"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["fair-housing"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"risk_level":{"type":"string","enum":["none","low","medium","high"]},"summary":{"type":"string","description":"Two or three sentences a busy agent can act on."},"issues":{"type":"array","items":{"type":"object","properties":{"quote":{"type":"string","description":"The exact words from the text."},"category":{"type":"string","enum":["race","color","religion","sex","disability","familial_status","national_origin","age","source_of_income","sexual_orientation_gender_identity","marital_status","steering","other"]},"severity":{"type":"string","enum":["low","medium","high"]},"explanation":{"type":"string"},"suggestion":{"type":"string","description":"Compliant replacement wording."}},"required":["quote","category","severity","explanation","suggestion"],"additionalProperties":false}},"revised_text":{"type":"string","description":"The full text rewritten to remove every issue, otherwise unchanged in meaning and style."},"screen_hits":{"type":"array","items":{"type":"object","properties":{"phrase":{"type":"string"},"category":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"note":{"type":"string"}},"required":["phrase","category","severity","note"],"additionalProperties":false},"description":"Phrases caught by the deterministic screen, before AI review."},"disclaimer":{"type":"string"}},"required":["risk_level","summary","issues","revised_text","screen_hits","disclaimer"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/photos/analyze":{"post":{"operationId":"photoAnalyzer","summary":"Photo Intelligence","description":"Classifies a listing photo, lists visible features and finishes, rates condition and photo quality (with a hero-shot score), writes alt text and a caption, suggests staging fixes, and flags anything that should not be published, like people, family photos or license plates.","tags":["Media"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"description":"Public https URL of the photo.","type":"string","format":"uri"},"image_base64":{"description":"Base64-encoded image bytes (no data: prefix). 5 MB max.","type":"string","maxLength":6900000},"media_type":{"description":"Required with image_base64.","type":"string","enum":["image/jpeg","image/png","image/webp","image/gif"]},"context":{"description":"Optional listing facts, so captions match the property.","type":"string","maxLength":2000}}},"example":{"image_url":"https://example.com/listings/418-alder/kitchen.jpg","context":"1926 craftsman, renovated kitchen with quartz counters."}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["photo-analyzer"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"room_type":{"type":"string","enum":["exterior_front","exterior_back","aerial","kitchen","living_room","dining_room","family_room","bedroom","primary_bedroom","bathroom","primary_bathroom","office","laundry","garage","basement","hallway_entry","outdoor_space","pool","view","amenity","floor_plan","other"]},"room_label":{"type":"string","description":"Short human label, e.g. 'Kitchen with island'."},"features":{"type":"array","items":{"type":"string"},"description":"Visible features a buyer would care about."},"materials_and_finishes":{"type":"array","items":{"type":"string"}},"condition":{"type":"string","enum":["excellent","good","fair","needs_work","unclear"]},"photo_quality":{"type":"object","properties":{"lighting":{"type":"string","enum":["poor","fair","good","excellent"]},"composition":{"type":"string","enum":["poor","fair","good","excellent"]},"hero_score":{"type":"number","description":"1-10: how well this would work as the lead listing photo."},"issues":{"type":"array","items":{"type":"string"},"description":"Fixable problems: tilt, clutter, dark corners, photographer reflection..."}},"required":["lighting","composition","hero_score","issues"],"additionalProperties":false},"alt_text":{"type":"string","description":"Accessible alt text, under 125 characters, describing what is visible."},"caption":{"type":"string","description":"One-sentence marketing caption using only what is visible."},"staging_suggestions":{"type":"array","items":{"type":"string"}},"privacy_flags":{"type":"array","items":{"type":"string"},"description":"Things to remove before publishing: people, family photos, license plates, documents, valuables, security codes."}},"required":["room_type","room_label","features","materials_and_finishes","condition","photo_quality","alt_text","caption","staging_suggestions","privacy_flags"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/leads/qualify":{"post":{"operationId":"leadQualifier","summary":"Lead Qualifier","description":"Reads an inbound email, text, portal inquiry or call transcript and returns intent, a 0-100 score, timeline, budget, financing, locations and must-haves, contact details, scam signals, the next best action and a ready-to-send reply. Built for CRMs, inboxes and speed-to-lead automations.","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":15000,"description":"The inbound message, form submission or call transcript."},"channel":{"default":"email","type":"string","enum":["email","sms","web_form","portal","phone_transcript","social_dm","other"]},"lead_name":{"type":"string","maxLength":120},"listing":{"description":"The listing the lead asked about, if any.","type":"string","maxLength":4000},"agent_name":{"type":"string","maxLength":120},"brokerage":{"type":"string","maxLength":160}},"required":["message"]},"example":{"message":"Hi! Saw the Alder Lane house on Zillow. We're relocating from Denver for my wife's job in late June and are pre-approved up to $900k. Need 4 beds and a yard for the dog, would love Laurelhurst or Sunnyside. Can we see it this weekend? - Marcus, 720-555-0148","channel":"portal","listing":"418 Alder Lane, 4 bd / 2.5 ba, 2,380 sq ft, $849,000","agent_name":"Dana"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["lead-qualifier"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"intent":{"type":"string","enum":["buy","sell","buy_and_sell","rent","lease_out","invest","other","unclear"]},"temperature":{"type":"string","enum":["hot","warm","cold"]},"score":{"type":"number","description":"0-100 likelihood of transacting in the next 90 days."},"timeline":{"nullable":true,"description":"Their stated or implied timeline, in their terms.","type":"string"},"budget_min":{"nullable":true,"type":"number"},"budget_max":{"nullable":true,"type":"number"},"financing":{"type":"string","enum":["cash","preapproved","needs_financing","unknown"]},"locations":{"type":"array","items":{"type":"string"}},"must_haves":{"type":"array","items":{"type":"string"}},"contact":{"type":"object","properties":{"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"}},"required":["name","email","phone"],"additionalProperties":false},"summary":{"type":"string","description":"One or two sentences for the CRM."},"red_flags":{"type":"array","items":{"type":"string"},"description":"Spam, scam or wire-fraud signals; empty if none."},"next_best_action":{"type":"string"},"suggested_reply":{"type":"string","description":"Ready-to-send reply in the agent's voice, matched to the channel."},"follow_up_questions":{"type":"array","items":{"type":"string"}}},"required":["intent","temperature","score","timeline","budget_min","budget_max","financing","locations","must_haves","contact","summary","red_flags","next_best_action","suggested_reply","follow_up_questions"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/documents/extract":{"post":{"operationId":"documentExtractor","summary":"Contract Extractor","description":"Reads a purchase agreement, lease, listing agreement, disclosure or inspection report (PDF or text) and returns structured parties, financial terms, every date and deadline with its source quote, contingencies, obligations, red flags and unfilled blanks. Feed it to your transaction-management system or calendar.","tags":["Transactions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"description":"Document text, if you already have it.","type":"string","maxLength":500000},"pdf_base64":{"description":"Base64-encoded PDF (no data: prefix).","type":"string","maxLength":4000000},"document_type":{"default":"auto","anyOf":[{"type":"string","enum":["auto"]},{"type":"string","enum":["purchase_agreement","lease","listing_agreement","buyer_agreement","disclosure","inspection_report","addendum","title_or_escrow","other"]}]},"focus":{"description":"Anything specific to look for.","type":"string","maxLength":1000}}},"example":{"text":"RESIDENTIAL PURCHASE AGREEMENT\nDate: October 3, 2026\nBuyer: Marcus and Elena Reyes. Seller: Thomas Whitfield.\nProperty: 418 Alder Lane, Portland, OR 97214.\n1. PRICE. Purchase price $835,000. Earnest money of $25,000 to be deposited with Cascade Title within 3 business days of acceptance.\n2. FINANCING. Buyer to obtain a conventional loan of 80% of the price. Financing contingency expires 21 days after acceptance.\n3. INSPECTION. Buyer may inspect within 10 days after acceptance and deliver a repair request; Seller to respond within 3 days.\n4. APPRAISAL. If the property appraises below the price, Buyer may terminate within 5 days of receiving the appraisal.\n5. CLOSING. Closing on or before November 14, 2026. Possession at closing.\n6. SELLER CREDIT. Seller to credit Buyer $_______ toward closing costs.\n7. ADDENDA. Lead-based paint disclosure (Addendum A) attached.\nBuyer signature: ____________  Seller signature: ____________","document_type":"auto"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["document-extractor"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"document_type":{"type":"string","enum":["purchase_agreement","lease","listing_agreement","buyer_agreement","disclosure","inspection_report","addendum","title_or_escrow","other"]},"title":{"type":"string"},"summary":{"type":"string","description":"What this document does, in 3-5 plain sentences."},"property_address":{"nullable":true,"type":"string"},"parties":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"name":{"type":"string"}},"required":["role","name"],"additionalProperties":false}},"financials":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"e.g. Purchase price, Earnest money, Monthly rent, Security deposit, Seller credit."},"amount":{"nullable":true,"type":"number"},"text":{"type":"string","description":"As written in the document."}},"required":["label","amount","text"],"additionalProperties":false}},"key_dates":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"date":{"nullable":true,"description":"YYYY-MM-DD when a calendar date can be determined.","type":"string"},"rule":{"nullable":true,"description":"Relative rule as written, e.g. '10 days after acceptance'.","type":"string"},"source_quote":{"type":"string"}},"required":["label","date","rule","source_quote"],"additionalProperties":false}},"contingencies":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"deadline":{"nullable":true,"type":"string"},"details":{"type":"string"}},"required":["type","deadline","details"],"additionalProperties":false}},"obligations":{"type":"array","items":{"type":"object","properties":{"party":{"type":"string"},"obligation":{"type":"string"}},"required":["party","obligation"],"additionalProperties":false}},"red_flags":{"type":"array","items":{"type":"object","properties":{"issue":{"type":"string"},"why_it_matters":{"type":"string"},"source_quote":{"nullable":true,"type":"string"}},"required":["issue","why_it_matters","source_quote"],"additionalProperties":false}},"blanks_and_missing":{"type":"array","items":{"type":"string"},"description":"Unfilled blanks, missing signatures or initials, referenced but missing addenda."}},"required":["document_type","title","summary","property_address","parties","financials","key_dates","contingencies","obligations","red_flags","blanks_and_missing"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/valuations/cma":{"post":{"operationId":"cma","summary":"CMA Builder","description":"Takes a subject property and your comparables and returns price-per-square-foot statistics (computed exactly, not by the AI), line-item adjustments and weights for each comp, a low/mid/high value range, a suggested price, a rationale for the agent and a summary to send the client.","tags":["Valuation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"object","properties":{"address":{"type":"string","maxLength":200},"property_type":{"default":"single family","type":"string","maxLength":60},"beds":{"type":"number","minimum":0,"maximum":100},"baths":{"type":"number","minimum":0,"maximum":100},"sqft":{"type":"number","minimum":0,"exclusiveMinimum":true},"year_built":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lot_size":{"type":"string","maxLength":60},"condition":{"default":"good","type":"string","enum":["new","excellent","good","average","fair","poor"]},"features":{"default":[],"maxItems":40,"type":"array","items":{"type":"string","maxLength":300}}},"required":["beds","baths","sqft"]},"comps":{"minItems":2,"maxItems":25,"type":"array","items":{"type":"object","properties":{"address":{"type":"string","maxLength":200},"status":{"default":"sold","type":"string","enum":["sold","pending","active"]},"price":{"type":"number","minimum":0,"exclusiveMinimum":true,"description":"Sold price, or list price for pending/active."},"date":{"description":"Sold or listed date.","type":"string","maxLength":40},"beds":{"type":"number","minimum":0,"maximum":100},"baths":{"type":"number","minimum":0,"maximum":100},"sqft":{"type":"number","minimum":0,"exclusiveMinimum":true},"year_built":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lot_size":{"type":"string","maxLength":60},"distance_miles":{"type":"number","minimum":0},"condition":{"type":"string","enum":["new","excellent","good","average","fair","poor"]},"notes":{"type":"string","maxLength":600}},"required":["address","price","beds","baths","sqft"]}},"purpose":{"default":"listing_price","type":"string","enum":["listing_price","buyer_offer","seller_estimate"]}},"required":["subject","comps"]},"example":{"subject":{"address":"418 Alder Lane","beds":4,"baths":2.5,"sqft":2380,"year_built":1926,"lot_size":"5,000 sq ft","condition":"excellent","features":["Renovated kitchen","Studio in converted garage","New roof 2023"]},"comps":[{"address":"502 Alder Ln","price":815000,"date":"2026-08-12","beds":4,"baths":2,"sqft":2250,"year_built":1924,"condition":"good","distance_miles":0.1},{"address":"1130 SE 37th Ave","price":872000,"date":"2026-07-02","beds":4,"baths":3,"sqft":2510,"year_built":1931,"condition":"excellent","distance_miles":0.4},{"address":"3315 SE Ankeny St","price":769000,"date":"2026-09-20","beds":3,"baths":2,"sqft":2050,"year_built":1912,"condition":"average","distance_miles":0.5},{"address":"455 SE 41st Ave","status":"pending","price":899000,"beds":4,"baths":3,"sqft":2600,"year_built":1928,"condition":"excellent","distance_miles":0.6}],"purpose":"listing_price"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["cma"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"adjusted_comps":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"adjusted_price":{"type":"number"},"weight":{"type":"number","description":"0-1; weights across comps sum to 1."},"adjustments":{"type":"array","items":{"type":"object","properties":{"factor":{"type":"string"},"amount":{"type":"number"},"reason":{"type":"string"}},"required":["factor","amount","reason"],"additionalProperties":false}}},"required":["address","adjusted_price","weight","adjustments"],"additionalProperties":false}},"value_low":{"type":"number"},"value_mid":{"type":"number"},"value_high":{"type":"number"},"suggested_price":{"type":"number","description":"Recommended list price or offer, depending on purpose."},"confidence":{"type":"string","enum":["low","medium","high"]},"rationale":{"type":"string","description":"How the comps were weighed, for the agent."},"client_summary":{"type":"string","description":"Plain-language summary an agent can send to a client."},"caveats":{"type":"array","items":{"type":"string"}},"stats":{"type":"object","properties":{"comps_used":{"type":"number"},"median_price_per_sqft":{"type":"number"},"mean_price_per_sqft":{"type":"number"},"low_price_per_sqft":{"type":"number"},"high_price_per_sqft":{"type":"number"},"baseline_value":{"type":"number","description":"Subject square footage times the median price per square foot of sold comps."}},"required":["comps_used","median_price_per_sqft","mean_price_per_sqft","low_price_per_sqft","high_price_per_sqft","baseline_value"],"additionalProperties":false},"disclaimer":{"type":"string"}},"required":["adjusted_comps","value_low","value_mid","value_high","suggested_price","confidence","rationale","client_summary","caveats","stats","disclaimer"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/agents/property-chat":{"post":{"operationId":"propertyAgent","summary":"Property Agent","description":"A conversational agent grounded in one listing. Send the listing facts and the conversation so far; get the next reply, the lead details captured so far, and a flag when a human should take over (offers, negotiation, legal or financing questions). Stateless: you keep the transcript, so it drops into any website chat, SMS line or portal inbox.","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listing":{"type":"string","minLength":1,"maxLength":20000,"description":"Everything the assistant may say about the property, as text or JSON."},"messages":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","content"]}},"agent_name":{"type":"string","maxLength":120},"brokerage":{"type":"string","maxLength":160},"showing_link":{"description":"Booking link the assistant can offer.","type":"string","format":"uri"}},"required":["listing","messages"]},"example":{"listing":"418 Alder Lane, Portland, OR 97214. $849,000. 4 bed / 2.5 bath, 2,380 sq ft, built 1926, 5,000 sq ft lot. Renovated kitchen (quartz, 36in gas range). Refinished original fir floors. Primary suite with heated bath floors. Detached studio with power and skylights. New roof 2023, seismic retrofit. Gas forced-air heat, central AC. Property taxes $9,412 (2025). No HOA. Open house Saturday 1-3pm.","messages":[{"role":"user","content":"Hi, is there AC? And could we see it before the open house?"}],"agent_name":"Dana Whitaker","brokerage":"Northwest Realty"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tool.result"]},"tool":{"type":"string","enum":["property-agent"]},"created":{"type":"integer"},"model":{"type":"string"},"data":{"type":"object","properties":{"reply":{"type":"string","description":"The assistant's next message, plain text, 1-4 sentences."},"lead":{"type":"object","properties":{"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"intent":{"type":"string","enum":["buy","rent","sell","just_browsing","unknown"]},"timeline":{"nullable":true,"type":"string"},"preapproved":{"nullable":true,"type":"boolean"},"wants_showing":{"type":"boolean"}},"required":["name","email","phone","intent","timeline","preapproved","wants_showing"],"additionalProperties":false},"handoff_to_human":{"type":"boolean"},"handoff_reason":{"nullable":true,"type":"string"}},"required":["reply","lead","handoff_to_human","handoff_reason"],"additionalProperties":false},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (pcl_live_...)"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}}}}