Send Encrypted Message
Send encrypted messages using JWE (JSON Web Encryption) format. This endpoint provides an additional layer of security on top of existing standard TLS/SSL by accepting pre-encrypted message payloads and returning encrypted responses.
Important Notes:
- Only successful responses will be encrypted
- Error responses will be returned unencrypted if the underlying JSON is incorrectly formatted
- Payload encryption must be enabled for the phone number using the POST /<Phone-Number-ID>/settings endpoint
- The encrypted payload must follow the same structure as the original /messages endpoint
Prerequisites:
- User Access Token with whatsapp_business_messaging permission
- Valid Phone-Number-ID for your registered WhatsApp Business account
- Payload encryption enabled for the phone number
- Properly formatted JWE token containing encrypted message payload using supported algorithms
Supported Algorithms:
- Content Encryption: A128GCM, A256GCM...
Request
- Base URLhttps://graph.facebook.com
- URLhttps://graph.facebook.com/{Version}/{Phone-Number-ID}/messages_encrypted
- AuthHTTP bearer
Path parameters
API version (e.g., v21.0, v22.0)
The ID of the phone number used to send the message. Retrieved from the WhatsApp Business Account.
Headers
The user agent string identifying the client software making the request.
Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.
Media type of the request body
Request body
Example request
{
"messaging_product": "whatsapp",
"encrypted_contents": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhDQkMtSFMyNTYifQ..."
}Response
Encrypted message sent successfully
Example response
{
"encrypted_contents": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhDQkMtSFMyNTYifQ..."
}Changes
No recorded changes to this operation across all 5 revisions of this API.