API Reference
For developers integrating with GEM or extending it. GEM exposes several distinct surfaces; this section documents each.
REST API
GEM exposes a REST API for configuration reads/writes and for issuing commands. It's mounted under /api and is enabled by rest_api: true in gem.json.
WebSocket API
The WebSocket connection (Socket.io) is GEM's primary real-time channel — state, subscriptions, commands, and most interactive operations flow over it. The browser/mobile clients talk to it through the GemApp class; server handlers live in gem_client.js.
Web Services
Web Services let you expose custom HTTP endpoints backed by a script you write in the admin interface — for webhooks, third-party integrations, and bespoke APIs that don't fit the standard REST surface. Each service is served under /web_service/.
Macro Scripts
The Run Script macro step executes arbitrary JavaScript in a sandboxed VM context. Use it for logic that doesn't fit the other step types — computing a value, iterating dynamic collections, conditional branching beyond the built-in condition steps.
Driver Development
A driver teaches GEM to talk to one type of equipment. GEM ships 100+ drivers; this page is the contract for writing another.