ONE lead:list
← Receivers

lead:list

lead family

mcp

view 'booked-cost': reads the cost per booked move for the caller's own workspace (or a client workspace the caller controls): ad spend per campaign and per variant, the bookings whose lead clicked it (last click first, then first touch), the job value booked and spend divided by bookings. A booking whose lead carried no campaign is counted as unattributed, never folded into one. Cost is null when nothing booked or the spend is in more than one currency

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.
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/lead:list \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "view": "booked-cost" }}'

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.

  • view booked-cost required booked-cost = ad spend per campaign and variant against the bookings whose lead clicked it. Required: no view is a default, and any other is refused as bad_view after the caller's authority is checked
  • workspace string optional A client workspace to read; only one the caller controls. Defaults to the caller's own

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • campaigns object[]
  • variants object[]
  • unattributed object
  • error string unauthenticated | no_db | forbidden (a workspace the caller does not control) | bad_view

Traffic

Every call to lead:list, 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 lead:list, 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/settings/InboundHookCard.tsx:48
API route 1
  • one.ie/web/src/lib/receiver-index.generated.ts:217
CLI 1
  • packages/cli/src/lead.ts:61
→

Answered by

lead:list one.ie/web/src/lib/resolvers/lead-book.ts:207 Dispatched through POST /api/ask/lead:list, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "view": {
      "type": "string",
      "enum": [
        "booked-cost"
      ],
      "description": "booked-cost = ad spend per campaign and variant against the bookings whose lead clicked it. Required: no view is a default, and any other is refused as bad_view after the caller's authority is checked"
    },
    "workspace": {
      "description": "A client workspace to read; only one the caller controls. Defaults to the caller's own",
      "type": "string"
    }
  },
  "required": [
    "view"
  ],
  "additionalProperties": {}
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "campaigns": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "campaign": {
            "type": "string"
          },
          "spend_cents": {
            "type": "number"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "booked": {
            "type": "number"
          },
          "job_value_cents": {
            "type": "number"
          },
          "cost_per_booked_cents": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "campaign",
          "spend_cents",
          "currency",
          "booked",
          "job_value_cents",
          "cost_per_booked_cents"
        ]
      }
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "campaign": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          },
          "spend_cents": {
            "type": "number"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "booked": {
            "type": "number"
          },
          "job_value_cents": {
            "type": "number"
          },
          "cost_per_booked_cents": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "campaign",
          "variant",
          "spend_cents",
          "currency",
          "booked",
          "job_value_cents",
          "cost_per_booked_cents"
        ]
      }
    },
    "unattributed": {
      "type": "object",
      "properties": {
        "booked": {
          "type": "number"
        },
        "job_value_cents": {
          "type": "number"
        }
      },
      "required": [
        "booked",
        "job_value_cents"
      ]
    },
    "error": {
      "description": "unauthenticated | no_db | forbidden (a workspace the caller does not control) | bad_view",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}