ONE ads:insights
← Receivers

ads:insights

ads family

chatmcp

How a campaign's ads performed, per platform, ad and day — impressions, clicks, spend, conversions — with totals per variant and a lift verdict: a winner only when a two-proportion z-test of conversions per click is significant at 0.05 with at least 100 conversions per arm, else insufficient_data or no_difference. Platforms that could not be read are named in `refused`

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_integrations
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/ads:insights \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "workspace": "acme", "campaignId": "01a1edad703405d807b6b913", "since": "2026-11-25", "until": "2026-12-02" }}'

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 required Workspace (group slug). The caller must be able to read its revenue
  • campaignId string required The campaign group's gid
  • since string optional YYYY-MM-DD; default 7 days before until
  • until string optional YYYY-MM-DD; default today (UTC)

Response

What comes back from the call.

  • ok boolean
  • campaignId string
  • since string
  • until string
  • rows any[]
  • rowsTotal number
  • rowsCapped boolean true when more rows came back than this answer carries; variants and lift still count every row
  • refused any[] Each platform (or the whole read) that could not be read, with its reason
  • variants any[] Per-variant totals: impressions, clicks, spendCents, conversions
  • lift object
  • error string forbidden | unavailable | bad_request | campaign not found in this workspace | no_db

Traffic

Every call to ads:insights, 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 ads:insights, 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/components/ads/CampaignInsights.tsx:16
API route 2
  • one.ie/web/src/lib/ads-board.ts:5
  • one.ie/web/src/lib/receiver-index.generated.ts:23
Agent runtime 1
  • channels/src/aitools.ts:1752
CLI 3
  • packages/cli/src/ads.ts:334
  • packages/cli/src/lib/receivers-index.generated.ts:13
  • packages/cli/src/lib/receivers.generated.ts:13
Tests 1
  • packages/sdk/src/surfaces.test.ts:128
→

Answered by

ads:insights one.ie/web/src/lib/resolvers/ads.ts:247 Dispatched through POST /api/ask/ads:insights, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace": {
      "type": "string",
      "description": "Workspace (group slug). The caller must be able to read its revenue"
    },
    "campaignId": {
      "type": "string",
      "description": "The campaign group's gid"
    },
    "since": {
      "description": "YYYY-MM-DD; default 7 days before until",
      "type": "string"
    },
    "until": {
      "description": "YYYY-MM-DD; default today (UTC)",
      "type": "string"
    }
  },
  "required": [
    "workspace",
    "campaignId"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "campaignId": {
      "type": "string"
    },
    "since": {
      "type": "string"
    },
    "until": {
      "type": "string"
    },
    "rows": {
      "type": "array",
      "items": {}
    },
    "rowsTotal": {
      "type": "number"
    },
    "rowsCapped": {
      "description": "true when more rows came back than this answer carries; variants and lift still count every row",
      "type": "boolean"
    },
    "refused": {
      "description": "Each platform (or the whole read) that could not be read, with its reason",
      "type": "array",
      "items": {}
    },
    "variants": {
      "description": "Per-variant totals: impressions, clicks, spendCents, conversions",
      "type": "array",
      "items": {}
    },
    "lift": {
      "type": "object",
      "properties": {
        "verdict": {
          "type": "string",
          "enum": [
            "winner",
            "no_difference",
            "insufficient_data"
          ]
        },
        "metric": {
          "type": "string",
          "description": "conversions_per_click"
        },
        "control": {
          "type": "string"
        },
        "treatment": {
          "type": "string"
        },
        "winner": {
          "type": "string"
        },
        "lift": {
          "type": "number"
        },
        "pValue": {
          "type": "number"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "verdict",
        "metric",
        "note"
      ]
    },
    "error": {
      "description": "forbidden | unavailable | bad_request | campaign not found in this workspace | no_db",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": {}
}