NEWGridLyt v2.0: AI fault explanation now available on all plans. See what's new
API REFERENCE

GridLyt API documentation

Versioned JSON API for assets, anomalies, and revenue metrics. Subscribe to real-time events via signed webhooks.

https://api.gridlyt.io/v1
curl https://api.gridlyt.io/v1/assets \
  -H "Authorization: Bearer gl_live_xxxxxxxxxxxx"
  • REST API
  • Webhooks
  • SDKs
  • OpenAPI
  • OAuth

Overview

The GridLyt API gives you programmatic access to every asset, anomaly, and revenue metric in your fleet. All requests are authenticated with a Bearer token and return JSON. The API is versioned — breaking changes will always ship under a new version prefix.

Base URL

https://api.gridlyt.io/v1

Format

application/json

Auth

Bearer token
bash
curl https://api.gridlyt.io/v1/assets \
  -H "Authorization: Bearer gl_live_xxxxxxxxxxxx"

Authentication

All API requests require a Bearer token in the Authorization header. Generate tokens in your GridLyt dashboard under Settings → API Keys. Tokens are scoped per integration and can be revoked at any time.

Tokens are prefixed gl_live_ (production) or gl_test_ (sandbox)
Each token can be scoped to read-only or read-write access
Never expose tokens in client-side code or public repositories
http
Authorization: Bearer gl_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Assets

Retrieve fleet asset data including State of Health, State of Charge, operating status, and revenue at risk.

Anomalies

Access active and historical anomalies with AI-generated explanations and revenue impact calculations.

Webhooks

Subscribe to real-time events. GridLyt sends a signed HTTP POST to your endpoint within milliseconds of an event. Payloads are signed with HMAC-SHA256 — verify the X-GridLyt-Signature header before processing.

Event types

anomaly.detectedA new anomaly has been detected on an asset
anomaly.resolvedAn anomaly has been marked as resolved
asset.status_changeAn asset status changed (e.g. healthy → warning)
asset.soh_thresholdAsset SoH dropped below a configured threshold

Payload example

json
// POST https://your-system.com/hooks/gridlyt
// Headers:
//   X-GridLyt-Signature: sha256=<hmac>
//   X-GridLyt-Event: anomaly.detected

{
  "event": "anomaly.detected",
  "id": "anm-0x4A2F",
  "asset_id": "bess-04",
  "fault_code": "ERR_CELL_IMBALANCE_0x4A2F",
  "severity": "medium",
  "ai_explanation": "Cell group 3 showing 18mV imbalance...",
  "revenue_impact_daily": 2340,
  "timestamp": "2026-06-06T14:32:07Z"
}

Signature verification

typescript
import crypto from 'crypto';

function verifyWebhook(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from('sha256=' + expected),
    Buffer.from(signature)
  );
}

// In your Express handler:
app.post('/hooks/gridlyt', (req, res) => {
  const sig = req.headers['x-gridlyt-signature'];
  const valid = verifyWebhook(JSON.stringify(req.body), sig, process.env.WEBHOOK_SECRET);
  if (!valid) return res.status(401).send('Invalid signature');
  res.sendStatus(200);
});

Errors & rate limits

Error format

All errors return a consistent JSON body with a machine-readablecode and a human-readable message.

json
{
  "error": {
    "code": "asset_not_found",
    "message": "No asset with id 'bess-99' exists in your fleet.",
    "status": 404
  }
}

HTTP status codes

200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid Bearer token
404Not FoundResource does not exist
409ConflictState conflict (e.g. resolving an already-resolved anomaly)
429Too Many RequestsRate limit exceeded — see headers for reset time
500Server ErrorUnexpected error — contact support if persistent

Rate limits

Rate limits are applied per API token. Limits are returned in response headers on every request.

X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds to wait before retrying (only on 429)

SDKs & libraries

Official SDKs are in active development. In the meantime, the API is straightforward to call directly from any HTTP client.

Node.js / TypeScript

Coming soon

Python

Coming soon

OpenAPI spec

Available

Postman collection

Available
bash
# Download the OpenAPI spec
curl https://api.gridlyt.io/v1/openapi.json -o gridlyt-openapi.json

# Generate a client with openapi-generator
npx @openapitools/openapi-generator-cli generate \
  -i gridlyt-openapi.json \
  -g typescript-fetch \
  -o ./gridlyt-client

Ready to integrate?

Request API access and we will provision your token and walk through integration with your stack.

Request API access