whatsapp_business_messaging permission










creative_features_spec object to specify which optimizations you want to enable (“opt-in”) or disable (“opt-out”) on a given template. To do this, set each optimization’s enroll_status property to either OPT_IN or OPT_OUT upon template creation, or when editing an existing template.POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates { "name": "<TEMPLATE_NAME>", "language": "<TEMPLATE_LANGUAGE_AND_LOCALE_CODE>", "components": [<TEMPLATE_COMPONENTS>], "degrees_of_freedom_spec": { "creative_features_spec": { "image_brightness_and_contrast": { "enroll_status": "OPT_OUT" }, "image_touchups": { "enroll_status": "OPT_IN" }, "add_text_overlay": { "enroll_status": "OPT_OUT" }, "image_animation": { "enroll_status": "OPT_IN" }, "image_background_gen": { "enroll_status": "OPT_IN" }, "auto_promotion_tag": { "enroll_status": "OPT_IN" }, "text_extraction_for_headline": { "enroll_status": "OPT_IN" }, "text_extraction_for_tap_target": { "enroll_status": "OPT_IN" }, "product_extensions": { "enroll_status": "OPT_OUT" }, "text_formatting_optimization": { "enroll_status": "OPT_OUT" } } } }
GET /<TEMPLATE_ID>?fields=degrees_of_freedom_spec
{ "degrees_of_freedom_spec": { "creative_features_spec": [ { "key": "IMAGE_BRIGHTNESS_AND_CONTRAST", "value": { "enroll_status": "OPT_OUT" } }, { "key": "IMAGE_TOUCHUPS", "value": { "enroll_status": "OPT_OUT" } }, { "key": "ADD_TEXT_OVERLAY", "value": { "enroll_status": "OPT_IN" } }, { "key": "IMAGE_ANIMATION", "value": { "enroll_status": "OPT_OUT" } }, { "key": "IMAGE_BACKGROUND_GEN", "value": { "enroll_status": "OPT_OUT" } }, { "key": "AUTO_PROMOTION_TAG", "value": { "enroll_status": "OPT_OUT" } }, { "key": "TEXT_EXTRACTION_FOR_HEADLINE", "value": { "enroll_status": "OPT_OUT" } }, { "key": "TEXT_EXTRACTION_FOR_TAP_TARGET", "value": { "enroll_status": "OPT_OUT" } }, { "key": "PRODUCT_EXTENSIONS", "value": { "enroll_status": "OPT_IN" } }, { "key": "TEXT_FORMATTING_OPTIMIZATION", "value": { "enroll_status": "OPT_IN" } } ] }, "id": "123456789" }
creative_features_spec object to specify which optimizations you want to enable (“opt-in”) or disable (“opt-out”) for the entire WhatsApp Business Account. To do this, set each optimization’s enroll_status property that you wish to modify to either OPT_IN or OPT_OUT.POST /<WHATSAPP_BUSINESS_ACCOUNT_ID> { "degrees_of_freedom_spec": { "creative_features_spec": { "image_touchups": { "enroll_status": "OPT_IN" }, "image_animation": { "enroll_status": "OPT_IN" }, "image_brightness_and_contrast": { "enroll_status": "OPT_IN" }, "add_text_overlay": { "enroll_status": "OPT_IN" }, "image_background_gen": { "enroll_status": "OPT_IN" }, "auto_promotion_tag": { "enroll_status": "OPT_IN" }, "text_extraction_for_headline": { "enroll_status": "OPT_IN" }, "product_extensions": { "enroll_status": "OPT_IN" }, "text_extraction_for_tap_target": { "enroll_status": "OPT_IN" }, "text_formatting_optimization": { "enroll_status": "OPT_OUT" } } } }
GET /<WHATSAPP_BUSINESS_ACCOUNT_ID>?fields=degrees_of_freedom_spec
{ "degrees_of_freedom_spec": { "data": [ { "creative_features_spec": [ { "image_brightness_and_contrast": "OPT_IN", "image_touchups": "OPT_IN", "add_text_overlay": "OPT_IN", "image_animation": "OPT_IN", "image_background_gen": "OPT_IN", "auto_promotion_tag": "OPT_IN", "text_extraction_for_headline": "OPT_IN", "product_extensions": "OPT_IN", "text_extraction_for_tap_target": "OPT_IN", "text_formatting_optimization": "OPT_IN" } ] } ] }, "id": "1234567890" }
/marketing_messages endpoint supports only marketing template messages for MM API for WhatsApp and Cloud API. All other message types (freeform, Authentication, Service, Utility) are not supported, and will produce an error.product_policy to STRICT./messages endpoint to send marketing messages through the Cloud API, unless you have disabled marketing messages on Cloud API.| Endpoint | Authentication |
|---|---|
/PHONE_NUMBER_ID/marketing_messages | Developers can authenticate their API calls with the access token generated in the App Dashboard > WhatsApp > API Setup. If you are a business messaging service provider, you must authenticate with an access token with the whatsapp_business_messaging permission. |
POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/marketing_messages { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<WHATSAPP_USER_PHONE_NUMBER>", "type": "<MESSAGE_TYPE>", "<MESSAGE_TYPE>": { <MESSAGE_CONTENTS> }, <!-- Optional --> "product_policy": "<PRODUCT_POLICY>", "message_activity_sharing": <SHARE_MESSAGING_ACTIVITY?> }
product_policy to CLOUD_API_FALLBACK to have the API send the outgoing message via Cloud API, if onboarding requirements have not been met. Set to STRICT if you do not want the API to fallback to sending the message via Cloud API.message_activity_sharing is an optional parameter at the message level that enables or disables sharing message activities (for example, message read) for that specific marketing message to Meta to help optimize marketing messages. If this parameter is not provided, the default WABA-level setting will be applied. You can always edit your default setting in Business Settings (see Changelog for a screenshot of this).curl 'https://graph.facebook.com/<API_VERSION>/<BUSINESS_PHONE_NUMBER_ID>/marketing_messages' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>' \ -d ' { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<USER_PHONE_NUMBER>", "recipient": "<BSUID>", "type": "template", "template": { <EXPECTED_TEMPLATE_PARAMETERS> } }'
| Field | Change | Description |
|---|---|---|
to | Now optional | WhatsApp user phone number (individual) or group ID (group). If provided, takes precedence over recipient. |
recipient | New (optional) | User BSUID or parent BSUID for individual messages. Used only when to is omitted. |
to or recipient must be provided. Requests omitting both fail.to (phone number) is used for processing and delivery, and recipient is ignored.user_id field and changes the semantics of input and wa_id:{ "messaging_product": "whatsapp", "contacts": [ { "input": "<USER_PHONE_NUMBER_OR_BSUID>", "wa_id": "<USER_PHONE_NUMBER>", "user_id": "<BSUID>" } ], "messages": [ { "id": "<WHATSAPP_MESSAGE_ID>" } ] }
| Field | Description |
|---|---|
input | The user’s phone number if the message was sent by phone number, the user’s BSUID (or parent BSUID) if sent by BSUID, or the group ID if sent to a group. |
wa_id | The user’s phone number. Omitted when the message was sent using a BSUID. |
user_id | The user’s BSUID (or parent BSUID) when the message was sent using a BSUID. Omitted when only a phone number is provided or when both phone number and BSUID are provided. |
{ "messaging_product": "whatsapp", "contacts": [ { "input": "+16505551234", "wa_id": "16505551234" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] }
{ "messaging_product": "whatsapp", "contacts": [ { "input": "US.13491208655302741918", "user_id": "US.13491208655302741918" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] }
{ "error": { "message": "The parameter to is required.", "type": "OAuthException", "code": 100, "fbtrace_id": "ANPlYYIqhnaWG-FIJ-rABkS" } }
bid_spec) is not supported with BSUID recipients. Sending a marketing template that includes bid_spec to a BSUID recipient returns error 131062. To use bid_spec, send to the user’s phone number, or use a template without bid_spec.131062 — BSUID recipients not supported for this message| Field | Value |
|---|---|
Code | 131062 |
Type | OAuthException |
Message | “Business-scoped User ID (BSUID) recipients are not supported for this message.” |
bid_spec (dynamic pricing) and the recipient is a BSUID.{ "error": { "message": "(#131062) Business-scoped User ID (BSUID) recipients are not supported for this message.", "type": "OAuthException", "code": 131062, "error_data": { "messaging_product": "whatsapp", "details": "The template specified in the request uses bid_spec, which is not supported for Business-scoped user ID (BSUID) recipients. To send this template, please provide the phone number of recipients or use a template without the bid_spec field." } } }
/messages endpoint. When this option is activated, the /messages endpoint rejects Marketing category templates. You can decide whether to send marketing messages through the /marketing_messages endpoint or disable this option./marketing_messages.POST /<WHATSAPP_BUSINESS_ACCOUNT_ID> { "disable_marketing_messages_on_cloud_api": true | false }
disable_marketing_messages_on_cloud_api to true to block Marketing category templates on the Cloud API /messages endpoint. Set to false to allow Marketing category templates on Cloud API (default).curl 'https://graph.facebook.com/v25.0/102290129340398' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"disable_marketing_messages_on_cloud_api": true
}'
{ "id": "102290129340398" }
GET /<WHATSAPP_BUSINESS_ACCOUNT_ID>?fields=disable_marketing_messages_on_cloud_api
{ "disable_marketing_messages_on_cloud_api": true, "id": "102290129340398" }
disable_marketing_messages_on_cloud_api is set to true and you attempt to send a Marketing category template through the Cloud API /messages endpoint, the API returns the following error:{ "error": { "message": "(#131063) Marketing templates disabled for Cloud API", "type": "OAuthException", "code": 131063, "error_data": { "messaging_product": "whatsapp", "details": "Your template is categorized as Marketing, but marketing templates are currently disabled for your Cloud API configuration. To send this template, use the Marketing Messages API for WhatsApp or enable marketing templates on Cloud API by turning off disable_marketing_messages_on_cloud_api." }, "fbtrace_id": "ABzNMWIqsLJ7hbj8xd5ytay" } }
/marketing_messagesdisable_marketing_messages_on_cloud_api is set to true, the fallback to Cloud API for the /marketing_messages endpoint is also affected:/marketing_messages endpoint works normally. No change in behavior./marketing_messages would normally fall back to Cloud API, but the fallback is now rejected with error 131063 because the opt-in blocks marketing templates on Cloud API.product_policy is set to STRICT, no fallback to Cloud API is attempted regardless of the disable_marketing_messages_on_cloud_api setting. The fallback behavior described above only applies when product_policy is set to the default of CLOUD_API_FALLBACK./messages endpoint, set disable_marketing_messages_on_cloud_api to false:curl 'https://graph.facebook.com/v25.0/102290129340398' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"disable_marketing_messages_on_cloud_api": false
}'
/messages endpoint again.pricing.category and conversation.type set to marketing_lite. If the message is routed via Cloud API, pricing.category will be set to marketing.{
"conversation": {
"id": "<CONVERSATION_ID>",
"origin": {
"type": "marketing_lite"
}
},
"pricing": {
"billable": true,
"pricing_model": "PMP",
"category": "marketing_lite"
}
}