ONE deal:create
← Receivers

deal:create

deal family

mcp

Opens a deal for a contact of the caller's own workspace (or a client workspace the caller controls): a title, a value in whole cents and a currency, a stage, an expected close date. A contact can hold several deals. The deal is a thing of the declared type deal, so the BaaS admin lists and edits it too; the first deal declares the type in the workspace manifest. The contact is named by its id or matched on email or phone as lead:capture filed it

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
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.
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:create \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "contact": "person-01a2b3c4", "title": "Kitchen remodel", "value_cents": 1200000, "currency": "usd", "stage": "quote-sent", "closeDate": "2026-12-20" }}'

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.

  • contact string optional The contact's id (personId from lead:capture); used only when it is a contact of this workspace
  • email string optional Match the contact on the email it gave, when no contact id is sent
  • phone string optional Match the contact on the phone it gave, when no contact id is sent
  • title string optional The deal's name, up to 200 characters; defaults to Deal
  • value_cents number optional The value in whole cents (189900 = 1,899.00); dollars are refused. Default 0
  • currency string optional Three letters, lower or upper case; default usd. Sums are per currency and never converted
  • stage string optional A bare word, default new
  • closeDate string optional The expected close date, YYYY-MM-DD; the forecast groups open value by its month
  • source string optional Where the deal came from, a short slug
  • workspace string optional A client workspace to open it in; only one the caller controls. Defaults to the caller's own

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • deal object
  • fields object With invalid_fields: the declared type's refusal per field
  • error string unauthenticated | no_db | forbidden (a workspace the caller does not control) | contact_required | contact_not_found | bad_stage | bad_value | bad_currency | bad_close_date | invalid_fields | type_unavailable | write_failed

Traffic

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

Answered by

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

deal family · 3 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contact": {
      "description": "The contact's id (personId from lead:capture); used only when it is a contact of this workspace",
      "type": "string"
    },
    "email": {
      "description": "Match the contact on the email it gave, when no contact id is sent",
      "type": "string"
    },
    "phone": {
      "description": "Match the contact on the phone it gave, when no contact id is sent",
      "type": "string"
    },
    "title": {
      "description": "The deal's name, up to 200 characters; defaults to Deal",
      "type": "string"
    },
    "value_cents": {
      "description": "The value in whole cents (189900 = 1,899.00); dollars are refused. Default 0",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "currency": {
      "description": "Three letters, lower or upper case; default usd. Sums are per currency and never converted",
      "type": "string"
    },
    "stage": {
      "description": "A bare word, default new",
      "type": "string"
    },
    "closeDate": {
      "description": "The expected close date, YYYY-MM-DD; the forecast groups open value by its month",
      "type": "string"
    },
    "source": {
      "description": "Where the deal came from, a short slug",
      "type": "string"
    },
    "workspace": {
      "description": "A client workspace to open it in; only one the caller controls. Defaults to the caller's own",
      "type": "string"
    }
  }
}
{
  "$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"
      ]
    },
    "fields": {
      "description": "With invalid_fields: the declared type's refusal per field",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "error": {
      "description": "unauthenticated | no_db | forbidden (a workspace the caller does not control) | contact_required | contact_not_found | bad_stage | bad_value | bad_currency | bad_close_date | invalid_fields | type_unavailable | write_failed",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}