ONE analytics:forms
← Receivers

analytics:forms

analytics family

mcp

Every form's funnel on a workspace — views, starts, submits, leads, email subscribes and the conversion rate (leads ÷ views), per FormBuilder block, distinct visitors

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:forms \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "workspace": "vespio", "days": 14 }}'

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 control it.
  • days number optional Window in days, default 14. Raw events are kept 14 days, so 14 is the ceiling; the window actually read comes back as from/to
  • form string optional One form: the FormBuilder block's id (the `form` field of a row). Omit for every form

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • from number
  • to number
  • days number
  • capped boolean true when the window held more rows than were read — the funnels are then a sample of the window, not all of it
  • floors boolean Always true: counts can under-count (client events dropped in flight) and never over-count
  • forms object[]
  • error string no_db | workspace required | forbidden | authority_undetermined | bad_slug | read_failed

Traffic

Every call to analytics:forms, 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:forms, 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

API route 2
  • one.ie/web/src/lib/analytics/form-stats.ts:20
  • one.ie/web/src/lib/receiver-index.generated.ts:41
→

Answered by

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

analytics family · 3 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 control it.",
      "type": "string"
    },
    "days": {
      "description": "Window in days, default 14. Raw events are kept 14 days, so 14 is the ceiling; the window actually read comes back as from/to",
      "type": "integer",
      "minimum": 1,
      "maximum": 14
    },
    "form": {
      "description": "One form: the FormBuilder block's id (the `form` field of a row). Omit for every form",
      "type": "string"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "from": {
      "type": "number"
    },
    "to": {
      "type": "number"
    },
    "days": {
      "type": "number"
    },
    "capped": {
      "description": "true when the window held more rows than were read — the funnels are then a sample of the window, not all of it",
      "type": "boolean"
    },
    "floors": {
      "description": "Always true: counts can under-count (client events dropped in flight) and never over-count",
      "type": "boolean"
    },
    "forms": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "form": {
            "type": "string",
            "description": "The FormBuilder block id"
          },
          "template": {
            "type": "string"
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "views": {
            "type": "number"
          },
          "starts": {
            "type": "number"
          },
          "submits": {
            "type": "number"
          },
          "leads": {
            "type": "number",
            "description": "Visitors whose submit lead:capture accepted"
          },
          "subscribes": {
            "type": "number",
            "description": "Visitors whose audience:subscribe was accepted (still double opt-in — confirmed from their inbox)"
          },
          "conversion": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "leads ÷ views, 0..1; null when nobody saw the form, never 0"
          },
          "startRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "completion": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "leads ÷ starts"
          },
          "stepReach": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            },
            "description": "Distinct visitors by the furthest step they reached"
          },
          "events": {
            "type": "number"
          }
        },
        "required": [
          "form",
          "template",
          "pages",
          "views",
          "starts",
          "submits",
          "leads",
          "subscribes",
          "conversion",
          "startRate",
          "completion",
          "stepReach",
          "events"
        ]
      }
    },
    "error": {
      "description": "no_db | workspace required | forbidden | authority_undetermined | bad_slug | read_failed",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}