Complete guide to integrating with the AURRA Smart Thermostat API — authentication, telemetry endpoints, predictive maintenance, webhooks, and ready-to-run code samples.
The AURRA REST API provides full programmatic access to thermostat control, predictive HVAC diagnostics, energy ecosystem management, and real-time event webhooks. All endpoints use OAuth 2.0 Bearer token authentication and return JSON.
Base URL
Endpoint Root
https://api.aurrahome.com/v1
API Surface
Thermostat Control
Read status, set temperature, create schedules, toggle Eco Mode.
Link Alexa, Google Assistant, and HomeKit accounts programmatically.
Required OAuth Scopes
Scope
Access Level
Typical Use
diagnostics:read
Read
Fetch HVAC telemetry and maintenance predictions
alerts:write
Write
Create and dispatch maintenance alerts
energy:read
Read
Access solar, grid pricing, and EV data
comfort:write
Write
Adjust temperature setpoints and schedules
Note
Scope strings must be passed during OAuth token generation. Request only the scopes your integration requires — the principle of least privilege applies.
Section 02
Authentication
AURRA uses the OAuth 2.0 client credentials flow. All API calls require a Bearer token in the Authorization header. Tokens expire after 3,600 seconds and must be refreshed before expiry.
POST/auth/tokenGenerate an OAuth 2.0 access token
Request Body
Parameter
Type
Req.
Description
client_id
string
Required
Application client ID from the AURRA Developer Portal
client_secret
string
Required
Application client secret — never expose client-side
grant_type
string
Required
Must be the literal value client_credentials
HTTP Request
POST https://api.aurrahome.com/v1/auth/token
Content-Type: application/json{"client_id": "acc_a1b2c3d4",
"client_secret": "sk_live_••••••••••••",
"grant_type": "client_credentials"}
Never expose your client_secret in client-side code or public repositories. Store credentials in environment variables or a secrets management service. Rotate compromised secrets immediately via the developer portal.
Section 03
Integration Workflow
A typical AURRA integration follows a five-step lifecycle from authentication to real-time monitoring. Each step maps to one or more API calls.
1
Authenticate
POST /auth/token → store the Bearer token with its expiry timestamp.
Tokens expire after 3,600 seconds. Implement auto-refresh before expiry to avoid 401 errors mid-session.
2
Fetch Device Status
GET /thermostat/{device_id}/status → read current temperature, humidity, and mode.
Poll no more frequently than every 30 seconds to stay within rate limits.
3
Configure Comfort
POST /thermostat/{device_id}/setpoint + /schedule → set target temperatures and time blocks.
Call /schedule/sync after bulk schedule updates to ensure device parity.
4
Submit Diagnostics
POST /diagnostics/vibration + /diagnostics/energy → stream telemetry for ML analysis.
Recommended cadence: vibration every 60 seconds, energy every 5 minutes.
5
Monitor Alerts
GET /predictive/hvac/{device_id}/status → check maintenance predictions and recommended actions.
Use webhooks (POST /alerts) for push-based alert delivery at scale — no polling required.
Section 04
Predictive Maintenance API
AURRA's predictive maintenance endpoints are the platform's core differentiator. Submit sensor telemetry and receive ML-powered failure predictions with confidence scores and recommended actions — weeks before a breakdown occurs.
POST/alertsCreate and dispatch a maintenance alert
Parameter
Type
Req.
Description
device_id
string
Required
Target device identifier
issue
string
Required
Human-readable issue description (max 256 chars)
confidence
float
Required
ML confidence score (0.0–1.0). Platform default alert threshold: 0.72
action
string
Required
Recommended remediation step for the homeowner
dispatch
boolean
Optional
If true, triggers automated technician dispatch (Enterprise tier only)
Tip
The confidence threshold of 0.72 is the platform default for alert dispatch. Enterprise integrations may configure custom thresholds via the developer portal.
Section 05
Comfort & Energy APIs
GET/thermostat/{device_id}/statusRead current temperature, humidity, mode, Eco status
POST/thermostat/{device_id}/ecoEnable or disable Eco Mode
POST/climate/optimizeTrigger AI comfort optimization
Section 06
Webhooks & Event Streaming
Register a webhook endpoint to receive real-time push events from AURRA — no polling required. Events are delivered as HTTP POST requests with a JSON payload signed with your webhook secret.
Always verify the X-AURRA-Signature header before processing webhook payloads. Reject any request where signature verification fails with a 401 response.
Section 07
SDK & Code Samples
AURRA provides official SDKs for Python and JavaScript, available via PyPI and npm respectively.
import requests
BASE ="https://api.aurrahome.com/v1"# 1. Authenticate
token_resp = requests.post(f"{BASE}/auth/token", json={
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"grant_type": "client_credentials"
})
TOKEN = token_resp.json()["access_token"]
HEADERS = {"Authorization": f"Bearer {TOKEN}"}
# 2. Get current thermostat status
status = requests.get(f"{BASE}/thermostat/aurra_001/status", headers=HEADERS).json()
print(f"Current: {status['temperature']}°F Mode: {status['mode']}")
# 3. Set temperature
requests.post(f"{BASE}/thermostat/aurra_001/setpoint",
json={"temperature": 72, "mode": "cool"}, headers=HEADERS)
# 4. Check predictive maintenance status
pred = requests.get(f"{BASE}/predictive/hvac/aurra_001/status", headers=HEADERS).json()
if pred["maintenance_needed"]:
print(f"ALERT: {pred['prediction']['issue']}")
print(f"Confidence: {pred['prediction']['confidence']:.0%}")
print(f"Action: {pred['prediction']['recommended_action']}")
JavaScript — Status & Setpoint
JavaScript
const BASE ="https://api.aurrahome.com/v1";
// Fetch current thermostat statusconst status =await fetch(`${BASE}/thermostat/aurra_001/status`, {
headers: { Authorization: `Bearer ${ACCESS_TOKEN}` }
}).then(r => r.json());
console.log(`${status.temperature}°F | ${status.mode} | eco: ${status.eco_mode}`);
// Set temperature to 70°F, heating modeawait fetch(`${BASE}/thermostat/aurra_001/setpoint`, {
method: "POST",
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ temperature: 70, mode: "heat" })
});
Section 08
Rate Limits & Error Handling
Rate Limits
Tier
Limit
Scope
Response Header
Enterprise
500 req/min
Per access token
X-RateLimit-Tier: enterprise
Standard
100 req/min
Per access token
X-RateLimit-Tier: standard
Diagnostics
60 req/min
POST /diagnostics/*
X-RateLimit-Endpoint: diag
HTTP Status Codes
Status
Meaning
Common Cause & Resolution
200
OK
Request successful
201
Created
Resource created (POST alert, schedule)
400
Bad Request
Missing required field or invalid value — check request body against schema
401
Unauthorized
Missing, expired, or malformed Bearer token — request a new token
403
Forbidden
Token lacks required scope — re-authenticate with correct scopes
404
Not Found
device_id does not exist in your account — verify device ID
429
Too Many Requests
Rate limit exceeded — back off and retry with exponential delay
500
Internal Server Error
Unexpected platform error — retry with exponential backoff; contact support
Error Response Shape
JSON Error Envelope
{"error": {"code": "UNAUTHORIZED",
"message": "Bearer token has expired. Request a new token.",
"docs": "https://docs.aurrahome.com/errors/UNAUTHORIZED"}}