{"openapi":"3.1.0","info":{"title":"RentPager AI API","description":"API for AI assistants to access property management data on behalf of landlords. Authenticate with a Bearer token (API key generated from the RentPager dashboard).","version":"1.0.0","contact":{"name":"RentPager","url":"https://rentpager.com/developers/ai"}},"servers":[{"url":"https://rentpager.com","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key from RentPager Dashboard > Settings > Developer. Format: rp_live_..."}}},"paths":{"/api/ai/properties":{"get":{"operationId":"getProperties","summary":"List all properties","description":"Returns all properties for the authenticated landlord, including occupancy data and tenant lists.","tags":["Properties"],"responses":{"200":{"description":"List of properties","content":{"application/json":{"schema":{"type":"object","properties":{"properties":{"type":"array","items":{"type":"object"}},"total_properties":{"type":"integer"}}}}}}}}},"/api/ai/renters":{"get":{"operationId":"getRenters","summary":"List all renters","description":"Returns all renters with their property assignments, rent amounts, and contact info.","tags":["Renters"],"parameters":[{"name":"status","in":"query","description":"Filter by status: active, inactive, or all (default)","schema":{"type":"string","enum":["active","inactive","all"]}}],"responses":{"200":{"description":"List of renters","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/ai/renters/overdue":{"get":{"operationId":"getOverdueRenters","summary":"List overdue renters","description":"Returns renters who have unpaid rent past their due date (accounting for leniency/grace periods). Requires read:renters and read:payments scopes.","tags":["Renters"],"responses":{"200":{"description":"Overdue renters with amounts and days overdue","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/ai/payments/summary":{"get":{"operationId":"getPaymentSummary","summary":"Payment summary and history","description":"Returns collected, pending, and overdue payment totals grouped by month.","tags":["Payments"],"parameters":[{"name":"months","in":"query","description":"Number of months of history to include (default: 6)","schema":{"type":"integer","default":6}}],"responses":{"200":{"description":"Payment summary with monthly breakdown","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/ai/maintenance":{"get":{"operationId":"getMaintenanceRequests","summary":"List maintenance requests","description":"Returns all maintenance requests with property, renter, and vendor details.","tags":["Maintenance"],"parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"Filter by status"},{"name":"priority","in":"query","schema":{"type":"string"},"description":"Filter by priority"},{"name":"property_id","in":"query","schema":{"type":"string"},"description":"Filter by property"}],"responses":{"200":{"description":"List of maintenance requests","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"operationId":"createMaintenanceRequest","summary":"Create a maintenance request","description":"Creates a new maintenance request for a property. Requires write:maintenance scope.","tags":["Maintenance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["property_id","title","description"],"properties":{"property_id":{"type":"string","description":"UUID of the property"},"title":{"type":"string","description":"Short title of the issue"},"description":{"type":"string","description":"Detailed description"},"priority":{"type":"string","enum":["low","medium","high","urgent"],"default":"medium"}}}}}},"responses":{"201":{"description":"Maintenance request created"}}}},"/api/ai/maintenance/stats":{"get":{"operationId":"getMaintenanceStats","summary":"Maintenance statistics","description":"Returns aggregated maintenance stats: completion rate, avg response time, costs by property.","tags":["Maintenance"],"responses":{"200":{"description":"Maintenance statistics","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/ai/vendors":{"get":{"operationId":"getVendors","summary":"List all vendors","description":"Returns all vendors/contractors for the authenticated landlord with contact info and specialty.","tags":["Vendors"],"responses":{"200":{"description":"List of vendors","content":{"application/json":{"schema":{"type":"object","properties":{"vendors":{"type":"array","items":{"type":"object"}},"total_vendors":{"type":"integer"}}}}}}}}},"/api/ai/vendor-dispatches":{"get":{"operationId":"getVendorDispatches","summary":"List vendor dispatches","description":"Returns all vendor dispatches (assignments and RFPs) with quote details, status, and linked maintenance tickets.","tags":["Vendors"],"parameters":[{"name":"status","in":"query","description":"Filter by dispatch status: pending, quoted, accepted, declined, info_requested, invoice_uploaded, completed","schema":{"type":"string"}},{"name":"vendor_id","in":"query","description":"Filter by vendor UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"List of vendor dispatches","content":{"application/json":{"schema":{"type":"object","properties":{"dispatches":{"type":"array","items":{"type":"object"}},"total_dispatches":{"type":"integer"}}}}}}}},"post":{"operationId":"createVendorDispatch","summary":"Dispatch a vendor to a maintenance request","description":"Creates a vendor dispatch (direct assign or RFP) for a maintenance request. Returns a portal link the vendor can use to submit quotes and invoices.","tags":["Vendors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["maintenance_request_id","vendor_id","dispatch_type"],"properties":{"maintenance_request_id":{"type":"string","description":"UUID of the maintenance request"},"vendor_id":{"type":"string","description":"UUID of the vendor to dispatch"},"dispatch_type":{"type":"string","enum":["assign","rfp"],"description":"'assign' for direct assignment, 'rfp' for request for proposal"},"notes":{"type":"string","description":"Optional notes for the vendor"}}}}}},"responses":{"201":{"description":"Dispatch created with portal link","content":{"application/json":{"schema":{"type":"object","properties":{"dispatch":{"type":"object"},"portal_link":{"type":"string","description":"URL the vendor can visit to respond"}}}}}}}}},"/api/ai/analytics/cash-flow":{"get":{"operationId":"getCashFlowProjection","summary":"Cash flow projection","description":"Projects future cash flow based on current rent income and historical maintenance costs.","tags":["Analytics"],"parameters":[{"name":"months_ahead","in":"query","description":"Number of months to project (default: 6)","schema":{"type":"integer","default":6}}],"responses":{"200":{"description":"Cash flow projections","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}