ONE telegram:receive
← Receivers

telegram:receive

telegram family

Take in an owner's Telegram reply to a team alert and post it into that conversation's room thread as a staff message by the person the chat is linked to, so the visitor sees it. Only the channels Telegram door, carrying its HMAC over the reply (chat, the message replied to, the reply's own id, its words). The workspace, thread and person are read from the alert's own record and the chat link, never from the request: a reply to anything but a message the bot sent for an alert, from a chat that is no longer linked, or from a link whose workspace does not control the thread's workspace, posts nothing. A reply id is applied 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
no
This cannot be undone. Dry-run it first where the contract allows.
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/telegram:receive \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "chatId": <string>, "replyTo": <number>, "messageId": <number>, "text": <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.

  • chatId string required The Telegram chat the reply came from — a private chat linked for team alerts
  • replyTo number required Telegram's id of the alert message the owner replied to
  • messageId number required Telegram's id of the reply itself: applied once, a redelivery changes nothing
  • text string required The reply as typed
  • attest string required The door's HMAC-SHA256 (SMS_ATTEST_SECRET, else SERVER_SECRET) over chatId, replyTo, messageId and text; without it nothing is posted

Response

What comes back from the call.

  • ok boolean
  • workspace string The workspace the alert was sent for (the chat's link)
  • threadId string The room thread the reply landed in
  • messageId string The stored message; empty on a duplicate
  • duplicate boolean
  • error string forbidden (not a service caller) · unattested · unknown_alert · not_linked · no_thread · not_your_thread · empty · no_db

Traffic

Every call to telegram: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 telegram: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/notify/telegram-reply.ts:5
  • one.ie/web/src/lib/receiver-index.generated.ts:452
  • one.ie/web/src/lib/resolvers/messaging.ts:1173
Agent runtime 1
  • channels/src/telegram-link.ts:225
→

Answered by

telegram:receive one.ie/web/src/lib/resolvers/messaging.ts:1171 Dispatched through POST /api/ask/telegram:receive, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "chatId": {
      "type": "string",
      "description": "The Telegram chat the reply came from — a private chat linked for team alerts"
    },
    "replyTo": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Telegram's id of the alert message the owner replied to"
    },
    "messageId": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Telegram's id of the reply itself: applied once, a redelivery changes nothing"
    },
    "text": {
      "type": "string",
      "description": "The reply as typed"
    },
    "attest": {
      "type": "string",
      "description": "The door's HMAC-SHA256 (SMS_ATTEST_SECRET, else SERVER_SECRET) over chatId, replyTo, messageId and text; without it nothing is posted"
    }
  },
  "required": [
    "chatId",
    "replyTo",
    "messageId",
    "text",
    "attest"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "description": "The workspace the alert was sent for (the chat's link)",
      "type": "string"
    },
    "threadId": {
      "description": "The room thread the reply landed in",
      "type": "string"
    },
    "messageId": {
      "description": "The stored message; empty on a duplicate",
      "type": "string"
    },
    "duplicate": {
      "type": "boolean"
    },
    "error": {
      "description": "forbidden (not a service caller) · unattested · unknown_alert · not_linked · no_thread · not_your_thread · empty · no_db",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}