REST API & AI Agent / MCP Reference
Connect factory MES lines, ERP workflows, live BMS fleet telemetry, and AI compliance agents directly to BatteryPass Studio. Public deterministic validation and scope-check endpoints are free with zero authentication; tenant write and export endpoints use SHA-256 hashed Bearer API keys on Pro (€149/mo) and Manufacturer (€349/mo) plans.
1. Free Public Endpoints (Zero Authentication)
Deterministic EU 2023/1542 checks backed by embedded official DIN DKE SPEC 99100 and Eclipse Catena-X 6.1.0 schemas — ideal for CI/CD pipelines and AI agents.
| Method & Path | Purpose | Auth |
|---|---|---|
POST /api/public/scope-check |
Exact Art. 77(1) scope verdict (>2.00 kWh industrial, EV/LMT, Art. 8 & Art. 47 dates) | None (Free) |
POST /api/public/validate |
DIN DKE SPEC 99100 JSON-LD, submodels (UTF-8/UTF-16 BOM) & Catena-X 6.1.0 validation | None (Free) |
POST /api/public/carbon-calc |
Art. 7 lifecycle carbon footprint calculator & Art. 8 recycled-content thresholds (2031/2036) | None (Free) |
GET /api/resolve/01/:gtin/21/:serial |
GS1 Digital Link passport JSON projected strictly by 3-tier Annex XIII RBAC | Tier 1 public · optional X-BatteryPass-Token |
curl -sS -X POST "https://batteryid.app/api/public/scope-check" \
-H "Content-Type: application/json" \
-d '{"category":"industrial","ratedEnergyKwh":5.12,"placedOnEuMarket":true}'
2. Tenant REST API (Pro & Manufacturer · Bearer Key)
Send your Workbench-minted key in Authorization: Bearer bp_live_... (or bp_preview_...). No browser session cookies or CSRF headers required; every request is tenant-isolated, rate-limited (120 req/min), and recorded under pseudonymous actor api_key:<keyId> in the SHA-256 revision chain.
| Endpoint | Capability |
|---|---|
GET / POST /api/models | List battery models or create a new 7-domain DIN 99100 model draft |
GET / PUT / DELETE /api/models/:id | Inspect completeness (missingFields), update fields, or delete unissued draft |
POST /api/models/:id/passports | Issue serialized GS1 passports from factory MES (up to 250 serials per request) |
POST /api/passports/:id/snapshots | Append live BMS SOH %, full cycles, and remaining energy as an immutable SHA-256 revision |
GET /api/passports/:id/qr.svg | Vector GS1 QR SVG (ISO/IEC 18004, optional DIN nameplate ?nameplate=1) |
POST /api/passports/qr-batch.pdf | Streaming A4 grid or 50×30mm industrial roll QR PDF print sheets |
GET /api/passports/:id/export/din99100 | Complete DIN DKE SPEC 99100 JSON-LD export (plus /export/catena-x) |
POST /api/import/csv | Bulk CSV dry-run (commit: false) or live commit from ERP/Excel |
curl -sS -X POST "https://batteryid.app/api/models/<MODEL_ID>/passports" \
-H "Authorization: Bearer bp_preview_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"prefix": "VW5120-2026-",
"count": 25,
"start": 1001,
"batchLot": "LOT-MUC-26W49"
}'
curl -sS -X POST "https://batteryid.app/api/passports/<PASSPORT_ID>/snapshots" \
-H "Authorization: Bearer bp_preview_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"reason": "BMS field SOH telemetry sync after 450 cycles",
"stateOfCertifiedEnergyPct": 97.2,
"numberOfFullCycles": 450,
"remainingEnergyKwh": 4.98
}'
3. AI Agents & Thin MCP Server (@batterypass-studio/mcp)
Our zero-LLM-cost stdio MCP server (packages/mcp) exposes 8 deterministic tools to Claude, Codex, Antigravity, and custom agents: 4 free zero-auth tools (check_battery_scope, validate_din99100, calculate_carbon_footprint, resolve_battery_passport) and 4 API-key tools (draft_battery_model, get_model_completeness, issue_battery_passports, append_bms_snapshot).
{
"mcpServers": {
"batterypass-studio": {
"command": "npx",
"args": ["-y", "@batterypass-studio/mcp"],
"env": {
"BATTERYPASS_API_BASE": "https://batteryid.app",
"BATTERYPASS_API_KEY": "bp_preview_optional_for_write_tools"
}
}
}
}