ONE alerts:update
← Receivers

alerts:update

alerts family

mcp

Set the emails and phones a workspace's human-ask alerts go to (workspace owner or the agency above it); with channel whatsapp and off, turn one number's WhatsApp alerts off

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
update_group
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/alerts:update \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "slug": "howardroofing", "emails": [ "admin@howardroofingconstruction.com" ] }}'

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.

  • slug string optional the workspace to set (required for the recipient list); with channel whatsapp, omit for the caller's own
  • emails string[] optional up to 5 deliverable addresses; replaces the stored list; omit to keep it
  • phones string[] optional up to 3 numbers in E.164 (+15551234567); replaces the stored list; omit to keep it. A text goes out only when a Twilio number is connected
  • clear boolean optional true: empty the setting, back to the derived team
  • channel whatsapp optional whatsapp: change one number's opt-in instead of the recipient list
  • number string optional channel whatsapp only: the owner's WhatsApp number with its country code
  • off boolean optional channel whatsapp only: true turns alerts off for the number (STOP from the number does the same, and a later START does not turn them back on)

Response

What comes back from the call.

  • ok boolean
  • slug string
  • setting object
  • rejected string[] inputs that were not a deliverable address or an E.164 number
  • workspace string channel whatsapp: the workspace the opt-in is for
  • number string channel whatsapp: the number, normalised
  • state none | pending | subscribed | unsubscribed channel whatsapp: the number's state after the change
  • detail string
  • error string missing_slug · forbidden · nothing_to_set · no_valid_email · no_valid_phone · unavailable_until_migration_0433 · channel whatsapp: bad_request · bad_number

Traffic

Every call to alerts:update, 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:update, 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:3
  • one.ie/web/src/lib/notify/whatsapp-alert-optin.ts:124
  • one.ie/web/src/lib/receiver-index.generated.ts:43
  • 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:update Resolved outside this repo — the pay, channels or api worker answers it. Dispatched through POST /api/ask/alerts:update, after the envelope validates the payload.

alerts family · 2 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "slug": {
      "description": "the workspace to set (required for the recipient list); with channel whatsapp, omit for the caller's own",
      "type": "string"
    },
    "emails": {
      "description": "up to 5 deliverable addresses; replaces the stored list; omit to keep it",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "phones": {
      "description": "up to 3 numbers in E.164 (+15551234567); replaces the stored list; omit to keep it. A text goes out only when a Twilio number is connected",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "clear": {
      "description": "true: empty the setting, back to the derived team",
      "type": "boolean"
    },
    "channel": {
      "description": "whatsapp: change one number's opt-in instead of the recipient list",
      "type": "string",
      "enum": [
        "whatsapp"
      ]
    },
    "number": {
      "description": "channel whatsapp only: the owner's WhatsApp number with its country code",
      "type": "string"
    },
    "off": {
      "description": "channel whatsapp only: true turns alerts off for the number (STOP from the number does the same, and a later START does not turn them back on)",
      "type": "boolean"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "slug": {
      "type": "string"
    },
    "setting": {
      "type": "object",
      "properties": {
        "emails": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "phones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "emails",
        "phones"
      ]
    },
    "rejected": {
      "description": "inputs that were not a deliverable address or an E.164 number",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "workspace": {
      "description": "channel whatsapp: the workspace the opt-in is for",
      "type": "string"
    },
    "number": {
      "description": "channel whatsapp: the number, normalised",
      "type": "string"
    },
    "state": {
      "description": "channel whatsapp: the number's state after the change",
      "type": "string",
      "enum": [
        "none",
        "pending",
        "subscribed",
        "unsubscribed"
      ]
    },
    "detail": {
      "type": "string"
    },
    "error": {
      "description": "missing_slug · forbidden · nothing_to_set · no_valid_email · no_valid_phone · unavailable_until_migration_0433 · channel whatsapp: bad_request · bad_number",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}