ONE lead:update
← Receivers

lead:update

lead family

mcp

status 'booked': records that a lead became a booked job in the caller's own workspace (or a client workspace the caller controls, named by workspace): matches the contact lead:capture filed on phone or email, or by its contact id, keeps one booking with the job value in whole cents and the booked time, and tags the contact booked, which stops the follow-up sequences. The same booking sent twice is one row. No match writes nothing and answers matched:false. The cost per booked move per campaign and variant reads these rows against ad spend

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_workflows
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
no
This cannot be undone. Dry-run it first where the contract allows.
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:update \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "status": "booked", "phone": "+15550100", "job_value_cents": 189900, "source": "manual" }}'

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.

  • status booked required booked = the lead became a booked job. Required: no status is a default, and any other is refused as bad_status after the caller's authority is checked
  • phone string optional The phone the lead gave; matched as lead:capture hashed it
  • email string optional The email the lead gave; matched as lead:capture hashed it
  • contact string optional The contact's id (personId from lead:capture); used only when it is a contact of this workspace
  • job_value_cents number | null optional The job value in whole cents (189900 = $1,899.00); dollars are refused
  • booked_at number optional When it was booked, unix seconds; defaults to now; more than a year ahead is refused
  • source string optional Where the booking came from, a short slug (supermove, manual)
  • workspace string optional A client workspace to book in; only a workspace the caller controls (the agency above it). Defaults to the caller's own

Response

What comes back from the call.

  • ok boolean
  • matched boolean
  • contact string The matched contact's id
  • booked_at number
  • job_value_cents number | null
  • error string unauthenticated | no_db | forbidden (a workspace the caller does not control) | bad_status | phone_or_email_required | job_value_cents_not_whole_cents | booked_at_too_far_ahead

Traffic

Every call to lead:update, 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:update, 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/integrations/inbound-hook.ts:270
  • one.ie/web/src/lib/receiver-index.generated.ts:219
→

Answered by

lead:update one.ie/web/src/lib/resolvers/lead-book.ts:136 Dispatched through POST /api/ask/lead:update, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "booked"
      ],
      "description": "booked = the lead became a booked job. Required: no status is a default, and any other is refused as bad_status after the caller's authority is checked"
    },
    "phone": {
      "description": "The phone the lead gave; matched as lead:capture hashed it",
      "type": "string"
    },
    "email": {
      "description": "The email the lead gave; matched as lead:capture hashed it",
      "type": "string"
    },
    "contact": {
      "description": "The contact's id (personId from lead:capture); used only when it is a contact of this workspace",
      "type": "string"
    },
    "job_value_cents": {
      "description": "The job value in whole cents (189900 = $1,899.00); dollars are refused",
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "booked_at": {
      "description": "When it was booked, unix seconds; defaults to now; more than a year ahead is refused",
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "source": {
      "description": "Where the booking came from, a short slug (supermove, manual)",
      "type": "string"
    },
    "workspace": {
      "description": "A client workspace to book in; only a workspace the caller controls (the agency above it). Defaults to the caller's own",
      "type": "string"
    }
  },
  "required": [
    "status"
  ],
  "additionalProperties": {}
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "matched": {
      "type": "boolean"
    },
    "contact": {
      "description": "The matched contact's id",
      "type": "string"
    },
    "booked_at": {
      "type": "number"
    },
    "job_value_cents": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "description": "unauthenticated | no_db | forbidden (a workspace the caller does not control) | bad_status | phone_or_email_required | job_value_cents_not_whole_cents | booked_at_too_far_ahead",
      "type": "string"
    }
  },
  "required": [
    "ok",
    "matched"
  ]
}