{"componentChunkName":"component---src-templates-docs-js","path":"/whatsapp/receive_notifications","result":{"data":{"site":{"siteMetadata":{"title":"broadcaster","docsLocation":"https://github.com","docsLocationType":"github","editable":false}},"mdx":{"fields":{"id":"242dda05-b0ce-5834-856f-434a52e1e425","title":"Receive notifications","slug":"/whatsapp/receive_notifications"},"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Receive notifications\",\n  \"order\": 14\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"The platform forwards inbound WhatsApp events \\u2014 messages, delivery statuses, group and Flows events, and calls \\u2014 to your webhook.\"), mdx(\"p\", null, \"The platform sends you the following types of notifications:\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Messages, files, locations, and contacts sent by your customer, in the following scenarios:\", mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"a. In reply to a message sent from your platform.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"b. When your customer starts the conversation.\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Status of the messages you sent. You are notified of one of the following statuses:\", mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"a. Sent: The message was sent successfully.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"b. Delivered: The message was delivered to your customer.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"c. Read: Your customer read the message.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"d. Failed: The message could not be sent to your customer.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"e. Deleted: Your customer deleted the message.\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Contact registration status (see section 2), if the service returned the processing status.\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Group events: group creation and deletion, participant changes, join requests, group settings, and group suspension (see \", mdx(\"a\", {\n    href: \"/whatsapp/administration/groups\"\n  }, \"Groups\"), \").\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Flows events: Flow status changes and alerts for its endpoint (see \", mdx(\"a\", {\n    href: \"/whatsapp/administration/flows\"\n  }, \"Flows\"), \").\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Call events (see \", mdx(\"a\", {\n    href: \"/whatsapp/calling_api\"\n  }, \"Calling API\"), \") and, in general, any other Meta event is forwarded as-is to your webhook.\")), mdx(\"b\", null, \"Considerations:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"You may receive duplicate notifications.\")), mdx(\"p\", null, \"Pages in this section:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/webhook\"\n  }, \"Webhook\"), \": how notifications are delivered and what your webhook must respond.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/messages\"\n  }, \"Message notifications\"), \": general structure and text, audio, document, image, location, video, voice message, sticker, and shared contact messages.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/replies\"\n  }, \"Interactive replies\"), \": quick replies, shopping cart, and WhatsApp Flows replies.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/statuses\"\n  }, \"Status notifications\"), \": status of the messages you sent.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/system\"\n  }, \"User changed phone number\"), \": system notification when the user's phone number or BSUID changes.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/groups\"\n  }, \"Group notifications\"), \": group events and status of messages sent to a group.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/flows\"\n  }, \"Flows notifications\"), \": Flow status changes and alerts.\")), mdx(\"section\", {\n    \"id\": \"usernamesandbsuid\"\n  }, mdx(\"h2\", {\n    parentName: \"section\"\n  }, \"Usernames and BSUID\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"WhatsApp lets users set a \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"username\"), \" (for example, @testusername) that's shown in the app instead of their phone number. Once a user turns it on, their phone number may stop appearing in notifications.\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"So that you can always identify the user, Meta assigns every user a \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"business-scoped user ID (BSUID)\"), \":\"), mdx(\"ul\", {\n    parentName: \"section\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Meta generates it automatically, and it's \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"always included\"), \" in messaging notifications, whether or not the user has a username.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Format: an ISO 3166 alpha-2 country code, a dot, and up to 128 alphanumeric characters. For example, US.13491208655302741918.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"It's only valid for business phone numbers in the same business portfolio. If you use a BSUID with a number from another portfolio, the message isn't delivered.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"If the user changes their phone number, their BSUID is regenerated and you receive a system notification (see \", mdx(\"a\", {\n    href: \"/whatsapp/receive_notifications/system#h-userchangedphonenumber\"\n  }, \"User changed phone number\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"If the business has linked portfolios, you also receive a \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"parent BSUID\"), \" (parent_user_id), for example, US.ENT.506847293015824.\"))), mdx(\"section\", {\n    \"id\": \"usernamesandbsuid--whenthephonenumberisincluded\"\n  }, mdx(\"h3\", {\n    parentName: \"section\"\n  }, \"When the phone number is included\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"If the user doesn't have a username, you always receive both their phone number and their BSUID. If they do have one, the phone number is only included when at least one of these is true:\"), mdx(\"ul\", {\n    parentName: \"section\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"The business messaged or called the user's phone number in the last 30 days.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"The user messaged or called the business in the last 30 days.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"The user is in the business's contact book.\")), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"These conditions are evaluated for each business phone number.\")), mdx(\"section\", {\n    \"id\": \"usernamesandbsuid--howtoidentifytheuser\"\n  }, mdx(\"h3\", {\n    parentName: \"section\"\n  }, \"How to identify the user\"), mdx(\"ul\", {\n    parentName: \"section\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Incoming messages:\"), \" use \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"from\"), \" (phone number) if it's present; otherwise, use \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"from_user_id\"), \" (BSUID).\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Status of sent messages:\"), \" use \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"recipient_id\"), \" (phone number) if it's present; otherwise, use \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"recipient_user_id\"), \" (BSUID).\")), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"Store the BSUID from the first message so you can keep identifying the user even if they turn on a username or change their number.\")), mdx(\"section\", {\n    \"id\": \"usernamesandbsuid--sendingmessageswithabsuid\"\n  }, mdx(\"h3\", {\n    parentName: \"section\"\n  }, \"Sending messages with a BSUID\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"to\"), \" field accepts either a phone number or a BSUID; the service detects which one you're using. Use the phone number when you know it, and the BSUID when the user doesn't share their number.\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"You can't use a BSUID with one-tap, zero-tap or copy code authentication templates; those require a phone number.\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#usernames-and-bsuid","title":"Usernames and BSUID","items":[{"url":"#when-the-phone-number-is-included","title":"When the phone number is included"},{"url":"#how-to-identify-the-user","title":"How to identify the user"},{"url":"#sending-messages-with-a-bsuid","title":"Sending messages with a BSUID"}]}]},"timeToRead":2,"parent":{"__typename":"File","relativePath":"whatsapp/receive_notifications.md","fields":{"gitLogLatestAuthorName":"Irais Aguirre","gitLogLatestAuthorEmail":"irais.aguirre@conceptomovil.com","gitLogLatestDate":"6 hours ago"}},"frontmatter":{"metaTitle":null,"showMetadata":null,"editable":null,"showPreviousNext":null,"showToc":null}},"gitBranch":{"name":"20211019-2FACTOR_AUTH"},"gitCommit":{"hash":"9713e1925aeb8cad930f91b6bf05d0b5937b2bb5","date":"2026-11-13 06:39"}},"pageContext":{"id":"242dda05-b0ce-5834-856f-434a52e1e425"}},"staticQueryHashes":["12478684","12478684","2882937274","2882937274","353167761","353167761"]}