ONE whatsapp:receive
← Receivers

whatsapp:receive

whatsapp family

Record one inbound WhatsApp message on a client's own number against that workspace's consent, and say whether the front desk answers it. STOP and its family (STOP, UNSUBSCRIBE, CANCEL, END, QUIT, …) end text AND WhatsApp from this workspace to this person (both suppression rows, every record on both channels, evidence rows) and are not answered, and nothing is sent after it on either channel, template or not; other workspaces are untouched. START gives back WhatsApp replies only. ONE's own platform number has no connection row: the door names ONE's workspace inside its signature, and that is the only workspace a message may be filed under without a row. Only the channels WhatsApp door, carrying its HMAC over the message; the workspace is read from the business number, never the caller; a message id is acted on once.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
write
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/whatsapp:receive \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "phoneNumberId": <string>, "from": <string>, "body": <string>, "messageId": <string>, "attest": <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.

  • phoneNumberId string required The business number's phone number id the message arrived on — the workspace is read from it
  • from string required The customer's WhatsApp id (digits, no +)
  • body string required The message as received
  • messageId string required Meta's message id: acted on once — a replay changes nothing
  • attest string required The door's HMAC-SHA256 (SMS_ATTEST_SECRET, else SERVER_SECRET) over phoneNumberId, from, body and messageId; without it nothing is recorded

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • keyword stop | start | null
  • answer boolean false: STOP, START, a replay, or a person who said STOP — the desk does not answer
  • duplicate boolean
  • error string forbidden (not a service caller) · unattested · unknown_number · no_db

Traffic

Every call to whatsapp:receive, 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 whatsapp:receive, 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/receiver-index.generated.ts:492
  • one.ie/web/src/lib/resolvers/whatsapp.ts:172
  • one.ie/web/src/lib/sms/sms.ts:128
Agent runtime 2
  • channels/src/channels/whatsapp-cloud.ts:126
  • channels/src/channels/whatsapp-tenant.ts:20
→

Answered by

whatsapp:receive one.ie/web/src/lib/resolvers/whatsapp.ts:170 Dispatched through POST /api/ask/whatsapp:receive, after the envelope validates the payload.

whatsapp family · 2 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "phoneNumberId": {
      "type": "string",
      "description": "The business number's phone number id the message arrived on — the workspace is read from it"
    },
    "from": {
      "type": "string",
      "description": "The customer's WhatsApp id (digits, no +)"
    },
    "body": {
      "type": "string",
      "description": "The message as received"
    },
    "messageId": {
      "type": "string",
      "description": "Meta's message id: acted on once — a replay changes nothing"
    },
    "attest": {
      "type": "string",
      "description": "The door's HMAC-SHA256 (SMS_ATTEST_SECRET, else SERVER_SECRET) over phoneNumberId, from, body and messageId; without it nothing is recorded"
    }
  },
  "required": [
    "phoneNumberId",
    "from",
    "body",
    "messageId",
    "attest"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "stop",
            "start"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "answer": {
      "description": "false: STOP, START, a replay, or a person who said STOP — the desk does not answer",
      "type": "boolean"
    },
    "duplicate": {
      "type": "boolean"
    },
    "error": {
      "description": "forbidden (not a service caller) · unattested · unknown_number · no_db",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}