API Documentation
Complete endpoint reference for the Built Correct platform.
Leads
/api/leads
| GET | /api/leads | List all leads with filtering | Auth |
| POST | /api/leads | Create a new lead | Auth |
| GET | /api/leads/:id | Get lead details | Auth |
| PATCH | /api/leads/:id | Update lead | Auth |
| DELETE | /api/leads/:id | Soft-delete lead | Auth |
| POST | /api/leads/:id/convert | Convert lead to customer | Auth |
| PATCH | /api/leads/:id/stage | Update lead stage | Auth |
Customers
/api/customers
| GET | /api/customers | List all customers | Auth |
| POST | /api/customers | Create customer | Auth |
| GET | /api/customers/:id | Get customer details | Auth |
| PATCH | /api/customers/:id | Update customer | Auth |
| DELETE | /api/customers/:id | Soft-delete customer | Auth |
Estimates
/api/estimates
| GET | /api/estimates | List estimates | Auth |
| POST | /api/estimates | Create estimate | Auth |
| GET | /api/estimates/:id | Get estimate details | Auth |
| PATCH | /api/estimates/:id | Update estimate | Auth |
| POST | /api/estimates/:id/duplicate | Duplicate estimate | Auth |
| POST | /api/estimates/:id/send | Send estimate to customer | Auth |
| PATCH | /api/estimates/:id/stage | Update estimate stage | Auth |
Work Orders
/api/work-orders
| GET | /api/work-orders | List work orders | Auth |
| POST | /api/work-orders | Create work order | Auth |
| GET | /api/work-orders/:id | Get work order details | Auth |
| PATCH | /api/work-orders/:id | Update work order | Auth |
| PATCH | /api/work-orders/:id/status | Update work order status | Auth |
| POST | /api/work-orders/:id/assign | Assign installer | Auth |
Purchase Orders
/api/purchase-orders
| GET | /api/purchase-orders | List purchase orders | Auth |
| POST | /api/purchase-orders | Create purchase order | Auth |
| GET | /api/purchase-orders/:id | Get PO details | Auth |
| PATCH | /api/purchase-orders/:id | Update PO | Auth |
| POST | /api/purchase-orders/:id/receive | Receive PO items | Auth |
| GET | /api/purchase-orders/:id/price-flags | Get price discrepancy flags | Auth |
| POST | /api/purchase-orders/:id/price-flags/:itemId/resolve | Resolve price flag | Auth |
Invoices
/api/invoices
| GET | /api/invoices | List invoices | Auth |
| POST | /api/invoices | Create invoice | Auth |
| GET | /api/invoices/:id | Get invoice details | Auth |
| PATCH | /api/invoices/:id | Update invoice | Auth |
| POST | /api/invoices/:id/send | Send invoice to customer | Auth |
| POST | /api/invoices/:id/void | Void invoice | Auth |
Payments
/api/invoice-payments
| GET | /api/invoice-payments | List payments | Auth |
| POST | /api/invoice-payments | Record payment | Auth |
| GET | /api/invoice-payments/:id | Get payment details | Auth |
| DELETE | /api/invoice-payments/:id | Void payment | Auth |
Change Orders
/api/change-orders
| GET | /api/change-orders | List change orders | Auth |
| POST | /api/change-orders | Create change order | Auth |
| GET | /api/change-orders/:id | Get change order details | Auth |
| PATCH | /api/change-orders/:id | Update change order | Auth |
| POST | /api/change-orders/:id/approve | Approve change order | Auth |
| POST | /api/change-orders/:id/sync-qb | Sync supplemental invoice to QuickBooks | Auth |
Inventory
/api/inventory
| GET | /api/inventory | List inventory items | Auth |
| POST | /api/inventory | Create inventory item | Auth |
| PATCH | /api/inventory/:id | Update inventory | Auth |
| POST | /api/inventory/adjust | Adjust inventory quantity | Auth |
| GET | /api/inventory/alerts | Get inventory alerts | Auth |
Commissions
/api/commissions
| GET | /api/commissions | List commission records | Auth |
| POST | /api/commissions/calculate | Calculate commissions for period | Auth |
| POST | /api/commissions/:id/approve | Approve commission payout | Auth |
| GET | /api/commissions/summary | Commission summary by rep | Auth |
Users
/api/users
| GET | /api/users | List all users | Auth |
| POST | /api/users/create | Create user with password | Auth |
| POST | /api/users/invite | Invite user via email | Auth |
| GET | /api/users/:id | Get user details | Auth |
| PATCH | /api/users/:id | Update user | Auth |
| DELETE | /api/users/:id | Soft-delete user | Auth |
| POST | /api/users/:id/deactivate | Deactivate user | Auth |
| POST | /api/users/:id/reactivate | Reactivate user | Auth |
| POST | /api/users/:id/reset-password | Admin password reset | Auth |
| PATCH | /api/users/:id/role | Update user role | Auth |
| POST | /api/users/:id/unlock | Unlock locked account | Auth |
| POST | /api/users/:id/toggle-2fa | Toggle 2FA | Auth |
Admin
/api/admin
| GET | /api/admin/roles | List all roles | Auth |
| GET | /api/admin/roles/:id | Get role with permissions | Auth |
| POST | /api/admin/roles | Create custom role | Auth |
| PATCH | /api/admin/roles/:id | Update role | Auth |
| PUT | /api/admin/roles/:id/permissions | Set role permissions | Auth |
| GET | /api/admin/audit-log | Query audit log | Auth |
| GET | /api/admin/page-access-matrix | Get page access matrix | Auth |
| PUT | /api/admin/page-access-matrix | Toggle page access | Auth |
Settings
/api/settings
| GET | /api/settings | Get all settings | Auth |
| PATCH | /api/settings | Update settings | Auth |
| GET | /api/settings/state-tax/:stateCode | Get state tax reference | Auth |
Integrations
/api/integrations
| GET | /api/integrations | Integration dashboard (stats, events, config) | Auth |
| GET | /api/integrations/config | Get Flooring Studio integration config | Auth |
| PATCH | /api/integrations/config | Update Flooring Studio config | Auth |
| GET | /api/integrations/events | List integration events | Auth |
| POST | /api/integrations/retry/:eventId | Retry failed event | Auth |
| POST | /api/integrations/retry-all | Retry all failed events | Auth |
| POST | /api/integrations/webhook/dotnet | Receive Flooring Studio webhook | Public |
QuickBooks
/api/qb
| POST | /api/qb/connect | Start OAuth flow | Auth |
| GET | /api/qb/callback | OAuth callback | Auth |
| POST | /api/qb/disconnect | Disconnect QB | Auth |
| GET | /api/qb/status | Connection & sync status | Auth |
| POST | /api/qb/sync/full-reconciliation | Full bidirectional sync | Auth |
| POST | /api/qb/sync/all | Sync all pending records | Auth |
| POST | /api/qb/sync/customer/:id | Sync single customer | Auth |
| POST | /api/qb/sync/invoice/:id | Sync single invoice | Auth |
| POST | /api/qb/sync/payment/:id | Sync single payment | Auth |
| GET | /api/qb/conflicts | List sync conflicts | Auth |
| PATCH | /api/qb/conflicts/:id | Resolve conflict | Auth |
| GET | /api/qb/logs | Sync event log | Auth |
| GET | /api/qb/tax-code-mapping | Tax code mappings | Auth |
| PATCH | /api/qb/tax-code-mapping | Save tax code mappings | Auth |
| GET | /api/qb/account-mapping | Account mappings | Auth |
| PATCH | /api/qb/account-mapping | Save account mappings | Auth |
Webhooks
/api/webhooks
| GET | /api/webhooks | List webhook configs | Auth |
| POST | /api/webhooks | Create webhook | Auth |
| PATCH | /api/webhooks/:id | Update webhook | Auth |
| DELETE | /api/webhooks/:id | Delete webhook | Auth |
| GET | /api/webhooks/:id/deliveries | Delivery log | Auth |
| POST | /api/webhooks/:id/test | Send test payload | Auth |