# Marketing Messages

Endpoints for marketing message features

## Get Dataset Quality

> Retrieve dataset quality metrics and validation status for conversion tracking. Use the fields parameter to select specific metrics (e.g. web{event\_match\_quality,event\_name}).

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.GetDatasetQualityResponse":{"description":"Response payload containing dataset quality metrics grouped by event source (web, etc.). Use the fields query parameter to select which metrics to return.","properties":{"web":{"items":{"$ref":"#/components/schemas/mm_lite.DatasetQualityEventEntry"},"type":"array","uniqueItems":false}},"type":"object"},"mm_lite.DatasetQualityEventEntry":{"description":"Quality metrics for a specific event, including EMQ, event coverage, deduplication, data freshness, and ACR","properties":{"acr":{"$ref":"#/components/schemas/mm_lite.DatasetQualityACR"},"data_freshness":{"$ref":"#/components/schemas/mm_lite.DatasetQualityDataFreshness"},"dedupe_key_feedback":{"items":{"$ref":"#/components/schemas/mm_lite.DatasetQualityDedupeKey"},"type":"array","uniqueItems":false},"event_coverage":{"$ref":"#/components/schemas/mm_lite.DatasetQualityPercentage"},"event_match_quality":{"$ref":"#/components/schemas/mm_lite.DatasetQualityEMQ"},"event_name":{"type":"string"},"event_potential_aly_acr_increase":{"$ref":"#/components/schemas/mm_lite.DatasetQualityACR"}},"type":"object"},"mm_lite.DatasetQualityACR":{"properties":{"description":{"type":"string"},"percentage":{"type":"number"}},"type":"object"},"mm_lite.DatasetQualityDataFreshness":{"properties":{"description":{"type":"string"},"upload_frequency":{"enum":["real_time","hourly","daily"],"type":"string"}},"type":"object"},"mm_lite.DatasetQualityDedupeKey":{"properties":{"browser_events_with_dedupe_key":{"$ref":"#/components/schemas/mm_lite.DatasetQualityPct"},"dedupe_key":{"type":"string"},"overall_browser_coverage_from_dedupe_key":{"$ref":"#/components/schemas/mm_lite.DatasetQualityPct"},"server_events_with_dedupe_key":{"$ref":"#/components/schemas/mm_lite.DatasetQualityPct"}},"type":"object"},"mm_lite.DatasetQualityPct":{"properties":{"description":{"type":"string"},"percentage":{"type":"number"}},"type":"object"},"mm_lite.DatasetQualityPercentage":{"properties":{"description":{"type":"string"},"goal_percentage":{"type":"number"},"percentage":{"type":"number"},"potential_aly_acr_increase":{"$ref":"#/components/schemas/mm_lite.DatasetQualityACR"}},"type":"object"},"mm_lite.DatasetQualityEMQ":{"description":"Event match quality (EMQ) score and match key feedback","properties":{"composite_score":{"type":"number"},"diagnostics":{"items":{"$ref":"#/components/schemas/mm_lite.DatasetQualityDiagnostic"},"type":"array","uniqueItems":false},"match_key_feedback":{"items":{"$ref":"#/components/schemas/mm_lite.DatasetQualityMatchKey"},"type":"array","uniqueItems":false}},"type":"object"},"mm_lite.DatasetQualityDiagnostic":{"description":"An EMQ diagnostic issue with recommendation","properties":{"affected_event_count":{"type":"integer"},"description":{"type":"string"},"name":{"type":"string"},"percentage":{"type":"number"},"solution":{"type":"string"},"total_event_count":{"type":"integer"}},"type":"object"},"mm_lite.DatasetQualityMatchKey":{"properties":{"coverage":{"$ref":"#/components/schemas/mm_lite.DatasetQualityPct"},"identifier":{"type":"string"},"potential_aly_acr_increase":{"$ref":"#/components/schemas/mm_lite.DatasetQualityACR"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/dataset_quality":{"get":{"description":"Retrieve dataset quality metrics and validation status for conversion tracking. Use the fields parameter to select specific metrics (e.g. web{event_match_quality,event_name}).","operationId":"get-dataset-quality","parameters":[{"description":"Dataset (Pixel) ID to retrieve quality metrics for","in":"query","name":"dataset_id","required":true,"schema":{"type":"string"}},{"description":"Partner agent name to filter quality data by integration source","in":"query","name":"agent_name","schema":{"type":"string"}},{"description":"Fields to return, e.g. web{event_match_quality{composite_score,match_key_feedback{identifier,coverage}},event_coverage,dedupe_key_feedback,data_freshness,acr,event_name}","in":"query","name":"fields","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.GetDatasetQualityResponse"}}},"description":"Dataset quality retrieved successfully"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Permissions error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Dataset Quality","tags":["Marketing Messages"]}}}}
```

## Send Marketing Message (Alternative Route)

> Alternative route for sending marketing messages via /marketing/marketing\_messages endpoint. Used for template-based marketing messages.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.MarketingMessageRequest":{"description":"Request payload to send a marketing message","properties":{"message_activity_sharing":{"type":"boolean"},"messaging_product":{"type":"string"},"product_policy":{"type":"string"},"recipient_type":{"type":"string"},"template":{"$ref":"#/components/schemas/mm_lite.TemplateObject"},"to":{"type":"string"},"type":{"type":"string"}},"type":"object"},"mm_lite.TemplateObject":{"description":"Template object with name, language, and optional components","properties":{"components":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateComponent"},"type":"array","uniqueItems":false},"language":{"$ref":"#/components/schemas/mm_lite.LanguageObject"},"name":{"type":"string"}},"type":"object"},"mm_lite.TemplateComponent":{"properties":{"index":{"type":"integer"},"parameters":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateParameter"},"type":"array","uniqueItems":false},"sub_type":{"enum":["quick_reply","url"],"type":"string"},"type":{"enum":["header","body","button"],"type":"string"}},"type":"object"},"mm_lite.TemplateParameter":{"properties":{"currency":{"$ref":"#/components/schemas/mm_lite.Currency"},"date_time":{"$ref":"#/components/schemas/mm_lite.DateTime"},"document":{"$ref":"#/components/schemas/mm_lite.MediaObject"},"image":{"$ref":"#/components/schemas/mm_lite.MediaObject"},"location":{"$ref":"#/components/schemas/mm_lite.LocationMessage"},"text":{"type":"string"},"type":{"enum":["text","currency","date_time","image","document","video","location"],"type":"string"},"video":{"$ref":"#/components/schemas/mm_lite.MediaObject"}},"type":"object"},"mm_lite.Currency":{"properties":{"amount_1000":{"type":"integer"},"code":{"type":"string"},"fallback_value":{"type":"string"}},"type":"object"},"mm_lite.DateTime":{"properties":{"fallback_value":{"type":"string"}},"type":"object"},"mm_lite.MediaObject":{"properties":{"id":{"type":"string"},"link":{"type":"string"}},"type":"object"},"mm_lite.LocationMessage":{"properties":{"address":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"}},"type":"object"},"mm_lite.LanguageObject":{"properties":{"code":{"type":"string"}},"type":"object"},"mm_lite.MarketingMessageResponse":{"description":"Response payload for a successfully sent marketing message","properties":{"contacts":{"items":{"$ref":"#/components/schemas/mm_lite.MessageContact"},"type":"array","uniqueItems":false},"messages":{"items":{"$ref":"#/components/schemas/mm_lite.MessageResponse"},"type":"array","uniqueItems":false},"messaging_product":{"type":"string"}},"type":"object"},"mm_lite.MessageContact":{"properties":{"input":{"type":"string"},"wa_id":{"type":"string"}},"type":"object"},"mm_lite.MessageResponse":{"properties":{"id":{"type":"string"},"message_status":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/marketing_messages":{"post":{"description":"Alternative route for sending marketing messages via /marketing/marketing_messages endpoint. Used for template-based marketing messages.","operationId":"send-marketing-message-alt","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object"},{"$ref":"#/components/schemas/mm_lite.MarketingMessageRequest","summary":"requestBody","description":"Marketing message payload"}]}}},"description":"Marketing message payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.MarketingMessageResponse"}}},"description":"Marketing message sent successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid request parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Template not approved or insufficient permissions"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Send Marketing Message (Alternative Route)","tags":["Marketing Messages"]}}}}
```

