Repository navigation
Align App API metric/message methods with backend from audit - #237
Merged
Merged
Conversation
Cross-verified all App API methods against the backends (services/edge/gaia).
Fixes SDK params that don't match the actual handlers (all in unreleased
batches 3-5; nothing shipped in 5.1.0 is affected):
- getCampaignJourneyMetrics: send `resolution` (handler reads that, not `res`)
— previously 400'd on every call.
- getCampaignActionMetrics / getBroadcastActionMetrics: drop `type` (handler
hardcodes channeltype.All / ignores it); action metrics are all-channel.
- getCampaignActionMetricsLinks / getBroadcastActionMetricsLinks: send `unique`
instead of `type` (handler reads `unique`).
- getBroadcastMessages / getTransactionalMessageDeliveries: drop `state`
(shared deliveries handler never reads it).
- getCampaignMetrics / getCampaignActionMetrics: `version` moved into options
and made optional (server defaults it; it was never required).
- downloadExport doc: returns { url }, not { link }.
Type changes: add MetricsWindowOptions base + CampaignActionMetricsOptions;
remove the now-unused DeliveryState. resource metrics keep `type` (handler
reads it). Backend/spec corrections are handled by a separate project.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hanna-cio
approved these changes
Jul 13, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cross-verified all App API methods against the backends after we found the published OpenAPI spec drifts from the actual handlers. This fixes the SDK params that don't match reality, and the spec will be fixed separately internally.
None of these methods shipped in v5.1.0: they're all in unreleased batches, so there's no released-user impact.
Fixes
getCampaignJourneyMetricsresolution(notres)resolution— previously 400'd every callgetCampaignActionMetrics,getBroadcastActionMetricstypegetCampaignActionMetricsLinks,getBroadcastActionMetricsLinkstype→uniqueuniquegetBroadcastMessages,getTransactionalMessageDeliveriesstatestategetCampaignMetrics,getCampaignActionMetricsversionmoved into options + made optionaldownloadExport{ url }not{ link }Type changes
MetricsWindowOptions(base window) andCampaignActionMetricsOptions(campaign action metrics, notype).DeliveryState.getCampaignMetrics(campaignId, options)/getCampaignActionMetrics(campaignId, actionId, options)—versionis now an optional field inoptionsrather than a required positional arg.Assisted by AI 🤖
Note
Medium Risk
Breaking signature and query-param changes across many client methods, but PR states these APIs were not yet released; fixes include a journey-metrics bug that caused 400s.
Overview
Aligns unreleased App API client methods with what the backend actually accepts, after audit against real handlers (not the drifting OpenAPI spec).
Query string fixes:
getCampaignJourneyMetricsnow sendsresolutioninstead ofres(previously broke every call). Campaign/broadcast action link metrics senduniqueinstead oftype. Action-level metrics no longer sendtype(all-channel aggregation). Transactional/broadcast message listings no longer send unsupportedstate.Signatures & types:
getCampaignMetricsandgetCampaignActionMetricsdrop the required positionalversionarg;versionis optional insideoptions. AddsMetricsWindowOptions/CampaignActionMetricsOptions, removesDeliveryState.downloadExportJSDoc corrected to{ url }.Docs & tests:
docs/app.md, unit tests, and live integration call sites updated to match.Reviewed by Cursor Bugbot for commit ac5f661. Bugbot is set up for automated code reviews on this repo. Configure here.