ONE deal:update
← Receivers

deal:update

deal family

mcp

Changes a deal: its stage, its value, its title, its expected close, or its status. status won books the deal's value as a booked job (the same number the cost per booked move reads) and tags the contact booked; status lost needs a lostReason; status open reopens it and takes a won deal's booking back. A move to another stage or status starts the deal:stage-changed workflow trigger. A deal id from another workspace answers not_found

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_actors
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/deal:update \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "tid": "01a2b3c4d5e6f7", "stage": "negotiation" }}'

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.

  • tid string required
  • stage string optional A bare word
  • status open | won | lost optional won books the value; lost needs lostReason; open reopens
  • lostReason string optional Why it was lost, up to 200 characters; required with status lost, ignored otherwise
  • value_cents number optional
  • currency string optional
  • title string optional
  • closeDate string | null optional YYYY-MM-DD; null clears it
  • workspace string optional A client workspace; only one the caller controls. Defaults to the caller's own

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • deal object
  • changed string[] The fields that moved; empty means the call changed nothing
  • error string unauthenticated | no_db | forbidden | not_found | nothing_to_update | bad_title | bad_stage | bad_status | bad_value | bad_currency | bad_close_date | lost_reason_required | write_failed

Traffic

Every call to deal: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 deal: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/deals/deals.ts:376
  • one.ie/web/src/lib/receiver-index.generated.ts:149
CLI 1
  • packages/cli/src/deals.ts:135
→

Answered by

deal:update one.ie/web/src/lib/resolvers/deals.ts:120 Dispatched through POST /api/ask/deal:update, after the envelope validates the payload.

deal family · 3 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tid": {
      "type": "string"
    },
    "stage": {
      "description": "A bare word",
      "type": "string"
    },
    "status": {
      "description": "won books the value; lost needs lostReason; open reopens",
      "type": "string",
      "enum": [
        "open",
        "won",
        "lost"
      ]
    },
    "lostReason": {
      "description": "Why it was lost, up to 200 characters; required with status lost, ignored otherwise",
      "type": "string"
    },
    "value_cents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "currency": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "closeDate": {
      "description": "YYYY-MM-DD; null clears it",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "workspace": {
      "description": "A client workspace; only one the caller controls. Defaults to the caller's own",
      "type": "string"
    }
  },
  "required": [
    "tid"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "deal": {
      "type": "object",
      "properties": {
        "tid": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "contact": {
          "type": "string"
        },
        "stage": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "won",
            "lost"
          ]
        },
        "value_cents": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "lost_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "close_date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "stage_changed_at": {
          "type": "number"
        },
        "created_at": {
          "type": "number"
        },
        "won_at": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "tid",
        "title",
        "contact",
        "stage",
        "status",
        "value_cents",
        "currency",
        "lost_reason",
        "close_date",
        "stage_changed_at",
        "created_at",
        "won_at"
      ]
    },
    "changed": {
      "description": "The fields that moved; empty means the call changed nothing",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "error": {
      "description": "unauthenticated | no_db | forbidden | not_found | nothing_to_update | bad_title | bad_stage | bad_status | bad_value | bad_currency | bad_close_date | lost_reason_required | write_failed",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}