## Get Message Templates

> Retrieve list of WhatsApp message templates for a WhatsApp Business Account.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.GetMessageTemplatesResponse":{"description":"Response payload containing a paginated list of message templates for a WABA","properties":{"data":{"items":{"$ref":"#/components/schemas/mm_lite.GetMessageTemplateResponse"},"type":"array","uniqueItems":false},"paging":{"$ref":"#/components/schemas/mm_lite.MMLitePaging"}},"type":"object"},"mm_lite.GetMessageTemplateResponse":{"description":"Response payload containing template details","properties":{"category":{"type":"string"},"components":{"items":{"$ref":"#/components/schemas/mm_lite.GetTemplateComponent"},"type":"array","uniqueItems":false},"id":{"type":"string"},"language":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"type":"object"},"mm_lite.GetTemplateComponent":{"properties":{"add_security_recommendation":{"type":"boolean"},"buttons":{"items":{"$ref":"#/components/schemas/mm_lite.GetTemplateButton"},"type":"array","uniqueItems":false},"code_expiration_minutes":{"type":"integer"},"format":{"enum":["TEXT","IMAGE","VIDEO","DOCUMENT"],"type":"string"},"text":{"type":"string"},"type":{"enum":["HEADER","BODY","FOOTER","BUTTONS"],"type":"string"}},"type":"object"},"mm_lite.GetTemplateButton":{"properties":{"phone_number":{"type":"string"},"text":{"type":"string"},"type":{"enum":["QUICK_REPLY","URL","PHONE_NUMBER","COPY_CODE"],"type":"string"},"url":{"type":"string"}},"type":"object"},"mm_lite.MMLitePaging":{"properties":{"cursors":{"$ref":"#/components/schemas/mm_lite.MMLitePagingCursors"}},"type":"object"},"mm_lite.MMLitePagingCursors":{"properties":{"after":{"type":"string"},"before":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/message_templates":{"get":{"description":"Retrieve list of WhatsApp message templates for a WhatsApp Business Account.","operationId":"get-mmlite-message-templates","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.GetMessageTemplatesResponse"}}},"description":"Templates retrieved successfully"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Permissions error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Message Templates","tags":["Marketing Messages"]}}}}
```

## Get Template Analytics

> Retrieve analytics data for message templates including delivery and engagement metrics.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.GetTemplateAnalyticsResponse":{"description":"Response payload containing template analytics data","properties":{"id":{"type":"string"},"template_analytics":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateAnalytics"},"type":"array","uniqueItems":false}},"type":"object"},"mm_lite.TemplateAnalytics":{"properties":{"analytics":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateAnalyticsMetric"},"type":"array","uniqueItems":false},"template_id":{"type":"string"}},"type":"object"},"mm_lite.TemplateAnalyticsMetric":{"properties":{"data_points":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateAnalyticsDataPoint"},"type":"array","uniqueItems":false},"granularity":{"type":"string"},"metric_type":{"type":"string"}},"type":"object"},"mm_lite.TemplateAnalyticsDataPoint":{"properties":{"end":{"type":"integer"},"start":{"type":"integer"},"value":{"type":"integer"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/template_analytics":{"get":{"description":"Retrieve analytics data for message templates including delivery and engagement metrics.","operationId":"get-template-analytics","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.GetTemplateAnalyticsResponse"}}},"description":"Template analytics retrieved successfully"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Template Analytics","tags":["Marketing Messages"]}}}}
```

