Skip to main content
Version: Latest

WhatsApp template analytics and comparison

Use an Application API key in x-api-key. Find the channel and internal template UUIDs through the template listing endpoint. Provider template IDs, app credentials and WABA IDs are resolved by Hub and are not API inputs. Both resources support connected WhatsApp channels; sandbox analytics are unavailable.

Template analytics​

curl --get 'https://app.chatt2.me/v1/communication/channel/whatsapp/templates/CHANNEL_UUID/TEMPLATE_UUID/analytics' \
--header 'x-api-key: YOUR_APPLICATION_API_KEY' \
--data-urlencode 'start=2026-11-01' \
--data-urlencode 'end=2026-11-05'

start and end are inclusive UTC dates. Request at most 30 days, with the start within the preceding 90 days and no future dates. Today's values can be partial. Provider data may arrive late.

The result includes sent/delivered/read totals, daily series and typed button clicks. Missing values are null, not zero; missing days remain gaps. Unique button clicks are daily counts, not unique recipients across the whole period. Costs, MM Lite and offsite conversion analytics are not included in this resource.

Results share a five-minute cache. fetchedAt is Hub retrieval time, not provider freshness. The conservative provider budget is five reads per minute shared across the integration, including MCP. Cached reads do not spend provider quota. Responses use Cache-Control: no-store to prevent browser/shared HTTP caching of tenant data.

Typical errors: TEMPLATE_ANALYTICS_INVALID_PERIOD (400), TEMPLATE_ANALYTICS_NOT_ENABLED (409), TEMPLATE_ANALYTICS_UNSUPPORTED_CHANNEL (409), TEMPLATE_ANALYTICS_PROVIDER_ACCESS or TEMPLATE_ANALYTICS_INVALID_RESPONSE (502), and TEMPLATE_ANALYTICS_UNAVAILABLE (503). A template or channel outside the key's application returns 404. Enablement is managed by the connected application; a GET does not enable analytics.

Compare two templates​

curl --get 'https://app.chatt2.me/v1/communication/channel/whatsapp/templates/CHANNEL_UUID/BASE_TEMPLATE_UUID/comparison' \
--header 'x-api-key: YOUR_APPLICATION_API_KEY' \
--data-urlencode 'compareTemplateId=OTHER_TEMPLATE_UUID' \
--data-urlencode 'periodDays=30' \
--data-urlencode 'endDate=2026-11-05'

Both internal template IDs must be distinct, approved and owned by the same channel. Each template needs at least 1,000 messages sent in the selected period. Use periodDays 7, 30, 60 or 90; endDate is the final included date, earlier than today UTC. Hub derives exact UTC boundaries in epoch seconds; clients do not send timestamps. The interface defaults to the latest complete 30 days.

The response includes:

FieldMeaning
messageSendsMap of internal template UUID to count, or null if absent
topBlockReasonsMap of internal template UUID to the provider reason, or null
blockRateOrderRelative ordering supplied by the provider, mapped to internal UUIDs
blockRateOrderMeaningCurrently unconfirmed; the provider does not document the direction clearly
startDate, endDate, timezoneActual inclusive dates and UTC
fetchedAt, cachedRetrieval metadata

Do not infer a winner or a numerical block rate from relative ordering. Greater sends do not mean better quality. UNKNOWN_BLOCK_REASON means no reported reason. Comparing different categories, languages or audiences does not create a controlled A/B experiment or statistical confidence.

Comparisons use a one-hour cache and a separate conservative budget of 10 provider calls per hour shared across the integration. REST and operational MCP use the same cache and quota. Selecting a different template in the UI does not run a comparison until Compare is selected. Reversing the base/comparator roles is a distinct query.

Errors and manual retry​

CodeHTTPRecovery
TEMPLATE_COMPARISON_INVALID_PERIOD400Choose a supported complete UTC period
TEMPLATE_COMPARISON_SAME_TEMPLATE400Choose another template
TEMPLATE_COMPARISON_INSUFFICIENT_VOLUME409Try a longer supported window; both templates need 1,000 sends
TEMPLATE_COMPARISON_NOT_APPROVED409Wait for approval and refresh template metadata
TEMPLATE_COMPARISON_NOT_OWNER409Verify both templates belong to this connected channel
TEMPLATE_COMPARISON_UNSUPPORTED_CHANNEL409Use a connected WhatsApp channel
TEMPLATE_COMPARISON_PROVIDER_ACCESS502Ask the application administrator to check the provider connection
TEMPLATE_COMPARISON_INVALID_RESPONSE502Provider response could not be safely interpreted
TEMPLATE_COMPARISON_UNAVAILABLE503Retry later

For both reads, rate limiting returns HTTP 429, Retry-After and a string retryAfter in the error body. Respect the delay and retry manually. Cached results may be delayed too; neither endpoint promises real-time data.

Operational MCP​

Use hub_get_whatsapp_template_analytics and hub_compare_whatsapp_templates with an authorized organizationContextId, applicationId, applicationChannelId and internal template IDs. Analytics also takes start/end; comparison takes templateId, compareTemplateId, periodDays and endDate. The services, scope checks, result semantics and provider quotas are shared with REST. Neither read sends a message or a conversion.

See MCP actions for browser OAuth and team selection, and Purchase conversions for CTWA event submission.