API Reference
Complete API documentation for the Simtricity platform.
Overview
The Simtricity API is built on PostgREST, providing a RESTful interface to the PostgreSQL database. All API endpoints automatically support:
- CRUD Operations - Create, Read, Update, Delete
- Filtering - Advanced query capabilities
- Pagination - Limit and offset support
- Sorting - Order by any column
- Embedding - Join related resources
Base URL
https://api.simtricity.com/rest/v1
Authentication
All API requests require authentication via JWT tokens:
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'apikey': 'YOUR_API_KEY'
}
Core Endpoints
Customer Management
GET /customers- List customersPOST /customers- Create customerPATCH /customers?id=eq.{id}- Update customerDELETE /customers?id=eq.{id}- Delete customer
Account Management
GET /accounts- List accountsGET /customer_accounts- Customer-account relationships
Meter Operations
GET /meters- List metersGET /meter_readings- Get meter readingsPOST /meter_readings- Submit readings
Billing & Payments
GET /payments- List paymentsPOST /payments- Record paymentGET /monthly_costs- Monthly cost calculations
RPC Functions
Special operations are available as RPC functions:
POST /rpc/meters_missing_future_tariffs
{
"esco_code_in": "wlce"
}
Available RPC functions:
meters_missing_future_tariffs- Find meters needing tariff updatesgenerate_new_quarter_tariffs- Generate quarterly tariffsmonthly_costs_compute- Calculate monthly costs
Query Examples
Filter by field
GET /customers?status=eq.active
Select specific columns
GET /customers?select=id,email,name
Join related data
GET /properties?select=*,meters(*)
Pagination
GET /customers?limit=10&offset=20
Error Handling
API errors follow standard HTTP status codes:
200- Success201- Created400- Bad Request401- Unauthorized404- Not Found500- Server Error
Next Steps
- Flows API Documentation
- Authentication Guide - Documentation coming soon
- Code Examples - Documentation coming soon