## Enable Template Analytics

> Enable analytics tracking for message templates. Requires enable=true query parameter.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.EnableTemplateAnalyticsResponse":{"description":"Response payload for successful analytics enablement","properties":{"success":{"type":"boolean"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/template_analytics":{"post":{"description":"Enable analytics tracking for message templates. Requires enable=true query parameter.","operationId":"enable-template-analytics","parameters":[{"description":"Must be 'true' to enable analytics","in":"query","name":"enable","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.EnableTemplateAnalyticsResponse"}}},"description":"Template analytics enabled successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - enable=true required"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Enable Template Analytics","tags":["Marketing Messages"]}}}}
```

## Get Ad Object Insights

> Retrieve insights and analytics data for a specific ad object (ad account, campaign, ad set, or ad). Returns performance metrics such as impressions, reach, spend, actions, and more.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.GetAdInsightsResponse":{"description":"Response payload containing ad object analytics and insights data. Fields in each entry depend on the fields query parameter.","properties":{"data":{"items":{"$ref":"#/components/schemas/mm_lite.InsightsDataEntry"},"type":"array","uniqueItems":false},"paging":{"$ref":"#/components/schemas/mm_lite.MMLitePaging"}},"type":"object"},"mm_lite.InsightsDataEntry":{"description":"A single insights data entry. Contains the requested metric fields plus date range. Actual fields vary based on the fields query parameter.","properties":{"account_id":{"description":"Object ID fields (returned when using level param)","type":"string"},"actions":{"description":"Action fields (returned when requested)","items":{"$ref":"#/components/schemas/mm_lite.InsightsAction"},"type":"array","uniqueItems":false},"ad_id":{"type":"string"},"adset_id":{"type":"string"},"campaign_id":{"type":"string"},"clicks":{"type":"string"},"cost_per_action_type":{"items":{"$ref":"#/components/schemas/mm_lite.InsightsAction"},"type":"array","uniqueItems":false},"cost_per_unique_click":{"type":"string"},"cpc":{"type":"string"},"cpm":{"type":"string"},"ctr":{"type":"string"},"date_start":{"description":"Standard fields always returned","type":"string"},"date_stop":{"type":"string"},"frequency":{"type":"string"},"impressions":{"description":"Common metric fields (returned when requested via fields param)","type":"string"},"reach":{"type":"string"},"spend":{"type":"string"},"unique_clicks":{"type":"string"}},"type":"object"},"mm_lite.InsightsAction":{"description":"An action metric with value and optional attribution window breakdowns","properties":{"1d_click":{"type":"string"},"1d_view":{"type":"string"},"action_type":{"type":"string"},"value":{"type":"string"}},"type":"object"},"mm_lite.MMLitePaging":{"properties":{"cursors":{"$ref":"#/components/schemas/mm_lite.MMLitePagingCursors"}},"type":"object"},"mm_lite.MMLitePagingCursors":{"properties":{"after":{"type":"string"},"before":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/{ad_object_id}/insights":{"get":{"description":"Retrieve insights and analytics data for a specific ad object (ad account, campaign, ad set, or ad). Returns performance metrics such as impressions, reach, spend, actions, and more.","operationId":"get-ad-object-insights","parameters":[{"description":"Ad object ID (ad account, campaign, ad set, or ad)","in":"path","name":"ad_object_id","required":true,"schema":{"type":"string"}},{"description":"Comma-separated list of fields to return, e.g. impressions,reach,spend,actions","in":"query","name":"fields","schema":{"type":"string"}},{"description":"Predefined date range, e.g. today, yesterday, last_7d, last_30d, lifetime","in":"query","name":"date_preset","schema":{"type":"string"}},{"description":"JSON time range object, e.g. {\\","in":"query","name":"time_range","schema":{"type":"string"}},{"description":"Aggregate level: account, campaign, adset, ad","in":"query","name":"level","schema":{"type":"string"}},{"description":"JSON array of filter objects, e.g. [{\\","in":"query","name":"filtering","schema":{"type":"string"}},{"description":"Sort order, e.g. reach_descending, impressions_ascending","in":"query","name":"sort","schema":{"type":"string"}},{"description":"Comma-separated breakdowns, e.g. age,gender,country","in":"query","name":"breakdowns","schema":{"type":"string"}},{"description":"Comma-separated action breakdowns, e.g. action_type,action_device","in":"query","name":"action_breakdowns","schema":{"type":"string"}},{"description":"JSON array of attribution windows, e.g. ['1d_click','7d_click','1d_view']","in":"query","name":"action_attribution_windows","schema":{"type":"string"}},{"description":"Use ad-set-level attribution settings to match Ads Manager behavior","in":"query","name":"use_unified_attribution_setting","schema":{"type":"boolean"}},{"description":"Maximum number of results to return","in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.GetAdInsightsResponse"}}},"description":"Ad object insights retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - ad_object_id required or invalid parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Insufficient permissions (ads_read required)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Ad Object Insights","tags":["Marketing Messages"]}}}}
```

## Get Conversion Dataset

> Retrieve conversion dataset information for a Meta node (business account).

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.ConversionDatasetResponse":{"description":"Response payload for conversion dataset operations. The returned id is the dataset_id used for sending events via the Conversions API.","properties":{"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/{meta_node_id}/dataset":{"get":{"description":"Retrieve conversion dataset information for a Meta node (business account).","operationId":"get-conversion-dataset","parameters":[{"description":"Meta node ID","in":"path","name":"meta_node_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.ConversionDatasetResponse"}}},"description":"Conversion dataset retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid parameters or meta_node_id required"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Permissions error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Conversion Dataset","tags":["Marketing Messages"]}}}}
```

## Post Conversion Dataset

> Create or retrieve a conversion dataset for business messaging. Use the relevant business account ID as meta\_node\_id (e.g., WhatsApp Business Account ID).

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.ConversionDatasetRequest":{"description":"Request payload for creating or retrieving a conversion dataset. If a dataset already exists for the business account, the existing dataset_id is returned.","properties":{"name":{"type":"string"}},"type":"object"},"mm_lite.ConversionDatasetResponse":{"description":"Response payload for conversion dataset operations. The returned id is the dataset_id used for sending events via the Conversions API.","properties":{"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/{meta_node_id}/dataset":{"post":{"description":"Create or retrieve a conversion dataset for business messaging. Use the relevant business account ID as meta_node_id (e.g., WhatsApp Business Account ID).","operationId":"post-conversion-dataset","parameters":[{"description":"Meta node ID","in":"path","name":"meta_node_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object"},{"$ref":"#/components/schemas/mm_lite.ConversionDatasetRequest","summary":"requestBody","description":"Conversion dataset payload"}]}}},"description":"Conversion dataset payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.ConversionDatasetResponse"}}},"description":"Conversion dataset posted successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid parameters or meta_node_id required"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Permissions error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Post Conversion Dataset","tags":["Marketing Messages"]}}}}
```

