Back to the home page · Thai version
API and webhooks for developers
Overview
A per-account (tenant) API to list stations and charging sessions, receive signed webhooks, and try starting and stopping a session on a simulated (sandbox) charger.
| Item | Status |
|---|---|
| List stations and sessions with an API key | Built (test mode) |
| Webhooks signed with HMAC-SHA256, with automatic retries | Built (test mode) |
| Sandbox chargers to try starting and stopping a session | Built (test mode) |
| The API and API keys on the live system | Coming soon |
| Commanding real chargers through the API (start, stop, unlock, reset) | Coming soon |
| Webhooks from real chargers | Coming soon |
| Webhooks to your public URL (test mode delivers only to a receiver on the same machine) | Coming soon |
Authentication
- Send the key in the header
Authorization: Bearer YOUR_API_KEY - Key format:
evk_, then 12 characters a-z0-9, an underscore, then 43 base64url characters - The account owner creates keys on the API keys page of the app. A key is shown once. The system keeps only its prefix and a hash, never the key itself
- If the person who created a key is no longer an owner of the account, the key stops working at once (
401 creator_not_owner) - Key scopes:
stations:read,sessions:read,webhooks:manage,sandbox:manage
Errors come back as {"error":{"code":"…","message":"…"}}
| HTTP status | Meaning |
|---|---|
401 | No key, a wrong key, or a revoked key |
403 insufficient_scope | The key lacks the scope this path needs |
404 | Not found, or it belongs to another account |
429 too_many_bad_keys | Too many wrong keys; see the Retry-After header for how long to wait |
Endpoints
Every path starts with /api/v1
| Method and path | Scope | What it does |
|---|---|---|
GET /api/v1/stations | stations:read | The account's stations |
GET /api/v1/stations/{id} | stations:read | One station |
GET /api/v1/sessions | sessions:read | Charging sessions |
GET /api/v1/webhooks/endpoints | webhooks:manage | Webhook endpoints |
POST /api/v1/webhooks/endpoints | webhooks:manage | Add an endpoint (the secret is shown once) |
POST /api/v1/webhooks/endpoints/{id}/disable · /enable · /revoke | webhooks:manage | Disable, enable or permanently revoke an endpoint |
POST /api/v1/webhooks/endpoints/{id}/test | webhooks:manage | Send a test event |
GET /api/v1/webhooks/deliveries | webhooks:manage | Webhook delivery history |
POST /api/v1/webhooks/deliveries/{id}/redeliver | webhooks:manage | Re-deliver by hand (same event id) |
GET /api/v1/sandbox/chargers · POST /api/v1/sandbox/chargers | sandbox:manage | List and create sandbox chargers |
GET /api/v1/sandbox/chargers/{id} · POST …/{id}/delete | sandbox:manage | Read or delete a sandbox charger |
POST /api/v1/sandbox/chargers/{id}/sessions/start · /stop | sandbox:manage | Start or stop a session on a sandbox charger |
Session fields: id, charger_id, connector, sandbox, status, transaction_id, started_at, stopped_at, wh (energy in watt-hours) · Station fields: id, name, sandbox, status
Example: try it with a sandbox charger
Every value in the example is a placeholder. API_BASE_URL is the API address, which is not open on the live system yet (coming soon).
export EVEASY_API_KEY='YOUR_API_KEY'
export BASE='https://API_BASE_URL'
# 1) Create a sandbox charger (name: 1-60 characters)
curl -s -X POST "$BASE/api/v1/sandbox/chargers" \
-H "Authorization: Bearer $EVEASY_API_KEY" -H 'Content-Type: application/json' \
-d '{"name":"demo charger"}'
# -> 201 {"data":{"id":"SBX-ABCDE12345",...}}
# and a sandbox.charger.created webhook
# 2) Start a session (sandbox chargers have one connector: connector = 1)
curl -s -X POST "$BASE/api/v1/sandbox/chargers/SBX-ABCDE12345/sessions/start" \
-H "Authorization: Bearer $EVEASY_API_KEY" -H 'Content-Type: application/json' \
-d '{"connector":1}'
# -> 201 {"data":{"id":"sbx-13","status":"active",...}}
# and a session.started webhook
# 3) Stop the session, then list sessions
curl -s -X POST "$BASE/api/v1/sandbox/chargers/SBX-ABCDE12345/sessions/stop" \
-H "Authorization: Bearer $EVEASY_API_KEY" -H 'Content-Type: application/json' \
-d '{"connector":1}'
curl -s "$BASE/api/v1/sessions" -H "Authorization: Bearer $EVEASY_API_KEY"
Webhooks
| Event | Sent when |
|---|---|
session.started | A session starts on a sandbox charger |
session.stopped | A session stops on a sandbox charger |
sandbox.charger.created | A sandbox charger is created |
sandbox.charger.deleted | A sandbox charger is deleted |
webhook.test | You send a test event |
Today every event comes from a sandbox charger or a test ("sandbox": true). Real chargers do not send webhooks yet. Coming soon
POST /hook
Content-Type: application/json
EVeasy-Event-Id: evt_EXAMPLE0000000000000000
EVeasy-Event-Type: session.started
EVeasy-Delivery-Attempt: 1
EVeasy-Signature: t=1763258400,v1=<64 hex>
{"id":"evt_EXAMPLE0000000000000000","type":"session.started","created":1763258400,"sandbox":true,"data":{...}}
Verify the signature
- Use the raw body exactly as received, before parsing JSON
v1= hex ofHMAC-SHA256(secret, "<t>." + body)- Reject if
tis more than 300 seconds from now - Compare in constant time
- Dedupe on the event id (re-deliveries keep the same id)
Node 18 or later, node:crypto only
import crypto from 'node:crypto';
export function verifyEvEasySignature(rawBody, header, secret, toleranceS = 300, now = Math.floor(Date.now() / 1000)) {
if (typeof header !== 'string') return false;
let t = null; const v1 = [];
for (const part of header.split(',')) {
const i = part.indexOf('=');
if (i < 1) return false;
const k = part.slice(0, i).trim(), v = part.slice(i + 1).trim();
if (k === 't' && /^[0-9]{1,12}$/.test(v)) t = Number(v);
else if (k === 'v1' && /^[0-9a-f]{64}$/.test(v)) v1.push(v);
}
if (t === null || v1.length === 0) return false;
if (Math.abs(now - t) > toleranceS) return false;
const want = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest();
let ok = false;
for (const sig of v1) {
if (crypto.timingSafeEqual(Buffer.from(sig, 'hex'), want)) ok = true;
}
return ok;
}
Python 3.8 or later, standard library only
import hashlib, hmac, re, time
def verify_eveasy_signature(raw_body: bytes, header: str, secret: str, tolerance_s: int = 300, now: int = None) -> bool:
if not isinstance(header, str):
return False
now = int(time.time()) if now is None else now
t, v1 = None, []
for part in header.split(","):
k, sep, v = part.partition("=")
if not sep or not k.strip():
return False
k, v = k.strip(), v.strip()
if k == "t" and re.fullmatch(r"[0-9]{1,12}", v):
t = int(v)
elif k == "v1" and re.fullmatch(r"[0-9a-f]{64}", v):
v1.append(v)
if t is None or not v1:
return False
if abs(now - t) > tolerance_s:
return False
want = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
ok = False
for sig in v1:
if hmac.compare_digest(sig, want):
ok = True
return ok
Keep the webhook secret (it starts with whsec_) in an environment variable such as EVEASY_WEBHOOK_SECRET, not in your code.
Retries
- A delivery succeeds when you answer 2xx within 5 seconds
- Otherwise the system retries with exponential backoff and jitter, from 2 seconds up to 1 hour
- At most 6 attempts, then the delivery is
dead. Re-deliver by hand withPOST /api/v1/webhooks/deliveries/{id}/redeliver
Limits
- Wrong keys: 10 per 300 seconds per IP, then
429 too_many_bad_keys - Sandbox chargers: at most 5 per account (
409 sandbox_limit), and one session at a time per connector (409 session_active) - There is no request quota for valid keys yet, and no API plans yet. Coming soon
Glossary
| Term | Meaning |
|---|---|
| OCPP | The protocol a charger uses to talk to the back office |
| Connector | The plug that goes into the car |
| Session | One charging session |
| Wh | Watt-hour. The API returns energy in the wh field |
| Tenant (account) | One station owner's data space |
| Sandbox | Simulated chargers for testing |
| Webhook | EV Easy sends events to your URL |