ONE contact:predictions
← Receivers

contact:predictions

contact family

One contact's order predictions in your group, computed on read from real orders: orders, total and average order value, first and last order, median gap, the predicted next order, a CLV over the horizon, churn risk, and an RFM score and segment ranked against the group's buyers. status says too_few_orders or mixed_currency rather than guess

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
owner
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.

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/contact:predictions \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "email": <string> }}'

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.

  • email string required The contact's address. Hashed and matched against orders.customer_uid
  • workspace string optional Names the group; omit for your own. A group you do not control is refused workspace_not_yours

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • email string
  • orders_count number
  • total_cents number
  • aov_cents number
  • currency string | null
  • first_order_at number | null Unix seconds
  • last_order_at number | null Unix seconds
  • median_gap_days number | null
  • next_order_at number | null Unix seconds: last order plus the median gap; null with fewer than two orders
  • clv_cents number | null Predicted value over horizon_days
  • churn_risk low | medium | high | null
  • status ok | too_few_orders | mixed_currency
  • rfm object | null
  • rfm_status ok | too_few_buyers | no_orders
  • horizon_days number
  • buyers_in_group number
  • truncated boolean The group's order read hit its cap: RFM ranks against the newest orders only
  • computed_at number Unix ms
  • error string forbidden (no attested caller) · workspace_not_yours · no_db · bad_email

Traffic

Every call to contact:predictions, 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 contact:predictions, 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/receiver-index.generated.ts:133
  • one.ie/web/src/lib/resolvers/predictions.ts:41
CLI 2
  • packages/cli/src/lib/receivers-index.generated.ts:135
  • packages/cli/src/lib/receivers.generated.ts:135
→

Answered by

contact:predictions one.ie/web/src/lib/resolvers/predictions.ts:40 Dispatched through POST /api/ask/contact:predictions, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The contact's address. Hashed and matched against orders.customer_uid"
    },
    "workspace": {
      "description": "Names the group; omit for your own. A group you do not control is refused workspace_not_yours",
      "type": "string"
    }
  },
  "required": [
    "email"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "orders_count": {
      "type": "number"
    },
    "total_cents": {
      "type": "number"
    },
    "aov_cents": {
      "type": "number"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_order_at": {
      "description": "Unix seconds",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_order_at": {
      "description": "Unix seconds",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "median_gap_days": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_order_at": {
      "description": "Unix seconds: last order plus the median gap; null with fewer than two orders",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "clv_cents": {
      "description": "Predicted value over horizon_days",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "churn_risk": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "too_few_orders",
        "mixed_currency"
      ]
    },
    "rfm": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "r": {
              "type": "number"
            },
            "f": {
              "type": "number"
            },
            "m": {
              "type": "number"
            },
            "segment": {
              "type": "string",
              "enum": [
                "champions",
                "loyal",
                "new",
                "potential",
                "cant_lose",
                "at_risk",
                "hibernating",
                "lost"
              ]
            }
          },
          "required": [
            "r",
            "f",
            "m",
            "segment"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "rfm_status": {
      "type": "string",
      "enum": [
        "ok",
        "too_few_buyers",
        "no_orders"
      ]
    },
    "horizon_days": {
      "type": "number"
    },
    "buyers_in_group": {
      "type": "number"
    },
    "truncated": {
      "description": "The group's order read hit its cap: RFM ranks against the newest orders only",
      "type": "boolean"
    },
    "computed_at": {
      "description": "Unix ms",
      "type": "number"
    },
    "error": {
      "description": "forbidden (no attested caller) · workspace_not_yours · no_db · bad_email",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}