## Post Conversion Events

> Send Conversions API events for business messaging using a dataset ID. Include data with event\_name, event\_time, action\_source=business\_messaging, messaging\_channel, and user\_data (for WhatsApp include whatsapp\_business\_account\_id and ctwa\_clid).

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.ConversionEventRequest":{"description":"Request payload for posting Conversions API events. Send up to 1,000 events per request.","properties":{"data":{"items":{"$ref":"#/components/schemas/mm_lite.ConversionEventData"},"type":"array","uniqueItems":false},"partner_agent":{"type":"string"},"test_event_code":{"type":"string"}},"type":"object"},"mm_lite.ConversionEventData":{"description":"A single Conversions API server event entry","properties":{"action_source":{"enum":["email","website","app","phone_call","chat","physical_store","system_generated","business_messaging","other"],"type":"string"},"custom_data":{"$ref":"#/components/schemas/mm_lite.ConversionCustomData"},"data_processing_options":{"items":{"type":"string"},"type":"array","uniqueItems":false},"data_processing_options_country":{"type":"integer"},"data_processing_options_state":{"type":"integer"},"event_id":{"type":"string"},"event_name":{"type":"string"},"event_source_url":{"type":"string"},"event_time":{"type":"integer"},"messaging_channel":{"enum":["whatsapp","messenger","instagram"],"type":"string"},"opt_out":{"type":"boolean"},"referrer_url":{"type":"string"},"user_data":{"$ref":"#/components/schemas/mm_lite.ConversionUserData"}},"type":"object"},"mm_lite.ConversionCustomData":{"description":"Custom data such as purchase value, currency, content info, and order details","properties":{"content_category":{"type":"string"},"content_ids":{"items":{"type":"string"},"type":"array","uniqueItems":false},"content_name":{"type":"string"},"content_type":{"enum":["product","product_group"],"type":"string"},"contents":{"items":{"$ref":"#/components/schemas/mm_lite.ConversionEventContent"},"type":"array","uniqueItems":false},"currency":{"type":"string"},"num_items":{"type":"integer"},"order_id":{"type":"string"},"search_string":{"type":"string"},"status":{"type":"string"},"value":{"type":"number"}},"type":"object"},"mm_lite.ConversionEventContent":{"description":"A content/product item in the conversion event","properties":{"brand":{"type":"string"},"category":{"type":"string"},"delivery_category":{"enum":["in_store","curbside","home_delivery"],"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"item_price":{"type":"number"},"quantity":{"type":"integer"},"title":{"type":"string"}},"type":"object"},"mm_lite.ConversionUserData":{"description":"Customer information for matching events. Some fields require SHA-256 hashing before sending. Fields vary by event type and action_source.","properties":{"client_ip_address":{"description":"Non-hashed fields","type":"string"},"client_user_agent":{"type":"string"},"country":{"items":{"type":"string"},"type":"array","uniqueItems":false},"ct":{"items":{"type":"string"},"type":"array","uniqueItems":false},"ctwa_clid":{"type":"string"},"db":{"items":{"type":"string"},"type":"array","uniqueItems":false},"em":{"description":"Hashed PII fields (SHA-256)","items":{"type":"string"},"type":"array","uniqueItems":false},"external_id":{"items":{"type":"string"},"type":"array","uniqueItems":false},"fb_login_id":{"type":"string"},"fbc":{"type":"string"},"fbp":{"type":"string"},"fn":{"items":{"type":"string"},"type":"array","uniqueItems":false},"ge":{"items":{"type":"string"},"type":"array","uniqueItems":false},"ig_account_id":{"type":"string"},"ig_sid":{"type":"string"},"lead_id":{"type":"string"},"ln":{"items":{"type":"string"},"type":"array","uniqueItems":false},"page_id":{"description":"Business messaging fields","type":"string"},"page_scoped_user_id":{"type":"string"},"ph":{"items":{"type":"string"},"type":"array","uniqueItems":false},"st":{"items":{"type":"string"},"type":"array","uniqueItems":false},"subscription_id":{"type":"string"},"zp":{"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"mm_lite.ConversionEventResponse":{"description":"Response payload for successfully posted conversion events","properties":{"events_received":{"type":"integer"},"fbtrace_id":{"type":"string"},"messages":{"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/{meta_node_id}/events":{"post":{"description":"Send Conversions API events for business messaging using a dataset ID. Include data with event_name, event_time, action_source=business_messaging, messaging_channel, and user_data (for WhatsApp include whatsapp_business_account_id and ctwa_clid).","operationId":"post-conversion-events","parameters":[{"description":"Meta node ID","in":"path","name":"meta_node_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object"},{"$ref":"#/components/schemas/mm_lite.ConversionEventRequest","summary":"requestBody","description":"Conversion events payload (data with event_name, event_time, action_source, messaging_channel, user_data, custom_data)"}]}}},"description":"Conversion events payload (data with event_name, event_time, action_source, messaging_channel, user_data, custom_data)","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.ConversionEventResponse"}}},"description":"Conversion events posted successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid parameters or meta_node_id required"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Permissions error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Post Conversion Events","tags":["Marketing Messages"]}}}}
```

## Get Message Template

> Retrieve a specific WhatsApp message template by template ID.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.GetMessageTemplateResponse":{"description":"Response payload containing template details","properties":{"category":{"type":"string"},"components":{"items":{"$ref":"#/components/schemas/mm_lite.GetTemplateComponent"},"type":"array","uniqueItems":false},"id":{"type":"string"},"language":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"type":"object"},"mm_lite.GetTemplateComponent":{"properties":{"add_security_recommendation":{"type":"boolean"},"buttons":{"items":{"$ref":"#/components/schemas/mm_lite.GetTemplateButton"},"type":"array","uniqueItems":false},"code_expiration_minutes":{"type":"integer"},"format":{"enum":["TEXT","IMAGE","VIDEO","DOCUMENT"],"type":"string"},"text":{"type":"string"},"type":{"enum":["HEADER","BODY","FOOTER","BUTTONS"],"type":"string"}},"type":"object"},"mm_lite.GetTemplateButton":{"properties":{"phone_number":{"type":"string"},"text":{"type":"string"},"type":{"enum":["QUICK_REPLY","URL","PHONE_NUMBER","COPY_CODE"],"type":"string"},"url":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing/{template_id}":{"get":{"description":"Retrieve a specific WhatsApp message template by template ID.","operationId":"get-message-template","parameters":[{"description":"Template ID","in":"path","name":"template_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.GetMessageTemplateResponse"}}},"description":"Template retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid parameter"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing access token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Permissions error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Message Template","tags":["Marketing Messages"]}}}}
```

