API Reference
Complete REST API documentation for PIE. All endpoints accept and return JSON.
Base URL
http://72.46.85.157:31841/apiAll list endpoints support ?search=, ?limit=, and ?offset= query parameters.
AI Endpoints
POST /api/enrich — Gemini Permit Enrichment
curl -X POST /api/enrich \
-H 'Content-Type: application/json' \
-d '{"normalized_permit_id": "uuid-here"}'Sends the permit's work description to Gemini and returns structured intelligence including systems impacted, asset classes, lifecycle event, criticality, relevance scores, and reasoning.
POST /api/ai-populate — AI Auto-Populate
curl -X POST /api/ai-populate \
-H 'Content-Type: application/json' \
-d '{"clue": "Park Hyatt NYC", "entity_type": "properties"}'Accepts a natural language clue and entity type. Returns structured form data generated by Gemini based on real-world knowledge.
Supported entity_type values: jurisdictions, properties, locations, systems, assets, contractors, permits, inspections, findings, evidence, signals, obligations, lifecycle
All Endpoints (33)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/dashboard | Real-time counts across all entity types |
| GET | /api/jurisdictions | List jurisdictions with search and pagination |
| POST | /api/jurisdictions | Create a new jurisdiction |
| GET | /api/properties | List properties with search and pagination |
| POST | /api/properties | Create a new property |
| GET | /api/locations | List locations within properties |
| POST | /api/locations | Create a new location |
| GET | /api/systems | List building systems |
| POST | /api/systems | Create a new system |
| GET | /api/assets | List assets/equipment |
| POST | /api/assets | Create a new asset |
| GET | /api/contractors | List contractors |
| POST | /api/contractors | Create a new contractor |
| GET | /api/permits | List normalized permits |
| POST | /api/permits | Create a new permit |
| GET | /api/inspections | List inspections |
| POST | /api/inspections | Create a new inspection |
| GET | /api/findings | List findings and evidence gaps |
| POST | /api/findings | Create a new finding |
| GET | /api/evidence | List evidence records |
| POST | /api/evidence | Create evidence record |
| GET | /api/signals | List insurance signals |
| POST | /api/signals | Create insurance signal |
| GET | /api/obligations | List obligations |
| POST | /api/obligations | Create obligation |
| GET | /api/lifecycle | List lifecycle events |
| POST | /api/lifecycle | Create lifecycle event |
| GET | /api/relationships | List entity relationships |
| POST | /api/relationships | Create relationship |
| GET | /api/targeting | List market targeting scores |
| POST | /api/targeting | Create targeting score |
| POST | /api/enrich | Run Gemini AI enrichment on a permit |
| POST | /api/ai-populate | AI auto-populate form fields from a clue |
Response Format
List Response
{
"data": [
{ "property_id": "uuid", "address": "...", ... },
{ "property_id": "uuid", "address": "...", ... }
],
"total": 42
}Create Response
{
"property_id": "uuid-generated",
"address": "153 W 57th St...",
"property_type": "hotel",
"created_at": "2026-04-01T..."
}Database Schema
The PIE database consists of 25 PostgreSQL tables organized into 5 domains:
Registry (7 tables)
- organizations
- users
- jurisdictions
- properties
- locations
- systems
- assets
Intelligence (8 tables)
- contractors
- sync_batches
- raw_permits
- normalized_permits
- inspections
- findings
- permit_enrichments
- candidate_matches
Operations (10 tables)
- evidence_records
- attachments
- obligations
- insurance_signals
- lifecycle_events
- relationships
- market_targeting_scores
- review_logs
- user_notes