Stream Agent API: stop, close apps, status and webhooks

Your own code can control the E3DS Stream Agent on your machines: stop an agent or close the apps it started, ask whether each machine is idle or streaming, and receive a signed message (a webhook) the moment an agent connects, an app starts or a viewer joins. Everything works with your API key; nothing needs to be installed besides the Stream Agent itself.

Before you start

All calls

CallWhat it does
GET /v1/stream-agentsYour agents and what each one is doing
GET /v1/stream-agents/{agentId}One agent
POST /v1/stream-agents/{agentId}/close-appsClose the apps the agent started; the agent stays connected
POST /v1/stream-agents/{agentId}/stopClose the apps, then the Stream Agent program closes (the computer stays on)
GET /v1/webhooksYour webhook addresses, on/off, last delivery
PATCH /v1/webhooks/{event}Set the address of one event and/or switch it on or off
POST /v1/webhooks/{event}/testSend a test message to that address now
GET /v1/webhooks/signing-secretYour signing secret (made on first use)
POST /v1/webhooks/signing-secretA new signing secret - the old one stops working at once

Errors always look like {"error": {"code": "agent_not_found", "message": "..."}} with a real HTTP status.

Is my machine idle or streaming?

GET https://agw.eagle3dstreaming.com/v1/stream-agents
Authorization: Bearer YOUR_API_KEY
{
  "items": [
    {
      "agentId": "E3DS-AGENT-MY-PC",
      "status": "online",
      "activity": "streaming",
      "appName": "MyGame",
      "appVersion": "3",
      "viewerConnected": true,
      "viewers": 1,
      "agentVersion": "0.6.4",
      "computerName": "MY-PC",
      "since": "2026-11-27T03:21:12.625Z",
      "lastSeen": "2026-11-27T03:22:40.101Z",
      "connectedAt": "2026-11-27T03:15:27.413Z"
    }
  ]
}
FieldValuesMeaning
statusonline / offlineIs the agent connected to us now?
activityidle / streamingstreaming while an app runs for a viewer (from the moment it starts); idle = free for the next viewer
viewerConnected, viewerstrue / numberA viewer's stream is running
sincetime (UTC)When the current status / activity began
lastSeentime (UTC)Last contact; an agent not heard from for 3 minutes is shown offline

GET /v1/stream-agents/MY-PC answers one agent the same way, or 404 agent_not_found.

Close the apps, or stop the agent

POST https://agw.eagle3dstreaming.com/v1/stream-agents/MY-PC/close-apps
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{"force": false}

/stop works the same way. Both close every app the agent started, including the extra processes Unreal starts, and answer with the list. force (default false): stop even while a viewer is streaming - that viewer's session ends.

{
  "agentId": "E3DS-AGENT-MY-PC",
  "agentConfirmed": true,
  "appsOnly": true,
  "closedProcesses": [
    { "name": "MyGame.exe", "pid": 27428, "parentPid": 135700, "startedByAgent": true,  "result": "closed", "exitCode": 1,    "error": null },
    { "name": "MyGame.exe", "pid": 131016, "parentPid": 27428, "startedByAgent": false, "result": "closed", "exitCode": null, "error": null }
  ],
  "stillRunning": 0,
  "agentStopped": false
}
SituationAnswerOn the machine
Nobody watching200Apps closed; with /stop the agent closes too (agentStopped: true)
A viewer is streaming409 viewer_connectedNothing - send {"force": true} to go ahead
A viewer is streaming, force: true200The viewer's session ends, apps closed
The agent is not connected409 agent_offlineNothing
Agent older than 0.6.4409 agent_update_neededNothing - it updates itself when idle
Wrong id, or an agent of another account404 agent_not_foundNothing
Sent, but the agent did not answer within 15 s202, agentConfirmed: falseUnknown - ask the status, or call again
Missing or wrong API key401Nothing
More than 60 calls a minute429 rate_limitedNothing - wait a moment

A stopped agent does not start again by itself; start it on the machine (or with your own tools) when you need it. result: "still-running" in the list means Windows refused to close that process; its error says why. Every call is recorded with its time and where it came from.

Webhooks: be told the moment something changes

Instead of asking for the status again and again, give us an https address per event and we send a signed POST to it when it happens. Off until you set an address.

agent.connected app.started viewer.connected viewer.disconnected app.exited agent.disconnected a viewer opens your linkthe viewer leavesagent closed / stopped
The events of one session on your machine, in order.
EventSent whenAfter it, the agent is
agent.connectedthe Stream Agent connects to usonline, idle
app.starteda viewer opened your link and the agent started your apponline, streaming
viewer.connectedthe viewer's stream beginsonline, streaming, viewer connected
viewer.disconnectedthe viewer left (closed the tab, was kicked, the session ended)online, streaming, no viewer
app.exitedthe app closed (viewer left, crash, or close-apps / stop)online, idle
agent.disconnectedthe agent was closed or stopped, or lost its connectionoffline

