ONE alerts:create
← Receivers

alerts:create

alerts family

An owner's opt-in to team alerts on their own WhatsApp (channel whatsapp): when a website visitor asks for a person, the owner is told on WhatsApp, with what the visitor said and the whole conversation, from ONE's alert number. The owner's tick beside the exact words (wordingVersion) makes the number PENDING and answers the message to send FROM that number to ONE's alert number (message, and a wa.me link that opens it); that message proves the number is theirs and switches alerts on (whatsapp:receive). Read the state with alerts:get, turn it off with alerts:update. Nothing is ever sent to a number that has not written first. Dark (whatsapp_alerts_not_configured) until ONE's alert number and the approved template are configured.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_integrations
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/alerts:create \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "channel": "whatsapp", "number": "+15551234567" }}'

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.

  • channel whatsapp required whatsapp: the only channel with an opt-in today
  • number string required The owner's WhatsApp number with its country code, like +15551234567
  • slug string optional The workspace the alerts are for; omit for the caller's own. An agency may name a client it controls
  • consent boolean optional true when the owner ticked the box beside the wording. Anything else is refused with the words to show
  • wordingVersion string optional The version of the wording the owner saw (whatsapp-alert-v1); recorded with the time as the evidence

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • number string
  • state none | pending | subscribed | unsubscribed pending: ticked, waiting for the message from the number
  • configured boolean false: ONE's alert number or the approved template is not set up yet, so the opt-in is refused
  • message string the exact message to send from that number, `ALERTS <code>`
  • link string a wa.me link that opens WhatsApp with that message ready to send
  • wording string consent_required: the words the tick must sit beside
  • wordingVersion string
  • detail string
  • error string forbidden · bad_request · bad_number · no_db · no_secret · consent_required · whatsapp_alerts_not_configured

Traffic

Every call to alerts: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 alerts: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

UI 1
  • one.ie/web/src/components/settings/WhatsappAlertControl.tsx:25
API route 5
  • one.ie/web/src/lib/notify/alert-settings.ts:5
  • one.ie/web/src/lib/notify/whatsapp-alert-optin.ts:97
  • one.ie/web/src/lib/receiver-index.generated.ts:41
  • one.ie/web/src/lib/resolvers/whatsapp.ts:122
  • one.ie/web/src/lib/sms/sms.ts:128
CLI 1
  • packages/cli/src/alerts.ts:37
→

Answered by

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

alerts family · 2 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "enum": [
        "whatsapp"
      ],
      "description": "whatsapp: the only channel with an opt-in today"
    },
    "number": {
      "type": "string",
      "description": "The owner's WhatsApp number with its country code, like +15551234567"
    },
    "slug": {
      "description": "The workspace the alerts are for; omit for the caller's own. An agency may name a client it controls",
      "type": "string"
    },
    "consent": {
      "description": "true when the owner ticked the box beside the wording. Anything else is refused with the words to show",
      "type": "boolean"
    },
    "wordingVersion": {
      "description": "The version of the wording the owner saw (whatsapp-alert-v1); recorded with the time as the evidence",
      "type": "string"
    }
  },
  "required": [
    "channel",
    "number"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "number": {
      "type": "string"
    },
    "state": {
      "description": "pending: ticked, waiting for the message from the number",
      "type": "string",
      "enum": [
        "none",
        "pending",
        "subscribed",
        "unsubscribed"
      ]
    },
    "configured": {
      "description": "false: ONE's alert number or the approved template is not set up yet, so the opt-in is refused",
      "type": "boolean"
    },
    "message": {
      "description": "the exact message to send from that number, `ALERTS <code>`",
      "type": "string"
    },
    "link": {
      "description": "a wa.me link that opens WhatsApp with that message ready to send",
      "type": "string"
    },
    "wording": {
      "description": "consent_required: the words the tick must sit beside",
      "type": "string"
    },
    "wordingVersion": {
      "type": "string"
    },
    "detail": {
      "type": "string"
    },
    "error": {
      "description": "forbidden · bad_request · bad_number · no_db · no_secret · consent_required · whatsapp_alerts_not_configured",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}