Preliminary exploration of EdgeOS web APIs.

Logging in

Session is valid for 15 minutes and is refreshed on every web request. POST to https://host-or-ip/ form data username and password. GET https://host-or-ip/api/edge/get.json can be used to get a json formatted dict containing the config and the current SESSION_ID.

Session can be extended with api/edge/heartbeat.json?_=1528820201273

Reboot by POST to api/edge/operation/reboot.json

More endpoints



You can get streaming statistical data from the endpoint wss://host-or-ip/ws/stats. The connection *MUST* have the origin header set to 'https://host-or-ip'. The data from the websocket if framed because it's actually a streaming protocol that has been sent and received over websocket. You *MUST* reassemble the web socket data since the frames may not align with data boundaries.

The format of data to and from the websocket stream is "LENGTH\nJSON_PAYLOAD". Error 403 on handshake is likely due to lack of 'origin' header as needed. Failure of sending properly formed messages to start the streaming will result in no messages from server aka "dead air". When the SESSION_ID times out the websocket will abruptly close so it's recommended to refresh it occasionally.


Return values from the stream follow a similar format.

        "cpu": "10",
        "uptime": "57864",
        "mem": "60"


POST /api/edge/batch.json



    "SET": {"failure": "0", "success": "1"}, 
    "SESSION_ID": "session_id", 
    "GET": {
        "system": { system as json }, 
        "service": { service as json }, 
    "COMMIT": {"failure": "0", "success": "1"}, 
    "SAVE": {"success": "1"}, 
    "success": true
  • products/software/edgeos/api.txt
  • Last modified: 2018/06/15 13:53
  • by brontide