ONE analytics:overview
← Receivers

analytics:overview

analytics family

mcp

The workspace dashboard as data — visitors, chats, money, credits, runs, sources, pages, what needs you and the live feed: the exact figures /u/<slug>/dashboard draws, from the same loader

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_workspace
The class of authority the caller must already hold, decided from the attested context with no round trip.
Authority action
read_revenue
Also gated per node — the caller must be permitted this action over the workspace it names.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.
Version
1.0.0
Pin this to keep a contract stable; additive bumps never break callers.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/analytics:overview \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "workspace": "vespio", "range": "7", "host": "app.vespio.ai" }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • workspace string optional Workspace slug; defaults to the attested caller's. Names a target only — the caller must pass the dashboard page's own guard for it AND control it.
  • range 7 | 30 | 90 optional Window in days, the page's ?range=. Default '7'. Visit figures cover at most 14 of them (see overview.visitDays).
  • host string optional Hostname the dashboard is viewed on (e.g. app.vespio.ai). Referrers from it count as same-site, as the page counts its own host. The workspace's verified domains and one.ie always do; the hosts used come back as `ownHosts`.

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • range 7 | 30 | 90
  • ownHosts string[] The hosts treated as same-site when classing referrers into sources
  • overview object
  • childCount number Direct child workspaces; decides `view`
  • view operator | portfolio
  • portfolio any The Clients section (last 7 days); null unless view is 'portfolio' and the read succeeded
  • education any The learners section (last 7 days); null = the read failed
  • signalMap object | null Signals by workspace and event, last 24 hours; this workspace, the caller's own and up to 7 of the busiest descendants (CAPPED at 9). null = could not look, never 'nothing happened'
  • error string no_db | workspace required | forbidden | authority_undetermined (membership could not be read — retry) | bad_slug

Traffic

Every call to analytics:overview, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names analytics:overview, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

UI 1
  • one.ie/web/src/pages/u/[slug]/dashboard.astro:39
API route 2
  • one.ie/web/src/lib/dashboard/load-dashboard.ts:2
  • one.ie/web/src/lib/receiver-index.generated.ts:41
→

Answered by

analytics:overview one.ie/web/src/lib/resolvers/analytics.ts:104 Dispatched through POST /api/ask/analytics:overview, after the envelope validates the payload.

analytics family · 1 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace": {
      "description": "Workspace slug; defaults to the attested caller's. Names a target only — the caller must pass the dashboard page's own guard for it AND control it.",
      "type": "string"
    },
    "range": {
      "description": "Window in days, the page's ?range=. Default '7'. Visit figures cover at most 14 of them (see overview.visitDays).",
      "type": "string",
      "enum": [
        "7",
        "30",
        "90"
      ]
    },
    "host": {
      "description": "Hostname the dashboard is viewed on (e.g. app.vespio.ai). Referrers from it count as same-site, as the page counts its own host. The workspace's verified domains and one.ie always do; the hosts used come back as `ownHosts`.",
      "type": "string"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "range": {
      "type": "string",
      "enum": [
        "7",
        "30",
        "90"
      ]
    },
    "ownHosts": {
      "description": "The hosts treated as same-site when classing referrers into sources",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "overview": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "range": {
          "type": "string"
        },
        "days": {
          "type": "number"
        },
        "visitDays": {
          "type": "number",
          "description": "How many of `days` the visit figures cover — raw visits are KEPT 14 days, so a 30/90-day range reads 14 days of visits. Not a sample: a retention cap"
        },
        "asOfMs": {
          "type": "number"
        },
        "humans": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ],
          "description": "Distinct human visitors; prev null = the earlier window is not kept, never zero"
        },
        "bots": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ]
        },
        "views": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ]
        },
        "chats": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ],
          "description": "Visitor conversations started (threads with a visitor cookie) over the full range"
        },
        "chatsInVisitWindow": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ]
        },
        "revenueCents": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ],
          "description": "Settled cash, USD cents — credits never added in"
        },
        "payments": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ]
        },
        "paymentsInVisitWindow": {
          "type": "number"
        },
        "creditsEarned": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ]
        },
        "pending": {
          "type": "object",
          "properties": {
            "cents": {
              "type": "number"
            },
            "count": {
              "type": "number"
            }
          },
          "required": [
            "cents",
            "count"
          ]
        },
        "waiting": {
          "type": "number",
          "description": "EXACT count of visitor chats whose last word is the customer's"
        },
        "runs": {
          "type": "object",
          "properties": {
            "done": {
              "type": "object",
              "properties": {
                "now": {
                  "type": "number"
                },
                "prev": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "now",
                "prev"
              ]
            },
            "failed": {
              "type": "object",
              "properties": {
                "now": {
                  "type": "number"
                },
                "prev": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "now",
                "prev"
              ]
            },
            "running": {
              "type": "number"
            }
          },
          "required": [
            "done",
            "failed",
            "running"
          ]
        },
        "creditsBalance": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "creditsSpent": {
          "type": "object",
          "properties": {
            "now": {
              "type": "number"
            },
            "prev": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "now",
            "prev"
          ]
        },
        "series": {
          "type": "array",
          "items": {},
          "description": "One point per day: humans/views/bots (null older than 14 days — not kept), chats, revenueCents, runsDone, runsFailed"
        },
        "sources": {
          "type": "array",
          "items": {},
          "description": "Visitors by referrer class (direct/search/social/ai/referral) with hosts; built from at most the top 200 referrers"
        },
        "pages": {
          "type": "array",
          "items": {},
          "description": "Top pages by visitors — CAPPED at 25"
        },
        "devices": {
          "type": "array",
          "items": {}
        },
        "buyers": {
          "type": "array",
          "items": {}
        },
        "failedFlows": {
          "type": "array",
          "items": {}
        },
        "bookings": {
          "type": "array",
          "items": {}
        },
        "waitingChats": {
          "type": "array",
          "items": {},
          "description": "The newest waiting chats — CAPPED at 20; `waiting` is the exact count"
        },
        "needs": {
          "type": "array",
          "items": {}
        },
        "feed": {
          "type": "array",
          "items": {}
        },
        "lifetimeCents": {
          "type": "number"
        }
      },
      "required": [
        "slug",
        "range",
        "days",
        "visitDays",
        "asOfMs",
        "humans",
        "bots",
        "views",
        "chats",
        "chatsInVisitWindow",
        "revenueCents",
        "payments",
        "paymentsInVisitWindow",
        "creditsEarned",
        "pending",
        "waiting",
        "runs",
        "creditsBalance",
        "creditsSpent",
        "series",
        "sources",
        "pages",
        "devices",
        "buyers",
        "failedFlows",
        "bookings",
        "waitingChats",
        "needs",
        "feed",
        "lifetimeCents"
      ]
    },
    "childCount": {
      "description": "Direct child workspaces; decides `view`",
      "type": "number"
    },
    "view": {
      "type": "string",
      "enum": [
        "operator",
        "portfolio"
      ]
    },
    "portfolio": {
      "description": "The Clients section (last 7 days); null unless view is 'portfolio' and the read succeeded"
    },
    "education": {
      "description": "The learners section (last 7 days); null = the read failed"
    },
    "signalMap": {
      "description": "Signals by workspace and event, last 24 hours; this workspace, the caller's own and up to 7 of the busiest descendants (CAPPED at 9). null = could not look, never 'nothing happened'",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "workspaces": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "rows": {
              "type": "array",
              "items": {}
            }
          },
          "required": [
            "workspaces",
            "rows"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "description": "no_db | workspace required | forbidden | authority_undetermined (membership could not be read — retry) | bad_slug",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}