{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Returns the requested campaign analytics values data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d`\n\n**Scopes:**\n`campaigns:read`\n\n[OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/query_campaign_values.json)","properties":{"query":{"type":"object","properties":{"fields[campaign-values-report]":{"type":"array","items":{"type":"string","enum":["id","results"]},"description":"For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#sparse-fieldsets"},"page_cursor":{"type":"string","description":"For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#pagination"}},"required":[],"additionalProperties":false},"headers":{"type":"object","properties":{"revision":{"type":"string","default":"2026-10-15","enum":["2026-10-15"],"description":"API endpoint revision (format: YYYY-MM-DD[.suffix])"}},"required":["revision"],"additionalProperties":false},"body":{"$ref":"#/definitions/CampaignValuesRequestDTO"}},"required":["headers","body"],"additionalProperties":false,"definitions":{"CampaignValuesRequestDTO":{"type":"object","properties":{"data":{"$ref":"#/definitions/CampaignValuesRequestDTOResourceObject"}},"required":["data"]},"CampaignValuesRequestDTOResourceObject":{"type":"object","properties":{"type":{"$ref":"#/definitions/CampaignValuesReportEnum"},"attributes":{"type":"object","properties":{"statistics":{"description":"List of statistics to query for. All rate statistics will be returned in fractional form [0.0, 1.0]","type":"array","items":{"type":"string","enum":["average_order_value","bounce_rate","bounced","bounced_or_failed","bounced_or_failed_rate","click_rate","click_to_open_rate","clicks","clicks_unique","conversion_rate","conversion_uniques","conversion_value","conversions","delivered","delivery_rate","failed","failed_rate","message_segment_count_sum","open_rate","opens","opens_unique","recipients","revenue_per_recipient","spam_complaint_rate","spam_complaints","text_message_credit_usage_amount","text_message_roi","text_message_spend","unsubscribe_rate","unsubscribe_uniques","unsubscribes"],"description":"Defined reporting metric"},"examples":[["opens","open_rate"]]},"timeframe":{"description":"The time frame to pull data from (Max length: 1 year). See [available time frames](https://developers.klaviyo.com/en/reference/reporting_api_overview#available-time-frames).","oneOf":[{"$ref":"#/definitions/Timeframe"},{"$ref":"#/definitions/CustomTimeframe"}]},"conversion_metric_id":{"description":"ID of the metric to be used for conversion statistics","type":"string","examples":["RESQ6t"]},"group_by":{"description":"List of attributes to group the data by.\nAllowed group-bys are campaign_id, campaign_message_id, campaign_message_name, group, group_name, send_channel, tag_id, tag_name, text_message_format, variation, variation_name.\nIf not passed in, the data will be grouped by campaign_id, campaign_message_id, send_channel.\nThe following group by attributes are required: campaign_id, campaign_message_id","type":["array","null"],"items":{"type":"string","enum":["campaign_id","campaign_message_id","campaign_message_name","group","group_name","send_channel","tag_id","tag_name","text_message_format","variation","variation_name"],"description":"Attributes to represent what is being grouped by / filtered on for Campaigns"}},"filter":{"description":"API filter string used to filter the query.\nScalar attributes (send_channel, campaign_id, campaign_message_id, campaign_message_name, variation, variation_name, text_message_format): Supported operators: equals, contains-any.\nList attributes (tag_id, tag_name): Supported operators: contains-any, contains-all.\nOnly one filter can be used per attribute.\nOnly AND can be used as a combination operator.\nMax of 100 items per list filter.\nWhen filtering on send_channel, allowed values are email, sms, push-notification, whatsapp.","type":["string","null"],"examples":["and(equals(campaign_id,\"abc123\"),contains-any(send_channel,[\"email\",\"sms\"]))"]}},"required":["statistics","timeframe","conversion_metric_id"]}},"required":["type","attributes"]},"CampaignValuesReportEnum":{"type":"string","enum":["campaign-values-report"]},"Timeframe":{"type":"object","properties":{"key":{"description":"Pre-defined key that represents a set timeframe","type":"string","enum":["last_12_months","last_30_days","last_365_days","last_3_months","last_7_days","last_90_days","last_month","last_week","last_year","this_month","this_week","this_year","today","yesterday"]}},"required":["key"]},"CustomTimeframe":{"type":"object","properties":{"start":{"description":"A datetime that represents the start of a custom time frame. Offset is ignored and the company timezone is used.","type":"string","format":"date-time","examples":["2022-11-08T00:00:00+00:00"]},"end":{"description":"A datetime that represents the end of a custom time frame. Offset is ignored and the company timezone is used.","type":"string","format":"date-time","examples":["2022-11-08T00:00:00+00:00"]}},"required":["start","end"]}}},"name":"Query Campaign Values","id":"klaviyo.query_campaign_values","example":{"headers":{"revision":"2026-10-15"},"body":{"data":{"type":"campaign-values-report","attributes":{"statistics":["opens","open_rate"],"timeframe":{"key":"last_12_months"},"conversion_metric_id":"RESQ6t"}}}},"maxRequests":1,"summary":false}}