Live dashboard that flags any Gorgias agent who is offline or out of office โ using Gorgias's own audit trail. An agent is considered Active only if they've performed an action in Gorgias within the last 10 minutes.
| Status | Meaning |
|---|---|
| โ Active | Has taken an action in Gorgias within the last 10 minutes. |
| ๐ด Offline | No action in 10+ minutes (their browser may be closed or they're idle). |
| ๐ด Out of Office | Agent has explicitly marked availability/OOO (or is in the OOO override list). |
Activity is read from the Gorgias audit log (GET /api/events), which records who did what and when. Agents with no attributable event fall back to their most recently updated assigned ticket.
- Dashboard: Try the app
- JSON API: https://gorgias-agent-monitor.val.run/api
- Plain-text: https://gorgias-agent-monitor.val.run/api?format=human
The dashboard needs two environment variables:
GORGIAS_DOMAINโ your Gorgias subdomain (the part before.gorgias.com).GORGIAS_API_KEYโ an API key created in Gorgias: Settings โ Account โ REST API (copy the "Password (API key)").
Optional:
OUT_OF_OFFICE_AGENTSโ comma-separated agent emails to force into Out of Office status (handy when Gorgias's availability flag isn't exposed via API).
The dashboard auto-refreshes every 30 seconds.
- HTML dashboard (
/) โ card per agent, color-coded, with last-action time and idle minutes. - JSON (
/api) โ machine-readable report for embedding in Slack bots, PagerDuty, or cron checks.
{ "summary": { "total": 5, "active": 3, "out_of_office": 1, "offline": 1 }, "agents": [ { "name": "...", "status": "offline", "minutes_idle": 14 } ] }
An interval job (slack_alert.ts) runs every 15 minutes and posts to a Slack channel whenever a monitored agent is offline/idle >10 min or out of office. To avoid spam, it only posts when an agent's status changes, and sends a "back online" note on recovery.
Setup (one-time):
-
Create your Slack channel if you haven't (e.g.
#agent-monitoring). -
Create a Slack Incoming Webhook pointed at that channel:
- Go to https://api.slack.com/apps?new_app=1 โ Create New App โ From Scratch โ pick your workspace.
- Incoming Webhooks โ toggle On โ Add New Webhook to Workspace โ select your channel.
- Copy the webhook URL.
-
Add these env vars to the val:
- ๐ Add SLACK_WEBHOOK_URL here: https://www.val.town/x/koalaSleep/gorgias-agent-monitor/environment-variables?key=SLACK_WEBHOOK_URL
- ๐ Add ALERT_AGENTS here: https://www.val.town/x/koalaSleep/gorgias-agent-monitor/environment-variables?key=ALERT_AGENTS
ALERT_AGENTS is optional โ a comma-separated list of agent emails or names to monitor (e.g. ada@koala.com, sam). Leave it empty to alert on all agents.