Set it up with three calls

1. Your signing secret - keep it on your server; it proves each message came from us.

GET https://agw.eagle3dstreaming.com/v1/webhooks/signing-secret
Authorization: Bearer YOUR_API_KEY

→ {"secret": "whsec_1fce...", "secretHint": "whsec_1fce...", "createdAt": "2026-11-27T03:30:00.000Z"}

2. An address per event - repeat for each event you want:

PATCH https://agw.eagle3dstreaming.com/v1/webhooks/viewer.connected
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{"url": "https://your-server.example.com/e3ds-webhook", "enabled": true}

→ {"type": "viewer.connected", "url": "https://your-server.example.com/e3ds-webhook", "enabled": true, "paused": false}

3. A test message to check your receiver:

POST https://agw.eagle3dstreaming.com/v1/webhooks/viewer.connected/test
Authorization: Bearer YOUR_API_KEY

→ {"delivered": true, "attempt": {"status": 200, "ms": 286, "answer": "ok", "error": null}}

{"enabled": false} switches an event off and keeps its address; {"url": ""} removes it. GET /v1/webhooks lists every event with its address, on/off, paused and the last delivery. POST /v1/webhooks/signing-secret makes a new secret - update your server first, the old one stops at once.

What arrives

A POST with Content-Type: application/json, the headers E3DS-Event, E3DS-Event-Id, E3DS-Signature, and:

{
  "id": "evt_31710792f7ccb31d1d0d18d9",
  "type": "viewer.connected",
  "created": "2026-11-27T03:21:12.625Z",
  "account": "yourname",
  "agentId": "E3DS-AGENT-MY-PC",
  "app": "MyGame",
  "version": "3",
  "data": {
    "status": "online",
    "activity": "streaming",
    "viewerConnected": true,
    "viewers": 1,
    "appName": "MyGame",
    "appVersion": "3",
    "agentVersion": "0.6.4",
    "computerName": "MY-PC",
    "since": "2026-11-27T03:21:12.625Z",
    "lastSeen": "2026-11-27T03:21:12.625Z",
    "viewerId": "1",
    "sessionId": "yourname_MyGame_3_42787e4d_..."
  }
}

data carries the same fields as the status call. app.exited adds exitCode and why (for example viewer left); agent.disconnected has status: "offline". The same id is sent again on a retry, so a repeat can be ignored. A test message has type: "webhook.test" and data.wouldBe = the event you tested.

Check the signature

E3DS-Signature: t=1795139555,v1=5f2c... - v1 is HMAC-SHA256 of "<t>.<raw body>" with your signing secret. Compare it, and refuse a t older than 5 minutes. Use the raw body exactly as received, before any JSON parsing.

Node.js

const crypto = require("crypto");
function e3dsVerify(secret, header, rawBody) {
  const p = Object.fromEntries(String(header || "").split(",").map((x) => x.split("=")));
  const t = Number(p.t);
  if (!t || !p.v1 || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const want = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return want.length === p.v1.length && crypto.timingSafeEqual(Buffer.from(want), Buffer.from(p.v1));
}
// Express: app.post("/e3ds-webhook", express.raw({ type: "application/json" }), (req, res) => {
//   if (!e3dsVerify(process.env.E3DS_WEBHOOK_SECRET, req.get("E3DS-Signature"), req.body.toString("utf8"))) return res.sendStatus(401);
//   res.sendStatus(200);   // answer first, then do the work
//   const evt = JSON.parse(req.body);
// });

Python

import hashlib, hmac, time

def e3ds_verify(secret: str, header: str, raw_body: bytes) -> bool:
    parts = dict(p.split("=", 1) for p in (header or "").split(",") if "=" in p)
    try:
        t = int(parts["t"])
    except (KeyError, ValueError):
        return False
    if abs(time.time() - t) > 300 or "v1" not in parts:
        return False
    want = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(want, parts["v1"])

When your server does not answer

SituationWhat happens
Your server answers 2xx within 5 secondsDelivered
An error status, no answer within 5 s, or a redirectSent again (same id) after 5 s, 30 s and 2 minutes, then marked failed
20 tries in a row failThat address is paused - nothing more is sent. GET /v1/webhooks shows "paused": true; PATCH ... {"enabled": true} resumes it
Switched off (enabled: false)Nothing is sent for that event; the address is kept
http://, a private address (10.x, 192.168.x, 127.x, ...) or an Eagle 3D Streaming addressRefused when you set it: 400 invalid_url

Answer first, then do slow work. Slack, Microsoft Teams and Discord incoming-webhook addresses get a ready chat message instead of JSON.

Related

Last updated