-
Notifications
You must be signed in to change notification settings - Fork 3
RaftCoreAPI
Rob Dobson edited this page May 19, 2026
·
20 revisions
This page lists the REST API endpoints exposed by the core Raft framework (SysManager, NetworkManager, DeviceManager, etc.). For the endpoints exposed by the standard SysMods see SysMod REST Endpoints. The full alphabetical list is at Raft Full API List.
To register your own endpoints from a SysMod, see Adding REST API Endpoints.
| URL | Verb | Description | e.g. req | e.g. resp |
|---|---|---|---|---|
blerestart |
GET | Restart BLE sub-system. This will take a few seconds to restart. | blerestart |
{"req":"blerestart","rslt":"ok"} |
clearsettings |
GET | Clear nv (non-volatile) settings, see getsettings for more information. |
clearsettings |
|
datetime |
GET | Get or set the system UTC time. Useful when NTP is unavailable (e.g. BLE-only connection). Time can be set using ISO 8601 format or Unix epoch seconds. The RaftJS library sends this automatically on connect. |
datetimeor datetime?UTC=2026-04-04T15:30:12Zor datetime?epoch=1775404212
|
{"req":"datetime","rslt":"ok","UTC":"2026-04-04T15:30:12Z","epoch":1775404212} |
devman/busname |
GET | Get the bus name from a bus number. Bus numbers start from 1 and match the numbering used in device data JSON/binary messages. Only buses with valid device interfaces are numbered. | devman/busname?busnum=1 |
{"req":"devman/busname?busnum=1","rslt":"ok","busName":"I2CA"}Errors: failInvalidBusNum, failBusNotFound
|
devman/cmdjson |
GET | Send a JSON command to a device. The body parameter contains URL-encoded JSON and must include a device field. Used for devices that accept JSON commands like MotorControl. See MotorControl Commands for details. |
devman/cmdjson?body={"device":"MotorControl","cmd":"motion","mode":"abs","pos":[100,50,25],"speed":75} |
{"req":"devman/cmdjson?body={...}","rslt":"ok"}Returns: RAFT_OK, RAFT_BUSY, RAFT_INVALID_DATA, RAFT_INVALID_OPERATION, RAFT_CANNOT_START
|
devman/cmdraw |
GET | Send a raw command to a device on a specific bus. The hexWr parameter contains hex-encoded bytes to write. The numToRd parameter specifies how many bytes to read back. Device can be identified by deviceid=<busNum>_<hexAddr> or by separate bus (can be name or number) and addr (plain hex, no 0x prefix) parameters. |
devman/cmdraw?deviceid=1_6a&hexWr=0F&numToRd=1or devman/cmdraw?bus=I2CA&addr=6a&hexWr=0F&numToRd=1
|
{"req":"devman/cmdraw?bus=I2CA&addr=6a&hexWr=0F&numToRd=1","rslt":"ok"} |
devman/demo |
GET | Start a demo device for testing. The type parameter specifies the device type (default: "ACCDEMO"). Optional parameters include rate (sample rate in ms, default: 100), duration (duration in ms, default: 0 = infinite), offlineIntvS (interval between offline periods in seconds, default: 0 = no offline), and offlineDurS (duration of offline period in seconds, default: 10). Note: This endpoint is only available if DEVICE_MANAGER_ENABLE_DEMO_DEVICE is defined. |
devman/demo?type=ACCDEMO&rate=100&duration=60000&offlineIntvS=30&offlineDurS=5 |
{"req":"devman/demo?type=ACCDEMO&rate=100&duration=60000&offlineIntvS=30&offlineDurS=5","rslt":"ok","demoStarted":true,"type":"ACCDEMO","rate":100,"duration":60000,"offlineIntvS":30,"offlineDurS":5}Errors: failDemoDeviceExists
|
devman/devconfig |
GET | Configure polling parameters for a device. intervalUs (optional) sets the polling interval in microseconds. numSamples (optional) sets the number of buffered poll samples (changing this clears buffered data). busHz (optional) sets the I2C bus speed in Hz for this device's polls (0 = revert to default bus speed). busHzSlots (optional) comma-separated list of slot numbers to which busHz applies (omit to keep current mask; empty or 0 = all slots). Returns the current pollIntervalUs, numSamples, busHz, and busHzSlots. Device can be identified by deviceid=<busNum>_<hexAddr> or by separate bus (can be name or number) and addr (plain hex, no 0x prefix) parameters. |
devman/devconfig?deviceid=1_25&intervalUs=50000or devman/devconfig?bus=I2CA&addr=25&intervalUs=50000&numSamples=5or devman/devconfig?deviceid=1_6a&busHz=400000&busHzSlots=4,5,6
|
{"req":"devman/devconfig?bus=I2CA&addr=25&intervalUs=50000","rslt":"ok","deviceID":"1_25","pollIntervalUs":50000,"numSamples":5,"busHz":400000,"busHzSlots":[4,5,6]}Errors: failAddrMissing, failBusMissing, failBusNotFound, failInvalidDeviceID, failInvalidInterval, failInvalidNumSamples, failUnsupportedBus
|
devman/devdata |
GET | Get status/data from a device. The name parameter specifies the device name. Returns device-specific data in JSON format. |
devman/devdata?name=MotorControl |
{"req":"devman/devdata?name=MotorControl","rslt":"ok","pos":[100.0,50.0,25.0],"steps":[10000,5000,2500],"busy":false,"paused":false} |
devman/listdevs |
GET | Enumerate currently-instantiated static devices and bus-detected devices. Optional role parameter filters by role (e.g. system, normal). Each entry includes the canonical deviceid, optional name/role (when set / non-default), and dtIdx (device type index) when known. Undetected bus addresses are not reported. |
devman/listdevsor devman/listdevs?role=system
|
{"req":"devman/listdevs","rslt":"ok","devices":[{"deviceid":"0_0","name":"MotorControl","dtIdx":12},{"deviceid":"1_36","role":"system","dtIdx":7},{"deviceid":"1_6a","name":"IMU1","dtIdx":5}]} |
devman/setname |
GET | Assign a friendly name to a device (in-memory). The device is identified by canonical deviceid=<busNum>_<hexAddr> (use 0_<hexAddr> for statically-instantiated devices). name is required and must be non-empty. Works for both static and bus-detected devices. |
devman/setname?deviceid=1_6a&name=IMU1 |
{"req":"devman/setname?deviceid=1_6a&name=IMU1","rslt":"ok"}Errors: failDeviceIdMissing, failNameMissing, failInvalidDeviceId
|
devman/setrole |
GET | Assign a role string to a device (in-memory). The default role is normal; set role=system to tag devices (such as a fuel gauge) that should be treated as system devices rather than published measurement devices. Pass an empty role or normal to clear. |
devman/setrole?deviceid=1_36&role=system |
{"req":"devman/setrole?deviceid=1_36&role=system","rslt":"ok"}Errors: failDeviceIdMissing, failInvalidDeviceId
|
devman/slot |
GET | Set or query the operating mode of multiplexer/expander slots on a bus. bus is the bus name or number. To set a mode, supply slot (must be >0) and mode (e.g. i2c, serial-full, serial-half). To query all slots' modes on the bus, omit mode. |
devman/slot?bus=I2CA&slot=4&mode=serial-halfor devman/slot?bus=I2CA (query) |
{"req":"devman/slot?bus=I2CA&slot=4&mode=serial-half","rslt":"ok","bus":"I2CA","slot":4,"mode":"serial-half"}Errors: failBusMissing, failBusNotFound, failSlotMissing, failInvalidSlot, failBusNoSlotControl, failSetMode
|
devman/typeinfo |
GET | Two modes: (a) Type lookup — supply type (device type name or device type index) to get the static device type record. (b) Per-device lookup — supply deviceid=<busNum>_<hexAddr> or bus+addr to get the type record for the device actually installed/detected at that address plus any sidecar fields (name, role) that have been assigned to it. The name field is omitted when no friendly name is set, and role is omitted when the role is normal. |
devman/typeinfo?type=LSM6DSor devman/typeinfo?type=5or devman/typeinfo?deviceid=1_6a
|
{"req":"devman/typeinfo?deviceid=1_6a","rslt":"ok","devinfo":{"name":"LSM6DS", ... },"dtIdx":5,"name":"IMU1","role":"system"} |
espFwUpdate |
POST | Start a firmware update of the main system firmware. Since this is a POSt command it operates normally over WiFi but must be used via RICREST for other comms channels. | espFwUpdate |
|
filedelete/<fs>/<filename> |
GET | Delete a file on a file system | filedelete/<fs>/<filename> |
{"req":"filedelete/local/test.txt","rslt":"ok"} |
filelist/<fs> |
GET | Get a list of files on the file system. Two file systems are supported: local (stored in flash on the ESP32) and SD (if an external SD card is present). The first part of the path can specify a file system followed by ~. If no file system is specified the default one is used which is generally local. |
filelistor filelist/localor filelist/sd
|
{"req":"filelist","rslt":"ok","fsName":"local","fsBase":"/local","diskSize":892556.00,"diskUsed":111946.00,"folder":"/local/","files":[{"name":"test.txt","size":317}, ... ]} |
fileread/<fs>/<filename> |
GET | Read the content of a text file and return as a string |
fileread/local/<fileName>or fileread/sd/test.txt
|
… the text content of the file … |
fileupload |
POST | Upload a file to the file system using HTTP POST. This is only directly usable from a WiFi/Ethernet connection, other communication channels are supported using the RICREST protocol. |
fileupload |
|
friendlyname |
GET | Get or set the friendly name. Set a blank name to clear. The name and friendlyNameIsSet are strored in non-volatile storage |
friendlynameor friendlyname/My Deviceor friendlyname/
|
{"req":"friendlyname","friendlyName":"My Device","friendlyNameIsSet":1,"rslt":"ok"}or {"req":"friendlyname/My Device","friendlyName":"My Device","friendlyNameIsSet":1,"rslt":"ok"}or {"req":"friendlyname/","friendlyName":"SystemName","friendlyNameIsSet":0,"rslt":"ok"}
|
getsettings/<filter> |
GET | Get SysType settings. These are the overall JSON configuration for the active SysType. There are two sections to the SysType settings, base settings are those defined in the SysType defined when the firmware was built and are immutable, nv settings are overrides to the base settings which are stored in non-volatile storage and are user-modifiable (see postsettings below). The option allows section of base, nv or all settings
|
getsettingsor getsettings/nv
|
{"req":"getsettings","sysType":"MySysType","nv":{},"base":{"SysType":"MySysType","CmdsAtStart":"","WebUI":"","SysManager":{"monitorPeriodMs":10000,"reportList":["NetMan","BLEMan","SysMan"],... |
hwrevno |
GET | Get hardware revision and SysTypeVersion The hardware revision may be any string. Once set the hardware revision is stored in non-volatile storage The SysTypeVers is a string which is used to determine which version of a SysType is used (this is applicable to versioned SysTypes only) |
hwrevno |
{"req":"hwrevno","SysTypeVers":"","HwRev":"","rslt":"ok"} |
led/<elem>/<cmd>/<data>?<args> |
GET | Control LED pixels via LEDPixelsDevice. <elem> is segment name or index (e.g. ring, 0). Commands include setall, setled, setleds, off, pattern, listpatterns. |
led/ring/setall/FF0000or led/ring/pattern/RainbowSnake?speed=1000&brightness=50
|
{"req":"led/ring/setall/FF0000","rslt":"ok"} |
postsettings |
POST | Set SysType nv (non-volatile) settings, see getsettings for explanation of SysType settings.This POST operation will only work natively over HTTP - see RICREST for use over other comms channels. |
postsettings |
The JSON object has the same format as the SysType settings returned by the getsettings/base command.Override occurs JSON tag by JSON tag, so if an array is specified at exactly the same point in the nv section then it will override an array of the same name and position in the base settings. |
reformatfs |
GET | Re-format the file system (either local or sd). This can be forced (even if the fs is not corrupt) using the reformatfs/force option. Note that the system will restart if a re-format is successful. |
reformatfs/local |
{"req":"reformatfs/local","rslt":"ok"} |
reset |
GET | Schedule a reset in around 1 second. | reset |
{"req":"reset","rslt":"ok"} |
serialno |
GET | Set / get system serial number. Serial number is a 16 byte value (sent/received hex formatted). |
serialno or serialno/01234567890ABCDEF0123456789ABCDEF
|
{"req":"serialno","SerialNo":"0123456789abcdef0123456789abcdef","rslt":"ok"} or {"req":"serialno/0123456789ABCDEF0123456789ABCDEF","SerialNo":"01234567890abcdef0123456789abcde","rslt":"ok"}
|
subscription |
GET | Setup subscriptions to published information. Single topic format: topic (or name) is the topic name, rateHz specifies publish rate in Hz (0 to disable), minMs sets minimum interval between messages in milliseconds (default: varies), and trigger sets the trigger type (change, time, timeorchange - default: timeorchange).Multiple topics format: Use pubRecs array with objects containing name (or topic), rateHz, minMs, and trigger fields.Note that subscriptions are specific to a communication channel and all interfaces now require explicit subscription (including BLE and serial interfaces). |
Single topic:subscription?action=update&topic=MyPublishedData&rateHz=10.0&trigger=timeorchange&minMs=100Multiple topics (JSON format): {"cmdName":"subscription","action":"update","pubRecs":[{"name":"Topic1","rateHz":10.0,"trigger":"timeorchange"},{"name":"Topic2","rateHz":0}]}
|
{'req': 'subscription', 'rslt': 'ok'} |
sysmoddebug/<SysMod> |
GET | Get debug information from a SysMod. | sysmoddebug/NetMan |
{"req":"sysmoddebug/RobotCtrl","debugStr":"... debug info ..."} |
sysmodinfo/<SysMod> |
GET | Get information on a SysMod (system module). SysMod names are case-sensitive. Examples of SysMod names are NetMan, BLEMan, SysMan. |
sysmodinfo/NetMan |
{“rslt”:”ok”,"isConn":1,"connState":"WiFiAndIP","SSID":"myssid","IP":"192.168.1.12","Hostname":""} |
v |
GET | Get the system name and version of RIC | v | {"req":"v","rslt":"ok","SystemName":"Cog","SystemVersion":"1.3.0","Friendly":"","SerialNo":"","MAC":"b0818422894a","SysTypeVers":"","HwRev":""} |
w/<ssid>/<password> |
GET | Specify WiFi Station (client) credentials. WiFi SSID is limited to 31 (not 32) chars. Password is limited to 63 (not 64) chars. Valid SSID chars include: ~!@#$^*()-={}[:;<>?,.Aa1 %&_/<br> And valid Password chars include:~!@#$^*()-={}[:;<>?,.A1 %&_]+"\/ HTTP encoded chars are valid - e.g. backslash %2F forward-slash %5C. |
w/myssid/mypassword |
{"req":"w/myssid/mypassword","rslt":"ok"} |
wap/<ssid>/<password> |
GET | Specify WiFi Access Point credentials. WiFi SSID is limited to 31 (not 32) chars. Password is limited to 63 (not 64) chars. Valid SSID chars include: ~!@#$^*()-={}[:;<>?,.Aa1 %&_/<br> And valid Password chars include:~!@#$^*()-={}[:;<>?,.A1 %&_]+"\/ HTTP encoded chars are valid - e.g. backslash %2F forward-slash %5C. |
wap/myssid/mypassword |
{"req":"wap/myssid/mypassword","rslt":"ok"} |
wc/<norestart> |
GET | Clear WiFi credentials and disconnect WiFi. norestart option suppresses restart |
wc or wc/norestart
|
{"req":"wc","rslt":"ok"} or {"req":"wc/norestart","rslt":"ok"}
|
wifipause/<op> |
GET | Pause/resume WiFi operation |
wifipause/pauseor wifipause/resume
|
{"req":"wifipause/pause","rslt":"ok"}or {"req":"wifipause/resume","rslt":"ok"}
|
wifiscan |
GET | Scan for WiFi Access Points. Two operations are supported: start starts a new scan and results returns results of a previous scan. After starting a scan results can be called periodically to get the result of the scan which will either be a indicate the scan is in progress or the scan is complete along with a list of discovered access points. |
wifiscan/startor wifiscan/results
|
wifiscan/startor wifiscan/results
|
Getting Started
- Quick Start
- Architecture at a Glance
- Writing Your First SysMod
- Adding a Comms Channel
- Adding an I2C Device Type
- PlatformIO / Arduino
Scaffolding & Building
- Raft CLI
- SysTypes
- Top-Level SysType
- Build Process
- WebUI Build Pipeline
- File System
- Partitions & Flash
- Local Dev Libraries
- Library Developer Guide
Architecture
Built-in SysMods
- NetworkManager
- BLEManager
- WebServer
- MQTTManager
- SerialConsole
- CommandSerial
- CommandSocket
- CommandFile
- FileManager
- LogManager
- ESPOTAUpdate
- StatePublisher
- Remote Logging
- Data Source Registration
Comms & Protocols
- Stack Overview
- Comms Channels
- ProtocolExchange
- RICREST Protocol
- Real-Time Streams
- Adding REST Endpoints
- Built-in REST Endpoints
- File Download (OKTO)
- OTA Update Flow
Devices & Buses
- DeviceManager
- Device Manager REST API
- Device Factory & Classes
- Device Type Records
- Adding an I2C Device Type
- Device Data Publishing
- Data Logger
- I2C Bus
- I2C Device Scanning
- I2C ID & Polling
- MotorControl Overview
- MotorControl Config
- MotorControl Commands
Helpers
Reference