## Send Marketing Message

> Send a marketing message via the marketing messages endpoint. Used for template-based marketing messages.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.38.1"},"tags":[{"name":"Marketing Messages","description":"Endpoints for marketing message features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"mm_lite.MarketingMessageRequest":{"description":"Request payload to send a marketing message","properties":{"message_activity_sharing":{"type":"boolean"},"messaging_product":{"type":"string"},"product_policy":{"type":"string"},"recipient_type":{"type":"string"},"template":{"$ref":"#/components/schemas/mm_lite.TemplateObject"},"to":{"type":"string"},"type":{"type":"string"}},"type":"object"},"mm_lite.TemplateObject":{"description":"Template object with name, language, and optional components","properties":{"components":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateComponent"},"type":"array","uniqueItems":false},"language":{"$ref":"#/components/schemas/mm_lite.LanguageObject"},"name":{"type":"string"}},"type":"object"},"mm_lite.TemplateComponent":{"properties":{"index":{"type":"integer"},"parameters":{"items":{"$ref":"#/components/schemas/mm_lite.TemplateParameter"},"type":"array","uniqueItems":false},"sub_type":{"enum":["quick_reply","url"],"type":"string"},"type":{"enum":["header","body","button"],"type":"string"}},"type":"object"},"mm_lite.TemplateParameter":{"properties":{"currency":{"$ref":"#/components/schemas/mm_lite.Currency"},"date_time":{"$ref":"#/components/schemas/mm_lite.DateTime"},"document":{"$ref":"#/components/schemas/mm_lite.MediaObject"},"image":{"$ref":"#/components/schemas/mm_lite.MediaObject"},"location":{"$ref":"#/components/schemas/mm_lite.LocationMessage"},"text":{"type":"string"},"type":{"enum":["text","currency","date_time","image","document","video","location"],"type":"string"},"video":{"$ref":"#/components/schemas/mm_lite.MediaObject"}},"type":"object"},"mm_lite.Currency":{"properties":{"amount_1000":{"type":"integer"},"code":{"type":"string"},"fallback_value":{"type":"string"}},"type":"object"},"mm_lite.DateTime":{"properties":{"fallback_value":{"type":"string"}},"type":"object"},"mm_lite.MediaObject":{"properties":{"id":{"type":"string"},"link":{"type":"string"}},"type":"object"},"mm_lite.LocationMessage":{"properties":{"address":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"}},"type":"object"},"mm_lite.LanguageObject":{"properties":{"code":{"type":"string"}},"type":"object"},"mm_lite.MarketingMessageResponse":{"description":"Response payload for a successfully sent marketing message","properties":{"contacts":{"items":{"$ref":"#/components/schemas/mm_lite.MessageContact"},"type":"array","uniqueItems":false},"messages":{"items":{"$ref":"#/components/schemas/mm_lite.MessageResponse"},"type":"array","uniqueItems":false},"messaging_product":{"type":"string"}},"type":"object"},"mm_lite.MessageContact":{"properties":{"input":{"type":"string"},"wa_id":{"type":"string"}},"type":"object"},"mm_lite.MessageResponse":{"properties":{"id":{"type":"string"},"message_status":{"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/marketing_messages":{"post":{"description":"Send a marketing message via the marketing messages endpoint. Used for template-based marketing messages.","operationId":"send-marketing-message","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object"},{"$ref":"#/components/schemas/mm_lite.MarketingMessageRequest","summary":"requestBody","description":"Marketing message payload"}]}}},"description":"Marketing message payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mm_lite.MarketingMessageResponse"}}},"description":"Marketing message sent successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid request parameters"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing D360-API-KEY"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Template not approved or insufficient permissions"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Send Marketing Message","tags":["Marketing Messages"]}}}}
```
