WhatsApp Notifications
Account Setup
Section titled “Account Setup”Meta’s WhatsApp Cloud API setup is split across two separate portals: Meta Business Manager for managing System Users and permanent tokens, and the Meta Developer Dashboard for creating your app and finding your Phone Number ID.
- Create a Meta Business Manager Account Go to Meta Business Manager and log in or create an account. Your WhatsApp Business Account (WABA) and System Users are managed here.
- Create a Meta Developer Account and App Go to Meta for Developers and log in or create an account. Create a new app using the Business app type, then add WhatsApp as a product. If prompted on the home page, click Customise Use Case and select the Connect to Customers (WhatsApp) use case to reach the Cloud API setup.
- Generate a Permanent Access Token via Business Manager
- In Meta Business Manager, go to Settings > Users > System Users.
- Create a System User (Admin or Employee role).
- Click Add Assets, select your WhatsApp app, and enable the
whatsapp_business_messagingpermission (and optionallywhatsapp_business_management). - Click Generate Token, select your app, confirm the permissions, and copy the resulting token. This permanent token does not expire unless revoked and is used in the Apprise
tokenfield.
- Locate Your
From Phone Number IDSwitch back to the Meta Developer Dashboard, open your app, then navigate to WhatsApp > API Setup (or Getting Started). Your registered sender number and its Phone Number ID are listed there. This ID is not your actual phone number — it is a separate numeric ID (roughly 14 digits) assigned by Meta. - Register Your Recipient Number(s)
- During sandbox testing, you must verify any phone number you wish to message through Meta’s interface.
- For production, your business must be verified and placed on the appropriate messaging tier.
- (Optional) Create and Approve Message Templates
- Navigate to WhatsApp > Message Templates in the Developer Dashboard, or use the WhatsApp Manager in Business Manager.
- Create a template (e.g.,
hello_world) and await approval. - Templates allow structured messaging with variables (e.g.,
{{1}},{{2}}) and can be used with Apprise’stemplate:prefix. This is explained further below.
Once everything is in place, you’re ready to send WhatsApp messages through Apprise.
Syntax
Section titled “Syntax”Valid syntax is as follows:
whatsapp://{token}@{from_phone_id}/{targets}whatsapp://{template}:{token}@{from_phone_id}/{targets}
Targets may be phone numbers, group IDs, or a mix of both:
+{phone}— E.164 phone number (the+prefix is required; bare digits are also accepted)#{group_id}— WhatsApp group ID (numeric,#prefix required)
Parameter Breakdown
Section titled “Parameter Breakdown”| Variable | Required | Description |
|---|---|---|
| token | Yes | This is the Access Token associated with your Meta WhatsApp App |
| from | Yes | This is the From Phone ID associated with your Meta WhatsApp App; this isn’t to be confused with your actual phone number. The ID is a separate assignment (about 14 digits long) |
| targets | Yes | One or more recipients — phone numbers (+{phone} or @{phone}) and/or group IDs (#{group_id}). At least one target must be provided. |
| template | No | You can optionally specify a template_name here (such as hello_world which is the default one created once you set yourself up your Meta App). This causes Apprise to pull from your template defined. |
| lang | No | If you’ve defined a template to reference, you can optionally over-ride the default language of en_US to reference a different version of the template specified. |
Global Parameters
Section titled “Global Parameters”| Variable | Description |
|---|---|
| overflow | This parameter can be set to either split, truncate, or upstream. This determines how Apprise delivers the message you pass it. By default this is set to upstream 👉 upstream: Do nothing at all; pass the message exactly as you received it to the service.👉 truncate: Ensure that the message will fit within the service’s documented upstream message limit. If more information was passed then the defined limit, the overhead information is truncated.👉 split: similar to truncate except if the message doesn’t fit within the service’s documented upstream message limit, it is split into smaller chunks and they are all delivered sequentially there-after. |
| format | This parameter can be set to either text, html, or markdown. Some services support the ability to post content by several different means. The default of this varies (it can be one of the 3 mentioned at any time depending on which service you choose). You can optionally force this setting to stray from the defaults if you wish. If the service doesn’t support different types of transmission formats, then this field is ignored. |
| verify | External requests made to secure locations (such as through the use of https) will have certificates associated with them. By default, Apprise will verify that these certificates are valid; if they are not then no notification will be sent to the source. In some occasions, a user might not have a certificate authority to verify the key against or they trust the source; in this case you will want to set this flag to no. By default it is set to yes. |
| redirect | By default, Apprise will follow HTTP redirects (3xx responses) issued by the remote server, matching the behaviour of the underlying requests library. If you want to prevent custom headers and credentials from being forwarded to destinations that differ from the original URL, set this to no. By default it is set to yes. |
| cto | This stands for Socket Connect Timeout. This is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. The default value is 4.0 seconds. |
| rto | This stands for Socket Read Timeout. This is the number of seconds the client will wait for the server to send a response. The default value is 4.0 seconds. |
| emojis | Enable Emoji support (such as providing :+1: would translate to 👍). By default this is set to no. Note: Depending on server side settings, the administrator has the power to disable emoji support at a global level; but default this is not the case. |
| tz | Identify the IANA Time Zone Database you wish to operate as. By default this is detected based on the configuration the server hosting Apprise is running on. You can set this to things like America/Toronto, or any other properly formated Timezone describing your area. |
| retry | The number of additional delivery attempts to make after the first failure before giving up. Accepts an integer in the range 0 to 10. The default is 0 (no retries — a single attempt is made). When combined with wait, Apprise pauses the specified number of seconds between each attempt. |
| wait | The number of seconds to pause between retry attempts. Accepts a decimal value in the range 0.0 to 20.0; integer values are promoted to float automatically. The default is 0.5. This value is only meaningful when retry is greater than zero — a service with retry=0 makes exactly one attempt regardless of the wait value. |
| optional | When set to yes, a delivery failure for this service is silently absorbed. The overall notify() call still returns True even if this endpoint was unreachable, provided that every required (non-optional) service in the same batch succeeded. Setting this flag does not skip delivery or bypass retry logic — all configured retry attempts are still made before the failure is absorbed. By default this is set to no, meaning every failure is propagated to the caller. |
Template Variables
Section titled “Template Variables”The templates you generate allow you to specify {{1}} and {{2}}, etc which are substituted during the Apprise runtime. To pre-set these values, simply leverage the : (colon) prefix in front of the index you wish to define.
?:3=My Value for example would assign My Value to {{3}} during the runtime. You must identify all indexes defined or you will get an error from the upstream server.
If you wish to assign the body or type from Apprise, these special keywords are specified instead with the : (colon) prefix providing the mapping/over-ride. For example: ?:body=1 would be accepted and would assign {{1}} the contents of the body passed into Apprise.
Examples
Section titled “Examples”Send a WhatsApp Notification to a group:
# Send a message to a phone number:apprise -b "Test Message" \ "whatsapp://token@from_phone_id/+14155552671/"
# Send a message to a WhatsApp group (requires a qualifying Meta tier):apprise -b "Test Message" \ "whatsapp://token@from_phone_id/#120363043968066561"
# Send to a phone number and a group in the same call:apprise -b "Test Message" \ "whatsapp://token@from_phone_id/+14155552671/#120363043968066561"
# The original form still works (bare phone digits without a '+'):apprise -b "Test Message" \ "whatsapp://token@from_phone_id/to_phone_no/"
# Templates can be handled like so:apprise -b "Test Message" \ "whatsapp://template_name:token@from_phone_id/to_phone_no/"
# If you have defined {{1}} and {{2}} tokens, you can assign them values like so:apprise -b "Test Message" \ "whatsapp://template_name:token@from_phone_id/to_phone_no/?:1=the data i want put here&:2=more data here"
# The :<id> is how you map {{<id>}}elements. If you want to associated the body or# message type with an id, then there are 2 reserved keywords that you can use for this:# The below would make sure the Apprise Body value would be placed in the {{1}} element:apprise -b "Test Message" \ "whatsapp://template_name:token@from_phone_id/to_phone_no/?:body=1"
# You can mix and match the keywords and types:apprise -b "Test Message" \ "whatsapp://template_name:token@from_phone_id/to_phone_no/?:body=2&:type=3&1:MyID1Value"
# It's up to the developer to make sure that all of the {{1}}, {{2}}, etc are assigned correctly Questions or Feedback?
Technical Issues
Having trouble with the code? Open an issue on GitHub: