Connect to Agentic Platform

Admin guide: send live agent, run, log and alert data from your platform into WiggiWatch

Current status: mock data

This dashboard currently renders sample data from src/lib/mockData.ts. The endpoints below describe the contract your agentic platform should follow. They must be implemented in a backend before live data appears.

1

Create an API key

Generate a key in Settings → API keys. Use a dedicated key per platform or environment so it can be rotated independently. Keep it server-side only, never in browser code.

.env (agentic platform)
AGENTWATCH_URL=https://YOUR_DASHBOARD_URL
AGENTWATCH_API_KEY=YOUR_API_KEY_HERE
AGENTWATCH_WEBHOOK_SECRET=YOUR_WEBHOOK_SECRET_HERE
2

Choose your ingestion endpoints

Your platform pushes events to these endpoints. All requests require the Bearer token from step 1.

MethodPathPurpose
POST/api/ingest/agentsRegister or update an agent and its status
POST/api/ingest/runsReport task run start, progress and completion
POST/api/ingest/logsSend log lines (single or batched)
POST/api/ingest/alertsRaise or resolve alerts
GET/api/streamServer-Sent Events stream used by the dashboard
Example request (cURL)
curl -X POST https://YOUR_DASHBOARD_URL/api/ingest/runs \
  -H "Authorization: Bearer YOUR_API_KEY"  -H"Content-Type: application/json" \
  -d '{"run_id":"run_8f21","agent_id":"agt_research_01","status":"running"}'
Example request (TypeScript)
async function reportRun(run: Record<string, unknown>) {
  await fetch(process.env.AGENTWATCH_URL + '/api/ingest/runs', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer ' + process.env.AGENTWATCH_API_KEY,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(run),
  });
}
3

Send data in the expected formats

Timestamps must be ISO 8601 in UTC. Costs are in USD. Unknown fields are ignored.

Agent · POST /api/ingest/agents
{
  "agent_id": "agt_research_01",
  "name": "Research Agent",
  "role": "worker",
  "parent_id": "agt_orchestrator",
  "status": "running",
  "model": "gpt-4o",
  "updated_at": "2026-12-05T12:00:00Z"
}
Run · POST /api/ingest/runs
{
  "run_id": "run_8f21",
  "agent_id": "agt_research_01",
  "task": "Summarise Q4 support tickets",
  "status": "completed",
  "started_at": "2026-12-05T11:58:00Z",
  "ended_at": "2026-12-05T11:59:12Z",
  "latency_ms": 72000,
  "tokens_in": 4210,
  "tokens_out": 980,
  "cost_usd": 0.042,
  "tool_calls": 6,
  "error": null
}
Logs · POST /api/ingest/logs
{
  "logs": [
    {
      "ts": "2026-12-05T11:59:01Z",
      "level": "error",
      "agent_id": "agt_research_01",
      "run_id": "run_8f21",
      "message": "Tool call timed out: web_search"
    }
  ]
}
Alert · POST /api/ingest/alerts
{
  "alert_id": "alt_301",
  "severity": "critical",
  "agent_id": "agt_research_01",
  "title": "Error rate above 5% for 10 minutes",
  "state": "open"
}

Allowed status values: running, idle, queued, completed, failed. Allowed level values: debug, info, warn, error.

4

Enable live streaming to the dashboard

The dashboard subscribes to a Server-Sent Events stream so cards, the Kanban board and the activity feed update without a refresh. Events emitted: agent.updated, run.updated, log.created, alert.updated.

Dashboard subscription (TypeScript)
const source = new EventSource('/api/stream?channels=agents,runs,logs,alerts');

source.addEventListener('run.updated', (event) => {
  const run = JSON.parse((event as MessageEvent).data);
  // merge run into dashboard state
});

source.onerror = () => {
  // EventSource reconnects automatically; show a "reconnecting" badge
};

If SSE is not possible in your environment, poll the same resources every 5 to 10 seconds as a fallback.

5

Secure the connection

  • Serve everything over HTTPS and reject plain HTTP.
  • Validate the Bearer token on every ingest request; return 401 for missing or invalid keys.
  • Sign webhook payloads with an HMAC-SHA256 header and verify it using the webhook secret.
  • Rate limit per key (for example 600 requests per minute) and return 429 with a Retry-After header.
  • Rotate keys regularly and revoke any key that may have been exposed.
  • Strip prompts, PII and secrets from log messages before sending.
6

Test the connection

Enter your platform base URL to validate its format, then send a test run using the cURL example above and watch the Live Dashboard.

This is a format check only. Live ingestion is available once a backend endpoint is connected.

Troubleshooting

  • 401 Unauthorized: the API key is missing, expired or revoked.
  • 422 Unprocessable: a required field such as agent_id or status is missing or invalid.
  • Data not appearing: confirm the stream is connected and the workspace matches acme-platform-prod.
  • Stale agents: send a heartbeat to /api/ingest/agents at least every 30 seconds.