← Receivers

crm:context

crm family

Instant prospect context for a contact's tag set — lifecycle stage, recent threads, matched workflows, path strength. The read a sales agent makes on contact lookup, before it writes a word

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_lifecycle
The class of authority the caller must already hold, decided from the attested context with no round trip.
Authority action
manage_lifecycle
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/crm:context \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "tags": [ "consideration", "saas" ] }}'

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 optional Workspace slug; defaults to the attested caller's. Authority comes from the attested context — a slug you do not control is refused.
  • tags string[] required The contact's tags — lifecycle stage, persona, industry. MAX 8, each matching [a-z0-9_:][a-z0-9_.:-]*; more or malformed is refused by name, never silently truncated.

Response

What comes back from the call.

  • ok boolean
  • tags string[]
  • strength number Max pairwise path strength across the tag set — how hot this combination is
  • primaryStage string | null The lifecycle stage to open on, or null when the combo has none
  • suggestedAction object | null
  • lastThread object | null
  • recentThreads object[] At most 3
  • matchedWorkflows object[] At most 3
  • cachedAt number Unix seconds the combo was resolved. A KV hit can be up to its strength-derived TTL old (300s hot / 3600s warm / 86400s cold).
  • error string no_db | workspace required | forbidden | the tag-validation reason

Traffic

Every call to crm:context, 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 crm:context, 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 3
  • one.ie/web/src/lib/combo-read.ts:9
  • one.ie/web/src/lib/receiver-index.generated.ts:96
  • one.ie/web/src/pages/api/crm/combo-context.ts:6

Answered by

crm:context one.ie/web/src/lib/resolvers/crm.ts:42 Dispatched through POST /api/ask/crm:context, after the envelope validates the payload.

crm family · 1 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace": {
      "description": "Workspace slug; defaults to the attested caller's. Authority comes from the attested context — a slug you do not control is refused.",
      "type": "string"
    },
    "tags": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The contact's tags — lifecycle stage, persona, industry. MAX 8, each matching [a-z0-9_:][a-z0-9_.:-]*; more or malformed is refused by name, never silently truncated."
    }
  },
  "required": [
    "tags"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "strength": {
      "description": "Max pairwise path strength across the tag set — how hot this combination is",
      "type": "number"
    },
    "primaryStage": {
      "description": "The lifecycle stage to open on, or null when the combo has none",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "suggestedAction": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "id",
            "name",
            "tags"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "lastThread": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "lastMsgAt": {
              "type": "number"
            }
          },
          "required": [
            "id",
            "lastMsgAt"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "recentThreads": {
      "description": "At most 3",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "lastMsgAt": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "lastMsgAt"
        ]
      }
    },
    "matchedWorkflows": {
      "description": "At most 3",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "tags"
        ]
      }
    },
    "cachedAt": {
      "description": "Unix seconds the combo was resolved. A KV hit can be up to its strength-derived TTL old (300s hot / 3600s warm / 86400s cold).",
      "type": "number"
    },
    "error": {
      "description": "no_db | workspace required | forbidden | the tag-validation reason",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}