Encrypted Messages

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...
post/{Version}/{Phone-Number-ID}/messages_encrypted

Request

  • Base URL
    https://graph.facebook.com
  • URL
    https://graph.facebook.com/{Version}/{Phone-Number-ID}/messages_encrypted
  • Auth
    HTTP bearer

Path parameters

Versionstring required
Example:v22.0

API version (e.g., v21.0, v22.0)

Phone-Number-IDstring required
Example:1234567890123456

The ID of the phone number used to send the message. Retrieved from the WhatsApp Business Account.

Headers

User-Agentstring
Example:Meta-Business-Messaging-OpenAPI/1.0.0;spec=2025-10-21

The user agent string identifying the client software making the request.

Authorizationstring required
Example:Bearer EAABwzLixnjYBOzYmNMJJGfHq9DgNh...

Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.

Content-Type'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' required
Example:application/json

Media type of the request body

Request body

messaging_product'whatsapp' required

Messaging service used for the request. Use whatsapp.

encrypted_contentsstring required

JWE payload with encrypted messages structure. This should be a valid JWE token containing the encrypted message payload.

Example request

{
  "messaging_product": "whatsapp",
  "encrypted_contents": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhDQkMtSFMyNTYifQ..."
}

Response

Encrypted message sent successfully

encrypted_contentsstring required

JWE payload with encrypted messages response structure. Contains the encrypted response from the WhatsApp Business API.

Example response

{
  "encrypted_contents": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhDQkMtSFMyNTYifQ..."
}

Changes

No recorded changes to this operation across all 5 revisions of this API.