API Reference
Documentation.
The Reliatic API provides programmatic access to all platform features including asset management, risk calculations, inspection workflows, and governance operations. Build integrations with CMMS, ERP, or custom applications.
01. Authentication
Reliatic API uses Supabase Authentication with JWT tokens. All API requests must include a valid access token in the Authorization header.
POST https://api.reliatic.com/auth/login
Content-Type: application/json
{
"email": "user@company.com",
"password": "your-secure-password"
}
// Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "v1.MR5twvbfNy...",
"expires_in": 3600,
"user": {
"id": "uuid-here",
"email": "user@company.com",
"tenant_id": "tenant-uuid"
}
}GET https://api.reliatic.com/api/assets Authorization: Bearer eyJhbGciOiJIUzI1NiIs... Content-Type: application/json
Username/Password
Standard email and password authentication. Returns JWT access token valid for 1 hour.
Refresh Token
Exchange refresh token for new access token without re-authenticating.
API Key (Service Accounts)
Long-lived API keys for server-to-server integrations. Contact support to provision.
02. Rate Limiting
API requests are rate-limited to ensure platform stability and fair usage across all tenants. Limits are enforced per tenant per endpoint.
Standard
Default limit for all authenticated users
Premium
Available for enterprise plans
Bulk Operations
Special limit for bulk import/export endpoints
HTTP/1.1 200 OK
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1640995200
// If rate limit exceeded:
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1640995200
Retry-After: 45
{
"error": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Try again in 45 seconds."
}03. Assets API
/api/assetsRetrieve all assets for the authenticated tenant. Supports filtering, sorting, and pagination.
- page: number (default: 1)
- limit: number (default: 50, max: 100)
- criticality: string (filter by criticality)
- type: string (filter by equipment type)
- search: string (search by tag or name)
GET /api/assets?criticality=high&limit=20
// Response
{
"data": [
{
"id": "uuid-123",
"tag": "V-102",
"name": "Crude Stabilizer",
"type": "pressure_vessel",
"criticality": "high",
"design_pressure_psi": 350,
"design_temp_f": 450,
"material": "SA-516-70",
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 143
}
}/api/assetsCreate a new asset. Requires authentication and tenant_id is automatically assigned.
- tag: string (required, unique)
- name: string (required)
- type: string (required)
- criticality: string (optional)
- design_pressure_psi: number (optional)
- design_temp_f: number (optional)
- material: string (optional)
POST /api/assets
Content-Type: application/json
{
"tag": "V-201",
"name": "Secondary Separator",
"type": "pressure_vessel",
"criticality": "medium",
"design_pressure_psi": 250,
"design_temp_f": 350,
"material": "SA-516-70"
}
// Response
{
"id": "uuid-456",
"tag": "V-201",
"name": "Secondary Separator",
"created_at": "2024-01-15T11:45:00Z"
}/api/assets/:idUpdate an existing asset. Partial updates supported (send only fields to change).
- id: string (path parameter, asset UUID)
PUT /api/assets/uuid-456
Content-Type: application/json
{
"criticality": "high",
"design_pressure_psi": 300
}
// Response
{
"id": "uuid-456",
"tag": "V-201",
"criticality": "high",
"design_pressure_psi": 300,
"updated_at": "2024-01-15T12:00:00Z"
}/api/assets/:idSoft-delete an asset (sets deleted_at timestamp). Asset remains in database for audit trail.
- id: string (path parameter, asset UUID)
DELETE /api/assets/uuid-456
// Response
{
"success": true,
"message": "Asset deleted successfully",
"deleted_at": "2024-01-15T12:30:00Z"
}04. Risks API
/api/risksRetrieve all risk assessments (RBI results) for tenant assets.
- asset_id: string (filter by specific asset)
- min_risk: number (filter by minimum risk score)
- max_risk: number (filter by maximum risk score)
GET /api/risks?min_risk=75
// Response
{
"data": [
{
"id": "risk-uuid-1",
"asset_id": "uuid-123",
"pof": 4.2,
"cof": 85.3,
"risk_score": 358.26,
"risk_category": "high",
"calculated_at": "2024-01-15T09:00:00Z"
}
]
}/api/risks/calculateTrigger risk calculation for specific assets or all assets in tenant.
- asset_ids: array (optional, calculate for specific assets)
- methodology: string (optional, 'api_581' or 'iso_31000')
POST /api/risks/calculate
Content-Type: application/json
{
"asset_ids": ["uuid-123", "uuid-456"],
"methodology": "api_581"
}
// Response
{
"job_id": "calc-job-789",
"status": "processing",
"assets_queued": 2,
"estimated_time_seconds": 120
}05. Workflows API
/api/workflowsRetrieve workflow instances (actions, inspections, decisions).
- type: string (filter: 'action', 'inspection', 'fmea')
- status: string (filter by workflow status)
- owner_id: string (filter by assigned owner)
GET /api/workflows?type=action&status=in_progress
// Response
{
"data": [
{
"id": "workflow-uuid-1",
"type": "action",
"status": "in_progress",
"title": "Replace corroded piping section",
"owner_id": "user-uuid-1",
"created_at": "2024-01-10T08:00:00Z",
"due_date": "2024-02-15T17:00:00Z"
}
]
}/api/workflows/:id/transitionTrigger a state transition for a workflow (requires valid state machine transition).
- id: string (workflow UUID)
- target_state: string (required)
- justification: string (required)
POST /api/workflows/workflow-uuid-1/transition
Content-Type: application/json
{
"target_state": "completed",
"justification": "All corroded sections replaced and pressure tested"
}
// Response
{
"id": "workflow-uuid-1",
"previous_state": "in_progress",
"current_state": "completed",
"transitioned_at": "2024-01-15T14:00:00Z"
}06. Error Codes
UNAUTHORIZED
Missing or invalid authentication token. Check Authorization header.
FORBIDDEN
Authenticated but not authorized. User lacks required permissions for this operation.
NOT_FOUND
Requested resource does not exist or has been deleted.
VALIDATION_ERROR
Request payload failed validation. Check error details for specific field errors.
RATE_LIMIT_EXCEEDED
Too many requests. Wait for rate limit reset (see Retry-After header).
INTERNAL_SERVER_ERROR
Unexpected server error. Contact support if error persists.
SERVICE_UNAVAILABLE
Service temporarily unavailable. Retry with exponential backoff.
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
{
"error": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "tag",
"message": "Tag already exists",
"code": "DUPLICATE_TAG"
},
{
"field": "design_pressure_psi",
"message": "Must be greater than 0",
"code": "INVALID_VALUE"
}
]
}