ONE alerts:get
← Receivers

alerts:get

alerts family

mcp

Read who a workspace's human-ask alerts reach: the setting, the ladder (workspace then agency) and suggested contacts; with channel whatsapp, the state of one owner's WhatsApp opt-in

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:get \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "slug": <string>, "channel": <whatsapp>, "number": <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.

  • slug string optional the workspace to read (required for the recipient list); with channel whatsapp, omit for the caller's own — an agency may name a client it controls
  • channel whatsapp optional omit: the recipient list · whatsapp: the state of one number's opt-in to alerts on WhatsApp
  • number string optional channel whatsapp only: the owner's WhatsApp number with its country code, like +15551234567

Response

What comes back from the call.

  • ok boolean
  • slug string
  • setting object what the owner set; empty = derived from members, owner email and business contact
  • ladder object[] rung 0 is the workspace; each next rung is the agency above it; the climb stops at the first rung that reached a person
  • suggested object contacts found in the pasted company text — offered, never used to send
  • 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 — none: never asked · pending: ticked, waiting for the message from the number · subscribed: on · unsubscribed: off (STOP or off)
  • configured boolean channel whatsapp — false: ONE's alert number or the approved template is not set up yet, so alerts:create is refused
  • detail string
  • error string missing_slug · forbidden · no_db · channel whatsapp: bad_request · bad_number

Traffic

Every call to alerts:get, 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:get, 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 4
  • one.ie/web/src/lib/notify/alert-settings.ts:2
  • one.ie/web/src/lib/notify/team-alert.ts:252
  • one.ie/web/src/lib/receiver-index.generated.ts:42
  • one.ie/web/src/lib/resolvers/whatsapp.ts:122
CLI 1
  • packages/cli/src/alerts.ts:37
→

Answered by

alerts:get Resolved outside this repo — the pay, channels or api worker answers it. Dispatched through POST /api/ask/alerts:get, 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 read (required for the recipient list); with channel whatsapp, omit for the caller's own — an agency may name a client it controls",
      "type": "string"
    },
    "channel": {
      "description": "omit: the recipient list · whatsapp: the state of one number's opt-in to alerts on WhatsApp",
      "type": "string",
      "enum": [
        "whatsapp"
      ]
    },
    "number": {
      "description": "channel whatsapp only: the owner's WhatsApp number with its country code, like +15551234567",
      "type": "string"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "slug": {
      "type": "string"
    },
    "setting": {
      "description": "what the owner set; empty = derived from members, owner email and business contact",
      "type": "object",
      "properties": {
        "emails": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "phones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "emails",
        "phones"
      ]
    },
    "ladder": {
      "description": "rung 0 is the workspace; each next rung is the agency above it; the climb stops at the first rung that reached a person",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "setting",
                    "member",
                    "recovery",
                    "account",
                    "business"
                  ]
                }
              },
              "required": [
                "address",
                "source"
              ]
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "devices": {
            "type": "number",
            "description": "subscribed push devices — a count, never an endpoint"
          }
        },
        "required": [
          "slug",
          "emails",
          "phones",
          "devices"
        ]
      }
    },
    "suggested": {
      "description": "contacts found in the pasted company text — offered, never used to send",
      "type": "object",
      "properties": {
        "emails": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "phones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "emails",
        "phones"
      ]
    },
    "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 — none: never asked · pending: ticked, waiting for the message from the number · subscribed: on · unsubscribed: off (STOP or off)",
      "type": "string",
      "enum": [
        "none",
        "pending",
        "subscribed",
        "unsubscribed"
      ]
    },
    "configured": {
      "description": "channel whatsapp — false: ONE's alert number or the approved template is not set up yet, so alerts:create is refused",
      "type": "boolean"
    },
    "detail": {
      "type": "string"
    },
    "error": {
      "description": "missing_slug · forbidden · no_db · channel whatsapp: bad_request · bad_number",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}