Gorgias Agent Monitor

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.

Statuses

StatusMeaning
ActiveHas taken an action in Gorgias within the last 10 minutes.
🔴 OfflineNo action in 10+ minutes (their browser may be closed or they're idle).
🌴 Out of OfficeAgent 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.

Live URLs

Setup

The dashboard needs two environment variables:

  1. GORGIAS_DOMAIN — your Gorgias subdomain (the part before .gorgias.com).
  2. 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.

Output

  • 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 } ] }

Slack alerts

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):

  1. Create your Slack channel if you haven't (e.g. #agent-monitoring).

  2. Create a Slack Incoming Webhook pointed at that channel:

    • Go to https://api.slack.com/apps?new_app=1Create New App → From Scratch → pick your workspace.
    • Incoming Webhooks → toggle OnAdd New Webhook to Workspace → select your channel.
    • Copy the webhook URL.
  3. Add these env vars to the val:

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.