ONE meta-msg:receive
← Receivers

meta-msg:receive

meta-msg family

Record one inbound Meta event (a Messenger or Instagram message, postback, referral, reaction, comment, mention, seen or echo) against the workspace that connected the account, and say whether the front desk answers it. The workspace is read from accountId's connection row, never the caller; an account with no row is refused (no default workspace for Meta). An eventId is acted on once. A comment is matched against the workspace's comment rules (trigger source meta-msg:comment). Only the channels Meta door, which verified X-Hub-Signature-256 and answered Meta 200, carrying its HMAC over the entry.

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/meta-msg:receive \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "kind": <message | postback | referral | …>, "network": <messenger | instagram>, "accountId": <string>, "eventId": <string>, "from": <object>, "ts": <number>, "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.

  • kind message | postback | referral | … required
  • network messenger | instagram required
  • accountId string required The business side: the Page id or Instagram account id the event arrived on — the workspace is read from it
  • eventId string required The dedupe key: the message mid, the comment id, or a hash of the entry. Acted on once — a replay changes nothing
  • from object required
  • text string optional The message or comment text as received
  • ts number required Epoch ms Meta stamped the event
  • comment object optional kind comment or mention
  • referral object optional kind referral, or a message that opened from an ad or link
  • postback object optional kind postback: the button the person pressed
  • attest string required The channels Meta door's HMAC-SHA256 over meta-receive:v2: the entry's fields plus the SHA-256 of the canonical {comment, referral, postback}; without it nothing is recorded

Response

What comes back from the call.

  • ok boolean
  • workspace string
  • duplicate boolean true: this eventId was already recorded; nothing changed
  • contactId string The contact the person is filed under, created on first contact
  • answer boolean false: an echo, a seen, a replay, a paused thread or a person who opted out — the desk does not answer
  • paused boolean A person replied in this thread recently, so the bot is paused
  • optedOut boolean The person asked to stop; nothing is sent to them
  • error string forbidden (not a service caller) · unattested (no or wrong door HMAC) · unknown_account (no connection row) · bad_request · no_db

Traffic

Every call to meta-msg: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 meta-msg: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 2
  • one.ie/web/src/lib/receiver-index.generated.ts:305
  • one.ie/web/src/lib/resolvers/meta-inbound.ts:275
Agent runtime 2
  • channels/src/meta/door.ts:11
  • channels/src/meta/inbound.ts:253
→

Answered by

meta-msg:receive one.ie/web/src/lib/resolvers/meta-inbound.ts:401 Dispatched through POST /api/ask/meta-msg:receive, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "message",
        "postback",
        "referral",
        "reaction",
        "comment",
        "mention",
        "seen",
        "echo"
      ]
    },
    "network": {
      "type": "string",
      "enum": [
        "messenger",
        "instagram"
      ]
    },
    "accountId": {
      "type": "string",
      "description": "The business side: the Page id or Instagram account id the event arrived on — the workspace is read from it"
    },
    "eventId": {
      "type": "string",
      "description": "The dedupe key: the message mid, the comment id, or a hash of the entry. Acted on once — a replay changes nothing"
    },
    "from": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The person: PSID (Messenger), IGSID (Instagram) or the commenter's id"
        },
        "username": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ]
    },
    "text": {
      "description": "The message or comment text as received",
      "type": "string"
    },
    "ts": {
      "type": "number",
      "description": "Epoch ms Meta stamped the event"
    },
    "comment": {
      "description": "kind comment or mention",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "parentId": {
          "description": "Set on a reply to a comment",
          "type": "string"
        },
        "postId": {
          "type": "string",
          "description": "The post, reel or Live the comment is on (original_media_id for an ad)"
        },
        "adId": {
          "description": "Set when the comment is on an ad",
          "type": "string"
        },
        "adTitle": {
          "type": "string"
        },
        "live": {
          "description": "A Live comment: a private reply may be sent only while the broadcast runs",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "postId"
      ]
    },
    "referral": {
      "description": "kind referral, or a message that opened from an ad or link",
      "type": "object",
      "properties": {
        "ref": {
          "description": "The ?ref= of an m.me or ig.me link",
          "type": "string"
        },
        "source": {
          "description": "ADS, SHORTLINK, …, as Meta sends it",
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "adId": {
          "type": "string"
        },
        "flowId": {
          "type": "string"
        },
        "adsContext": {
          "description": "ads_context_data as Meta sends it"
        }
      }
    },
    "postback": {
      "description": "kind postback: the button the person pressed",
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "payload": {
          "type": "string"
        }
      },
      "required": [
        "payload"
      ]
    },
    "attest": {
      "type": "string",
      "description": "The channels Meta door's HMAC-SHA256 over meta-receive:v2: the entry's fields plus the SHA-256 of the canonical {comment, referral, postback}; without it nothing is recorded"
    }
  },
  "required": [
    "kind",
    "network",
    "accountId",
    "eventId",
    "from",
    "ts",
    "attest"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "workspace": {
      "type": "string"
    },
    "duplicate": {
      "description": "true: this eventId was already recorded; nothing changed",
      "type": "boolean"
    },
    "contactId": {
      "description": "The contact the person is filed under, created on first contact",
      "type": "string"
    },
    "answer": {
      "description": "false: an echo, a seen, a replay, a paused thread or a person who opted out — the desk does not answer",
      "type": "boolean"
    },
    "paused": {
      "description": "A person replied in this thread recently, so the bot is paused",
      "type": "boolean"
    },
    "optedOut": {
      "description": "The person asked to stop; nothing is sent to them",
      "type": "boolean"
    },
    "error": {
      "description": "forbidden (not a service caller) · unattested (no or wrong door HMAC) · unknown_account (no connection row) · bad_request · no_db",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}