GridMango API v1
Programmatic access to customer-facing demand response analysis and telemetry processing workflows.
Base URL: https://gridmango.com/.netlify/functions/api-v1
How Authentication Works
- Create an account or sign in to GridMango.
- Open Profile and go to API Access.
- Copy the current bearer token from the profile page.
- Send that token in every API request:
Authorization: Bearer <token>
The bearer token is your current signed-in session token. It is not a long-lived API key. Refresh it from Profile when needed.
Entitlements and Feature Gating
| Endpoint | Starter | Professional | Platform |
|---|---|---|---|
POST /baseline/generate |
✓ | ✓ | ✓ |
POST /load-shape/generate |
✓ | ✓ | ✓ |
POST /timezone/convert |
✓ | ✓ | ✓ |
POST /patching/run |
✓ | ✓ | ✓ |
POST /event-replay/run |
✕ | ✓ | ✓ |
POST /telemetry-simulator/generate |
✕ | ✕ | ✓ |
API access follows your active GridMango subscription. Requests to tools outside your plan will be rejected.
Discovery and Session Endpoints
GET /healthreturns API health.GET /toolsreturns the public customer-facing endpoint manifest.GET /auth/mereturns the authenticated user, current plan tier, subscription status, and entitled tool keys.
Code Examples
curl -X POST "https://gridmango.com/.netlify/functions/api-v1/baseline/generate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-session-token>" \
-d '{
"rows": [
{ "Time": "2026-03-10T17:15:00.000Z", "kW": 2.11 },
{ "Time": "2026-03-10T17:30:00.000Z", "kW": 2.03 }
],
"eventDate": "2026-03-18",
"eventStartTime": "17:00",
"eventDuration": 60,
"method": "xofy",
"x": 5,
"y": 10,
"similarDayRule": "match_event_day",
"excludeHolidays": false
}'
import requests
BASE_URL = "https://gridmango.com/.netlify/functions/api-v1"
TOKEN = "your-session-token"
payload = {
"rows": [
{"Time": "2026-03-10T17:15:00.000Z", "kW": 2.11},
{"Time": "2026-03-10T17:30:00.000Z", "kW": 2.03},
],
"eventDate": "2026-03-18",
"eventStartTime": "17:00",
"eventDuration": 60,
"method": "xofy",
"x": 5,
"y": 10,
}
response = requests.post(
f"{BASE_URL}/baseline/generate",
headers={
"Authorization": f"Bearer {TOKEN}",
"Content-Type": "application/json",
},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json())
const baseUrl = 'https://gridmango.com/.netlify/functions/api-v1';
const token = 'your-session-token';
const payload = {
rows: [
{ Time: '2026-03-10T17:15:00.000Z', kW: 2.11 },
{ Time: '2026-03-10T17:30:00.000Z', kW: 2.03 }
],
eventDate: '2026-03-18',
eventStartTime: '17:00',
eventDuration: 60,
method: 'xofy',
x: 5,
y: 10
};
const response = await fetch(`${baseUrl}/baseline/generate`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`
},
body: JSON.stringify(payload)
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
console.log(await response.json());
Example Workflow
- Call
GET /auth/meto confirm the current session and available access. - Call
GET /toolsto view the available endpoint catalog. - Submit a tool request with the bearer token.
- Store the support reference code returned with any failed request so it can be shared with GridMango support.
Endpoint Reference
GET /auth/me
Returns the current user, plan tier, subscription status, and entitled tools.
{
"ok": true,
"data": {
"userId": "...",
"email": "[email protected]",
"isAdmin": false,
"tokenType": "supabase_session_bearer",
"planTier": "professional",
"subscriptionStatus": "active",
"entitledTools": ["baseline", "loadshape", "timezone", "patching", "eventreplay"]
}
}
POST /baseline/generate
Generate a demand response baseline and optional event-performance output from interval telemetry.
POST /load-shape/generate
Create synthetic site- or meter-level interval load data for baseline, replay, and analytics testing.
POST /timezone/convert
Convert interval telemetry between named time zones while preserving interval alignment.
POST /patching/run
Patch missing telemetry intervals using interpolation and fallback extrapolation rules.
POST /event-replay/run
Compare two event replay scenarios side-by-side using the same telemetry dataset.
POST /telemetry-simulator/generate
Generate synthetic DER telemetry and an optional weather companion dataset for testing and integration workflows.
Error Handling
When a request fails, GridMango returns a user-safe error and a support reference code. Share that code with support for investigation.
{
"ok": false,
"error": "Unable to process request.",
"code": "GM-API-AB12CD34"
}