klaviyo-api-sdk 17.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +932 -414
- data/klaviyo-api-sdk.gemspec +1 -1
- data/lib/klaviyo-api-sdk/api/accounts_api.rb +12 -12
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +215 -155
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +585 -381
- data/lib/klaviyo-api-sdk/api/client_api.rb +100 -0
- data/lib/klaviyo-api-sdk/api/conversations_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/coupons_api.rb +187 -108
- data/lib/klaviyo-api-sdk/api/custom_objects_api.rb +2755 -83
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/events_api.rb +72 -58
- data/lib/klaviyo-api-sdk/api/flows_api.rb +238 -152
- data/lib/klaviyo-api-sdk/api/forms_api.rb +81 -60
- data/lib/klaviyo-api-sdk/api/images_api.rb +48 -27
- data/lib/klaviyo-api-sdk/api/lists_api.rb +113 -88
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +184 -156
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +445 -226
- data/lib/klaviyo-api-sdk/api/reporting_api.rb +76 -27
- data/lib/klaviyo-api-sdk/api/reviews_api.rb +38 -31
- data/lib/klaviyo-api-sdk/api/segments_api.rb +107 -82
- data/lib/klaviyo-api-sdk/api/tags_api.rb +164 -128
- data/lib/klaviyo-api-sdk/api/templates_api.rb +113 -60
- data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +24 -17
- data/lib/klaviyo-api-sdk/api/web_feeds_api.rb +41 -27
- data/lib/klaviyo-api-sdk/api/webhooks_api.rb +73 -31
- data/lib/klaviyo-api-sdk/api_client.rb +1 -1
- data/lib/klaviyo-api-sdk/models/action_output_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/action_output_condition_filter.rb +78 -195
- data/lib/klaviyo-api-sdk/models/action_output_split_action_data.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters.rb → action_output_split_action_data_action_output_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{action_output_condition_condition_group.rb → action_output_split_action_data_action_output_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/age_gate_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/api_schema_property.rb +301 -0
- data/lib/klaviyo-api-sdk/models/back_in_stock_email_consent_checkbox_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/base_event_create_query_bulk_entry_resource_object_attributes.rb +15 -2
- data/lib/klaviyo-api-sdk/models/base_style_properties.rb +15 -5
- data/lib/klaviyo-api-sdk/models/button_action.rb +1 -0
- data/lib/klaviyo-api-sdk/models/button_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/button_styles.rb +25 -3
- data/lib/klaviyo-api-sdk/models/{action_output_condition_filter2.rb → button_styles_height.rb} +3 -7
- data/lib/klaviyo-api-sdk/models/cart_content.rb +277 -0
- data/lib/klaviyo-api-sdk/models/cart_content_properties.rb +236 -0
- data/lib/klaviyo-api-sdk/models/checkboxes_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/conditional_branch_action_data_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/constant_property_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/{price_drop_condition_filter2.rb → constant_property_mapping_value.rb} +6 -16
- data/lib/klaviyo-api-sdk/models/content_experiment_action.rb +1 -1
- data/lib/klaviyo-api-sdk/models/{send_push_notification_action_content_experiment_action_data.rb → content_experiment_action_data.rb} +6 -5
- data/lib/klaviyo-api-sdk/models/{send_push_notification_action_current_experiment.rb → content_experiment_action_data_current_experiment.rb} +6 -6
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter2.rb → content_experiment_action_data_main_action.rb} +3 -16
- data/lib/klaviyo-api-sdk/models/countdown_timer_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/coupon_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/custom_css.rb +231 -0
- data/lib/klaviyo-api-sdk/models/custom_html.rb +292 -0
- data/lib/klaviyo-api-sdk/models/custom_html_properties.rb +263 -0
- data/lib/klaviyo-api-sdk/models/custom_object_date_trigger.rb +450 -0
- data/lib/klaviyo-api-sdk/models/custom_object_property_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/custom_object_relationship_source.rb +328 -0
- data/lib/klaviyo-api-sdk/models/date_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/display_options.rb +24 -4
- data/lib/klaviyo-api-sdk/models/dropdown_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/email_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb +13 -9
- data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +13 -9
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes.rb +292 -0
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes_source_mapping.rb +224 -0
- data/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +15 -2
- data/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb +14 -1
- data/lib/klaviyo-api-sdk/models/flow_definition_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/flow_definition_triggers_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/flow_email.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_push_notification.rb +14 -4
- data/lib/klaviyo-api-sdk/models/flow_sms.rb +15 -2
- data/lib/klaviyo-api-sdk/models/form_create_query_resource_object_attributes.rb +2 -2
- data/lib/klaviyo-api-sdk/models/html_text_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen.rb +305 -0
- data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen_properties.rb +220 -0
- data/lib/klaviyo-api-sdk/models/image_action.rb +1 -0
- data/lib/klaviyo-api-sdk/models/image_block_cropping_properties.rb +0 -35
- data/lib/klaviyo-api-sdk/models/image_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/low_inventory_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/low_inventory_trigger.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter.rb → low_inventory_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_condition_group.rb → low_inventory_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb +2 -2
- data/lib/klaviyo-api-sdk/models/metric_property_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/metric_property_condition_filter.rb +87 -195
- data/lib/klaviyo-api-sdk/models/metric_trigger.rb +2 -1
- data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters.rb → metric_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters_condition_groups_inner.rb → metric_trigger_trigger_filter_condition_groups_inner.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/mobile_push_content_create.rb +18 -5
- data/lib/klaviyo-api-sdk/models/mobile_push_content_update.rb +18 -5
- data/lib/klaviyo-api-sdk/models/mobile_push_options_on_open.rb +2 -1
- data/lib/klaviyo-api-sdk/models/multi_branch_split_branch_branch_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/object_record_bulk_delete_job_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters_condition_groups_inner.rb → object_record_delete_job_create_query_resource_object_relationships.rb} +13 -15
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object_relationships_object_records.rb +220 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_rels_records_data_inner.rb +238 -0
- data/lib/klaviyo-api-sdk/models/object_record_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object.rb +246 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_attributes.rb +322 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships.rb +218 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type.rb +218 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type_data.rb +238 -0
- data/lib/klaviyo-api-sdk/models/object_schema_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object.rb +252 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object_attributes.rb +302 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_create_meta.rb +237 -0
- data/lib/klaviyo-api-sdk/models/{metric_property_condition_condition_group.rb → object_schema_relationship_create_query.rb} +14 -14
- data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters_condition_groups_inner.rb → object_schema_relationship_create_query_data_inner.rb} +37 -15
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_meta.rb +224 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query_data.rb +247 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_update_meta.rb +246 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes.rb +307 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes_object_schema.rb +224 -0
- data/lib/klaviyo-api-sdk/models/object_type_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +13 -4
- data/lib/klaviyo-api-sdk/models/open_tracking_subscription_parameters.rb +258 -0
- data/lib/klaviyo-api-sdk/models/open_tracking_unsubscription_parameters.rb +258 -0
- data/lib/klaviyo-api-sdk/models/opt_in_code_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/patch_identifiers.rb +227 -0
- data/lib/klaviyo-api-sdk/models/phone_number_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/price_drop_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/price_drop_trigger.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters.rb → price_drop_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{price_drop_condition_condition_group.rb → price_drop_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/profile_event_tracked_properties.rb +19 -9
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_email_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/{profile_has_not_received_push_message_condition_timeframe_filter.rb → profile_has_not_received_email_message_condition_timeframe_filter.rb} +1 -1
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_push_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_sms_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_meta.rb +13 -4
- data/lib/klaviyo-api-sdk/models/profile_not_in_flow_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_object_schema_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query_data.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb +2 -2
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_condition.rb +2 -2
- data/lib/klaviyo-api-sdk/models/profile_relationship_source.rb +330 -0
- data/lib/klaviyo-api-sdk/models/property_filter.rb +237 -0
- data/lib/klaviyo-api-sdk/models/property_source.rb +254 -0
- data/lib/klaviyo-api-sdk/models/push_action_button.rb +1 -5
- data/lib/klaviyo-api-sdk/models/push_action_button_definition.rb +261 -0
- data/lib/klaviyo-api-sdk/models/push_on_open_web_url.rb +268 -0
- data/lib/klaviyo-api-sdk/models/quote_style.rb +21 -1
- data/lib/klaviyo-api-sdk/models/radio_buttons_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/redirect_properties.rb +2 -5
- data/lib/klaviyo-api-sdk/models/related_id_path.rb +273 -0
- data/lib/klaviyo-api-sdk/models/review_block_styles.rb +13 -13
- data/lib/klaviyo-api-sdk/models/review_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/reviewer_name_style.rb +21 -1
- data/lib/klaviyo-api-sdk/models/row_v0_blocks_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/signup_counter_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/simple_property_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/simple_relationship_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/simple_relationship_mapping_source.rb +105 -0
- data/lib/klaviyo-api-sdk/models/sms_consent_checkbox_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/sms_disclosure_link_text_style.rb +319 -0
- data/lib/klaviyo-api-sdk/models/sms_disclosure_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/sms_disclosure_styles.rb +1 -1
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes.rb +235 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes_property_mappings_inner.rb +104 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query_resource_object.rb +252 -0
- data/lib/klaviyo-api-sdk/models/spin_to_win_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/string_phone_operator_string_array_filter.rb +1 -1
- data/lib/klaviyo-api-sdk/models/table_fallback_image_sub_block.rb +0 -13
- data/lib/klaviyo-api-sdk/models/table_image_sub_block.rb +0 -13
- data/lib/klaviyo-api-sdk/models/template_definition.rb +1 -0
- data/lib/klaviyo-api-sdk/models/text_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/version.rb +39 -4
- data/lib/klaviyo-api-sdk/models/version_properties.rb +14 -4
- data/lib/klaviyo-api-sdk/models/version_styles.rb +15 -6
- data/lib/klaviyo-api-sdk/models/version_triggers_inner.rb +1 -0
- data/lib/klaviyo-api-sdk.rb +86 -23
- data/lib/klaviyo-api-sdk.rb.bak +87 -24
- metadata +88 -25
- data/lib/klaviyo-api-sdk/models/custom_object_property_condition_filter.rb +0 -117
- data/lib/klaviyo-api-sdk/models/flow_email_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/flow_push_notification_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/flow_sms_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/metric_property_condition_filter2.rb +0 -117
- data/lib/klaviyo-api-sdk/models/price_drop_condition_filter.rb +0 -225
|
@@ -19,9 +19,10 @@ module KlaviyoAPI
|
|
|
19
19
|
@api_client = api_client
|
|
20
20
|
end
|
|
21
21
|
# Create Custom Metric
|
|
22
|
-
# Create a new custom metric. Custom metric objects must include a `name` and `definition`.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write`
|
|
22
|
+
# Create a new custom metric. Custom metric objects must include a `name` and `definition`.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_custom_metric.json)
|
|
23
23
|
# @param custom_metric_create_query [CustomMetricCreateQuery] Create a custom metric.
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
25
26
|
# @return [Hash<String, Object>]
|
|
26
27
|
def create_custom_metric(custom_metric_create_query, opts = {})
|
|
27
28
|
data, _status_code, _headers = create_custom_metric_with_http_info(custom_metric_create_query, opts)
|
|
@@ -29,9 +30,10 @@ module KlaviyoAPI
|
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# Create Custom Metric
|
|
32
|
-
# Create a new custom metric. Custom metric objects must include a `name` and `definition`.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write`
|
|
33
|
+
# Create a new custom metric. Custom metric objects must include a `name` and `definition`.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_custom_metric.json)
|
|
33
34
|
# @param custom_metric_create_query [CustomMetricCreateQuery] Create a custom metric.
|
|
34
35
|
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
35
37
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
36
38
|
def create_custom_metric_with_http_info(custom_metric_create_query, opts = {})
|
|
37
39
|
if @api_client.config.debugging
|
|
@@ -41,16 +43,21 @@ module KlaviyoAPI
|
|
|
41
43
|
if @api_client.config.client_side_validation && custom_metric_create_query.nil?
|
|
42
44
|
fail ArgumentError, "Missing the required parameter 'custom_metric_create_query' when calling MetricsApi.create_custom_metric"
|
|
43
45
|
end
|
|
46
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
47
|
+
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
48
|
+
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
49
|
+
end
|
|
44
50
|
# resource path
|
|
45
51
|
local_var_path = '/api/custom-metrics'
|
|
46
52
|
|
|
47
53
|
# query parameters
|
|
48
54
|
query_params = opts[:query_params] || {}
|
|
55
|
+
query_params[:'fields[custom-metric]'] = @api_client.build_collection_param(opts[:'fields_custom_metric'], :csv) if !opts[:'fields_custom_metric'].nil?
|
|
49
56
|
|
|
50
57
|
# header parameters
|
|
51
58
|
header_params = opts[:header_params] || {}
|
|
52
59
|
# klaviyo api revision
|
|
53
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
60
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
54
61
|
# HTTP header 'Accept' (if needed)
|
|
55
62
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
56
63
|
# HTTP header 'Content-Type'
|
|
@@ -89,7 +96,7 @@ module KlaviyoAPI
|
|
|
89
96
|
end
|
|
90
97
|
|
|
91
98
|
# Delete Custom Metric
|
|
92
|
-
# Delete a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:write`
|
|
99
|
+
# Delete a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_custom_metric.json)
|
|
93
100
|
# @param id [String] The ID of the custom metric
|
|
94
101
|
# @param [Hash] opts the optional parameters
|
|
95
102
|
# @return [nil]
|
|
@@ -99,7 +106,7 @@ module KlaviyoAPI
|
|
|
99
106
|
end
|
|
100
107
|
|
|
101
108
|
# Delete Custom Metric
|
|
102
|
-
# Delete a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:write`
|
|
109
|
+
# Delete a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_custom_metric.json)
|
|
103
110
|
# @param id [String] The ID of the custom metric
|
|
104
111
|
# @param [Hash] opts the optional parameters
|
|
105
112
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -120,7 +127,7 @@ module KlaviyoAPI
|
|
|
120
127
|
# header parameters
|
|
121
128
|
header_params = opts[:header_params] || {}
|
|
122
129
|
# klaviyo api revision
|
|
123
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
130
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
124
131
|
# HTTP header 'Accept' (if needed)
|
|
125
132
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
126
133
|
|
|
@@ -154,12 +161,12 @@ module KlaviyoAPI
|
|
|
154
161
|
end
|
|
155
162
|
|
|
156
163
|
# Get Custom Metric
|
|
157
|
-
# Get a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
164
|
+
# Get a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metric.json)
|
|
158
165
|
# @param id [String] The ID of the custom metric
|
|
159
166
|
# @param [Hash] opts the optional parameters
|
|
160
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
161
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
162
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
167
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
168
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
169
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
163
170
|
# @return [Hash<String, Object>]
|
|
164
171
|
def get_custom_metric(id, opts = {})
|
|
165
172
|
data, _status_code, _headers = get_custom_metric_with_http_info(id, opts)
|
|
@@ -167,12 +174,12 @@ module KlaviyoAPI
|
|
|
167
174
|
end
|
|
168
175
|
|
|
169
176
|
# Get Custom Metric
|
|
170
|
-
# Get a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
177
|
+
# Get a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metric.json)
|
|
171
178
|
# @param id [String] The ID of the custom metric
|
|
172
179
|
# @param [Hash] opts the optional parameters
|
|
173
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
174
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
175
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
180
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
181
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
182
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
176
183
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
177
184
|
def get_custom_metric_with_http_info(id, opts = {})
|
|
178
185
|
if @api_client.config.debugging
|
|
@@ -182,11 +189,11 @@ module KlaviyoAPI
|
|
|
182
189
|
if @api_client.config.client_side_validation && id.nil?
|
|
183
190
|
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_custom_metric"
|
|
184
191
|
end
|
|
185
|
-
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "name", "updated"]
|
|
192
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
186
193
|
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
187
194
|
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
188
195
|
end
|
|
189
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
196
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
190
197
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
191
198
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
192
199
|
end
|
|
@@ -206,7 +213,7 @@ module KlaviyoAPI
|
|
|
206
213
|
# header parameters
|
|
207
214
|
header_params = opts[:header_params] || {}
|
|
208
215
|
# klaviyo api revision
|
|
209
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
216
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
210
217
|
# HTTP header 'Accept' (if needed)
|
|
211
218
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
212
219
|
|
|
@@ -240,10 +247,10 @@ module KlaviyoAPI
|
|
|
240
247
|
end
|
|
241
248
|
|
|
242
249
|
# Get Custom Metric for Mapped Metric
|
|
243
|
-
# Get the custom metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
250
|
+
# Get the custom metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metric_for_mapped_metric.json)
|
|
244
251
|
# @param id [String] The type of mapping.
|
|
245
252
|
# @param [Hash] opts the optional parameters
|
|
246
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
253
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
247
254
|
# @return [Hash<String, Object>]
|
|
248
255
|
def get_custom_metric_for_mapped_metric(id, opts = {})
|
|
249
256
|
data, _status_code, _headers = get_custom_metric_for_mapped_metric_with_http_info(id, opts)
|
|
@@ -254,10 +261,10 @@ module KlaviyoAPI
|
|
|
254
261
|
alias get_mapped_metric_custom_metric get_custom_metric_for_mapped_metric
|
|
255
262
|
|
|
256
263
|
# Get Custom Metric for Mapped Metric
|
|
257
|
-
# Get the custom metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
264
|
+
# Get the custom metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metric_for_mapped_metric.json)
|
|
258
265
|
# @param id [String] The type of mapping.
|
|
259
266
|
# @param [Hash] opts the optional parameters
|
|
260
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
267
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
261
268
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
262
269
|
def get_custom_metric_for_mapped_metric_with_http_info(id, opts = {})
|
|
263
270
|
if @api_client.config.debugging
|
|
@@ -272,7 +279,7 @@ module KlaviyoAPI
|
|
|
272
279
|
if @api_client.config.client_side_validation && !allowable_values.include?(id)
|
|
273
280
|
fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
|
|
274
281
|
end
|
|
275
|
-
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "name", "updated"]
|
|
282
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
276
283
|
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
277
284
|
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
278
285
|
end
|
|
@@ -286,7 +293,7 @@ module KlaviyoAPI
|
|
|
286
293
|
# header parameters
|
|
287
294
|
header_params = opts[:header_params] || {}
|
|
288
295
|
# klaviyo api revision
|
|
289
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
296
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
290
297
|
# HTTP header 'Accept' (if needed)
|
|
291
298
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
292
299
|
|
|
@@ -323,7 +330,7 @@ module KlaviyoAPI
|
|
|
323
330
|
alias get_mapped_metric_custom_metric_with_http_info get_custom_metric_for_mapped_metric_with_http_info
|
|
324
331
|
|
|
325
332
|
# Get Custom Metric ID for Mapped Metric
|
|
326
|
-
# Get the ID of the custom metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
333
|
+
# Get the ID of the custom metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metric_id_for_mapped_metric.json)
|
|
327
334
|
# @param id [String] The type of mapping.
|
|
328
335
|
# @param [Hash] opts the optional parameters
|
|
329
336
|
# @return [Hash<String, Object>]
|
|
@@ -336,7 +343,7 @@ module KlaviyoAPI
|
|
|
336
343
|
alias get_mapped_metric_relationships_custom_metric get_custom_metric_id_for_mapped_metric
|
|
337
344
|
|
|
338
345
|
# Get Custom Metric ID for Mapped Metric
|
|
339
|
-
# Get the ID of the custom metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
346
|
+
# Get the ID of the custom metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metric_id_for_mapped_metric.json)
|
|
340
347
|
# @param id [String] The type of mapping.
|
|
341
348
|
# @param [Hash] opts the optional parameters
|
|
342
349
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -362,7 +369,7 @@ module KlaviyoAPI
|
|
|
362
369
|
# header parameters
|
|
363
370
|
header_params = opts[:header_params] || {}
|
|
364
371
|
# klaviyo api revision
|
|
365
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
372
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
366
373
|
# HTTP header 'Accept' (if needed)
|
|
367
374
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
368
375
|
|
|
@@ -399,11 +406,11 @@ module KlaviyoAPI
|
|
|
399
406
|
alias get_mapped_metric_relationships_custom_metric_with_http_info get_custom_metric_id_for_mapped_metric_with_http_info
|
|
400
407
|
|
|
401
408
|
# Get Custom Metrics
|
|
402
|
-
# Get all custom metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
409
|
+
# Get all custom metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metrics.json)
|
|
403
410
|
# @param [Hash] opts the optional parameters
|
|
404
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
405
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
406
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
411
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
412
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
413
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
407
414
|
# @return [Hash<String, Object>]
|
|
408
415
|
def get_custom_metrics(opts = {})
|
|
409
416
|
data, _status_code, _headers = get_custom_metrics_with_http_info(opts)
|
|
@@ -411,21 +418,21 @@ module KlaviyoAPI
|
|
|
411
418
|
end
|
|
412
419
|
|
|
413
420
|
# Get Custom Metrics
|
|
414
|
-
# Get all custom metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
421
|
+
# Get all custom metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_custom_metrics.json)
|
|
415
422
|
# @param [Hash] opts the optional parameters
|
|
416
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
417
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
418
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
423
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
424
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
425
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
419
426
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
420
427
|
def get_custom_metrics_with_http_info(opts = {})
|
|
421
428
|
if @api_client.config.debugging
|
|
422
429
|
@api_client.config.logger.debug 'Calling API: MetricsApi.get_custom_metrics ...'
|
|
423
430
|
end
|
|
424
|
-
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "name", "updated"]
|
|
431
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
425
432
|
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
426
433
|
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
427
434
|
end
|
|
428
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
435
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
429
436
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
430
437
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
431
438
|
end
|
|
@@ -445,7 +452,7 @@ module KlaviyoAPI
|
|
|
445
452
|
# header parameters
|
|
446
453
|
header_params = opts[:header_params] || {}
|
|
447
454
|
# klaviyo api revision
|
|
448
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
455
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
449
456
|
# HTTP header 'Accept' (if needed)
|
|
450
457
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
451
458
|
|
|
@@ -479,10 +486,10 @@ module KlaviyoAPI
|
|
|
479
486
|
end
|
|
480
487
|
|
|
481
488
|
# Get Flows Triggered by Metric
|
|
482
|
-
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
|
489
|
+
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_flows_triggered_by_metric.json)
|
|
483
490
|
# @param id [String]
|
|
484
491
|
# @param [Hash] opts the optional parameters
|
|
485
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
492
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
486
493
|
# @return [Hash<String, Object>]
|
|
487
494
|
def get_flows_triggered_by_metric(id, opts = {})
|
|
488
495
|
data, _status_code, _headers = get_flows_triggered_by_metric_with_http_info(id, opts)
|
|
@@ -496,10 +503,10 @@ module KlaviyoAPI
|
|
|
496
503
|
alias get_metric_flow_triggers get_flows_triggered_by_metric
|
|
497
504
|
|
|
498
505
|
# Get Flows Triggered by Metric
|
|
499
|
-
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
|
506
|
+
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_flows_triggered_by_metric.json)
|
|
500
507
|
# @param id [String]
|
|
501
508
|
# @param [Hash] opts the optional parameters
|
|
502
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
509
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
503
510
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
504
511
|
def get_flows_triggered_by_metric_with_http_info(id, opts = {})
|
|
505
512
|
if @api_client.config.debugging
|
|
@@ -509,7 +516,7 @@ module KlaviyoAPI
|
|
|
509
516
|
if @api_client.config.client_side_validation && id.nil?
|
|
510
517
|
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_flows_triggered_by_metric"
|
|
511
518
|
end
|
|
512
|
-
allowable_values = ["archived", "created", "name", "status", "trigger_type", "updated"]
|
|
519
|
+
allowable_values = ["archived", "created", "id", "name", "status", "trigger_type", "updated"]
|
|
513
520
|
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
|
514
521
|
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
|
515
522
|
end
|
|
@@ -523,7 +530,7 @@ module KlaviyoAPI
|
|
|
523
530
|
# header parameters
|
|
524
531
|
header_params = opts[:header_params] || {}
|
|
525
532
|
# klaviyo api revision
|
|
526
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
533
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
527
534
|
# HTTP header 'Accept' (if needed)
|
|
528
535
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
529
536
|
|
|
@@ -563,7 +570,7 @@ module KlaviyoAPI
|
|
|
563
570
|
alias get_metric_flow_triggers_with_http_info get_flows_triggered_by_metric_with_http_info
|
|
564
571
|
|
|
565
572
|
# Get IDs for Flows Triggered by Metric
|
|
566
|
-
# Get the IDs of all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
|
573
|
+
# Get the IDs of all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_ids_for_flows_triggered_by_metric.json)
|
|
567
574
|
# @param id [String]
|
|
568
575
|
# @param [Hash] opts the optional parameters
|
|
569
576
|
# @return [Hash<String, Object>]
|
|
@@ -579,7 +586,7 @@ module KlaviyoAPI
|
|
|
579
586
|
alias get_metric_relationships_flow_triggers get_ids_for_flows_triggered_by_metric
|
|
580
587
|
|
|
581
588
|
# Get IDs for Flows Triggered by Metric
|
|
582
|
-
# Get the IDs of all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
|
589
|
+
# Get the IDs of all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_ids_for_flows_triggered_by_metric.json)
|
|
583
590
|
# @param id [String]
|
|
584
591
|
# @param [Hash] opts the optional parameters
|
|
585
592
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -600,7 +607,7 @@ module KlaviyoAPI
|
|
|
600
607
|
# header parameters
|
|
601
608
|
header_params = opts[:header_params] || {}
|
|
602
609
|
# klaviyo api revision
|
|
603
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
610
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
604
611
|
# HTTP header 'Accept' (if needed)
|
|
605
612
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
606
613
|
|
|
@@ -640,13 +647,13 @@ module KlaviyoAPI
|
|
|
640
647
|
alias get_metric_relationships_flow_triggers_with_http_info get_ids_for_flows_triggered_by_metric_with_http_info
|
|
641
648
|
|
|
642
649
|
# Get Mapped Metric
|
|
643
|
-
# Get the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
650
|
+
# Get the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_mapped_metric.json)
|
|
644
651
|
# @param id [String] The type of mapping.
|
|
645
652
|
# @param [Hash] opts the optional parameters
|
|
646
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
647
|
-
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
648
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
649
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
653
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
654
|
+
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
655
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
656
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
650
657
|
# @return [Hash<String, Object>]
|
|
651
658
|
def get_mapped_metric(id, opts = {})
|
|
652
659
|
data, _status_code, _headers = get_mapped_metric_with_http_info(id, opts)
|
|
@@ -654,13 +661,13 @@ module KlaviyoAPI
|
|
|
654
661
|
end
|
|
655
662
|
|
|
656
663
|
# Get Mapped Metric
|
|
657
|
-
# Get the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
664
|
+
# Get the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_mapped_metric.json)
|
|
658
665
|
# @param id [String] The type of mapping.
|
|
659
666
|
# @param [Hash] opts the optional parameters
|
|
660
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
661
|
-
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
662
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
663
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
667
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
668
|
+
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
669
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
670
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
664
671
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
665
672
|
def get_mapped_metric_with_http_info(id, opts = {})
|
|
666
673
|
if @api_client.config.debugging
|
|
@@ -675,15 +682,15 @@ module KlaviyoAPI
|
|
|
675
682
|
if @api_client.config.client_side_validation && !allowable_values.include?(id)
|
|
676
683
|
fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
|
|
677
684
|
end
|
|
678
|
-
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "name", "updated"]
|
|
685
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
679
686
|
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
680
687
|
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
681
688
|
end
|
|
682
|
-
allowable_values = ["updated"]
|
|
689
|
+
allowable_values = ["id", "updated"]
|
|
683
690
|
if @api_client.config.client_side_validation && opts[:'fields_mapped_metric'] && !opts[:'fields_mapped_metric'].all? { |item| allowable_values.include?(item) }
|
|
684
691
|
fail ArgumentError, "invalid value for \"fields_mapped_metric\", must include one of #{allowable_values}"
|
|
685
692
|
end
|
|
686
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
693
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
687
694
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
688
695
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
689
696
|
end
|
|
@@ -704,7 +711,7 @@ module KlaviyoAPI
|
|
|
704
711
|
# header parameters
|
|
705
712
|
header_params = opts[:header_params] || {}
|
|
706
713
|
# klaviyo api revision
|
|
707
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
714
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
708
715
|
# HTTP header 'Accept' (if needed)
|
|
709
716
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
710
717
|
|
|
@@ -738,12 +745,12 @@ module KlaviyoAPI
|
|
|
738
745
|
end
|
|
739
746
|
|
|
740
747
|
# Get Mapped Metrics
|
|
741
|
-
# Get all mapped metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
748
|
+
# Get all mapped metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_mapped_metrics.json)
|
|
742
749
|
# @param [Hash] opts the optional parameters
|
|
743
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
744
|
-
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
745
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
746
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
750
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
751
|
+
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
752
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
753
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
747
754
|
# @return [Hash<String, Object>]
|
|
748
755
|
def get_mapped_metrics(opts = {})
|
|
749
756
|
data, _status_code, _headers = get_mapped_metrics_with_http_info(opts)
|
|
@@ -751,26 +758,26 @@ module KlaviyoAPI
|
|
|
751
758
|
end
|
|
752
759
|
|
|
753
760
|
# Get Mapped Metrics
|
|
754
|
-
# Get all mapped metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
761
|
+
# Get all mapped metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_mapped_metrics.json)
|
|
755
762
|
# @param [Hash] opts the optional parameters
|
|
756
|
-
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
757
|
-
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
758
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
759
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
763
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
764
|
+
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
765
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
766
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
760
767
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
761
768
|
def get_mapped_metrics_with_http_info(opts = {})
|
|
762
769
|
if @api_client.config.debugging
|
|
763
770
|
@api_client.config.logger.debug 'Calling API: MetricsApi.get_mapped_metrics ...'
|
|
764
771
|
end
|
|
765
|
-
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "name", "updated"]
|
|
772
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
766
773
|
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
767
774
|
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
768
775
|
end
|
|
769
|
-
allowable_values = ["updated"]
|
|
776
|
+
allowable_values = ["id", "updated"]
|
|
770
777
|
if @api_client.config.client_side_validation && opts[:'fields_mapped_metric'] && !opts[:'fields_mapped_metric'].all? { |item| allowable_values.include?(item) }
|
|
771
778
|
fail ArgumentError, "invalid value for \"fields_mapped_metric\", must include one of #{allowable_values}"
|
|
772
779
|
end
|
|
773
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
780
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
774
781
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
775
782
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
776
783
|
end
|
|
@@ -791,7 +798,7 @@ module KlaviyoAPI
|
|
|
791
798
|
# header parameters
|
|
792
799
|
header_params = opts[:header_params] || {}
|
|
793
800
|
# klaviyo api revision
|
|
794
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
801
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
795
802
|
# HTTP header 'Accept' (if needed)
|
|
796
803
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
797
804
|
|
|
@@ -825,12 +832,12 @@ module KlaviyoAPI
|
|
|
825
832
|
end
|
|
826
833
|
|
|
827
834
|
# Get Metric
|
|
828
|
-
# Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
|
835
|
+
# Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric.json)
|
|
829
836
|
# @param id [String] Metric ID
|
|
830
837
|
# @param [Hash] opts the optional parameters
|
|
831
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
832
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
833
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
838
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
839
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
840
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
834
841
|
# @return [Hash<String, Object>]
|
|
835
842
|
def get_metric(id, opts = {})
|
|
836
843
|
data, _status_code, _headers = get_metric_with_http_info(id, opts)
|
|
@@ -838,12 +845,12 @@ module KlaviyoAPI
|
|
|
838
845
|
end
|
|
839
846
|
|
|
840
847
|
# Get Metric
|
|
841
|
-
# Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
|
848
|
+
# Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric.json)
|
|
842
849
|
# @param id [String] Metric ID
|
|
843
850
|
# @param [Hash] opts the optional parameters
|
|
844
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
845
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
846
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
851
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
852
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
853
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
847
854
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
848
855
|
def get_metric_with_http_info(id, opts = {})
|
|
849
856
|
if @api_client.config.debugging
|
|
@@ -853,11 +860,11 @@ module KlaviyoAPI
|
|
|
853
860
|
if @api_client.config.client_side_validation && id.nil?
|
|
854
861
|
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric"
|
|
855
862
|
end
|
|
856
|
-
allowable_values = ["archived", "created", "name", "status", "trigger_type", "updated"]
|
|
863
|
+
allowable_values = ["archived", "created", "id", "name", "status", "trigger_type", "updated"]
|
|
857
864
|
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
|
858
865
|
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
|
859
866
|
end
|
|
860
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
867
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
861
868
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
862
869
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
863
870
|
end
|
|
@@ -877,7 +884,7 @@ module KlaviyoAPI
|
|
|
877
884
|
# header parameters
|
|
878
885
|
header_params = opts[:header_params] || {}
|
|
879
886
|
# klaviyo api revision
|
|
880
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
887
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
881
888
|
# HTTP header 'Accept' (if needed)
|
|
882
889
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
883
890
|
|
|
@@ -911,10 +918,10 @@ module KlaviyoAPI
|
|
|
911
918
|
end
|
|
912
919
|
|
|
913
920
|
# Get Metric for Mapped Metric
|
|
914
|
-
# Get the metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
921
|
+
# Get the metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_for_mapped_metric.json)
|
|
915
922
|
# @param id [String] The type of mapping.
|
|
916
923
|
# @param [Hash] opts the optional parameters
|
|
917
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
924
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
918
925
|
# @return [Hash<String, Object>]
|
|
919
926
|
def get_metric_for_mapped_metric(id, opts = {})
|
|
920
927
|
data, _status_code, _headers = get_metric_for_mapped_metric_with_http_info(id, opts)
|
|
@@ -925,10 +932,10 @@ module KlaviyoAPI
|
|
|
925
932
|
alias get_mapped_metric_metric get_metric_for_mapped_metric
|
|
926
933
|
|
|
927
934
|
# Get Metric for Mapped Metric
|
|
928
|
-
# Get the metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
935
|
+
# Get the metric for the given mapped metric ID (if applicable).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_for_mapped_metric.json)
|
|
929
936
|
# @param id [String] The type of mapping.
|
|
930
937
|
# @param [Hash] opts the optional parameters
|
|
931
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
938
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
932
939
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
933
940
|
def get_metric_for_mapped_metric_with_http_info(id, opts = {})
|
|
934
941
|
if @api_client.config.debugging
|
|
@@ -943,7 +950,7 @@ module KlaviyoAPI
|
|
|
943
950
|
if @api_client.config.client_side_validation && !allowable_values.include?(id)
|
|
944
951
|
fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
|
|
945
952
|
end
|
|
946
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
953
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
947
954
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
948
955
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
949
956
|
end
|
|
@@ -957,7 +964,7 @@ module KlaviyoAPI
|
|
|
957
964
|
# header parameters
|
|
958
965
|
header_params = opts[:header_params] || {}
|
|
959
966
|
# klaviyo api revision
|
|
960
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
967
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
961
968
|
# HTTP header 'Accept' (if needed)
|
|
962
969
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
963
970
|
|
|
@@ -994,10 +1001,10 @@ module KlaviyoAPI
|
|
|
994
1001
|
alias get_mapped_metric_metric_with_http_info get_metric_for_mapped_metric_with_http_info
|
|
995
1002
|
|
|
996
1003
|
# Get Metric for Metric Property
|
|
997
|
-
# Get the metric for the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1004
|
+
# Get the metric for the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_for_metric_property.json)
|
|
998
1005
|
# @param id [String] The ID of the metric property
|
|
999
1006
|
# @param [Hash] opts the optional parameters
|
|
1000
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1007
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1001
1008
|
# @return [Hash<String, Object>]
|
|
1002
1009
|
def get_metric_for_metric_property(id, opts = {})
|
|
1003
1010
|
data, _status_code, _headers = get_metric_for_metric_property_with_http_info(id, opts)
|
|
@@ -1008,10 +1015,10 @@ module KlaviyoAPI
|
|
|
1008
1015
|
alias get_metric_property_metric get_metric_for_metric_property
|
|
1009
1016
|
|
|
1010
1017
|
# Get Metric for Metric Property
|
|
1011
|
-
# Get the metric for the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1018
|
+
# Get the metric for the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_for_metric_property.json)
|
|
1012
1019
|
# @param id [String] The ID of the metric property
|
|
1013
1020
|
# @param [Hash] opts the optional parameters
|
|
1014
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1021
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1015
1022
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1016
1023
|
def get_metric_for_metric_property_with_http_info(id, opts = {})
|
|
1017
1024
|
if @api_client.config.debugging
|
|
@@ -1021,7 +1028,7 @@ module KlaviyoAPI
|
|
|
1021
1028
|
if @api_client.config.client_side_validation && id.nil?
|
|
1022
1029
|
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_for_metric_property"
|
|
1023
1030
|
end
|
|
1024
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
1031
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
1025
1032
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
1026
1033
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
1027
1034
|
end
|
|
@@ -1035,7 +1042,7 @@ module KlaviyoAPI
|
|
|
1035
1042
|
# header parameters
|
|
1036
1043
|
header_params = opts[:header_params] || {}
|
|
1037
1044
|
# klaviyo api revision
|
|
1038
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1045
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1039
1046
|
# HTTP header 'Accept' (if needed)
|
|
1040
1047
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1041
1048
|
|
|
@@ -1072,7 +1079,7 @@ module KlaviyoAPI
|
|
|
1072
1079
|
alias get_metric_property_metric_with_http_info get_metric_for_metric_property_with_http_info
|
|
1073
1080
|
|
|
1074
1081
|
# Get Metric ID for Mapped Metric
|
|
1075
|
-
# Get the ID of the metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1082
|
+
# Get the ID of the metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_id_for_mapped_metric.json)
|
|
1076
1083
|
# @param id [String] The type of mapping.
|
|
1077
1084
|
# @param [Hash] opts the optional parameters
|
|
1078
1085
|
# @return [Hash<String, Object>]
|
|
@@ -1085,7 +1092,7 @@ module KlaviyoAPI
|
|
|
1085
1092
|
alias get_mapped_metric_relationships_metric get_metric_id_for_mapped_metric
|
|
1086
1093
|
|
|
1087
1094
|
# Get Metric ID for Mapped Metric
|
|
1088
|
-
# Get the ID of the metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1095
|
+
# Get the ID of the metric for the given mapped metric.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_id_for_mapped_metric.json)
|
|
1089
1096
|
# @param id [String] The type of mapping.
|
|
1090
1097
|
# @param [Hash] opts the optional parameters
|
|
1091
1098
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -1111,7 +1118,7 @@ module KlaviyoAPI
|
|
|
1111
1118
|
# header parameters
|
|
1112
1119
|
header_params = opts[:header_params] || {}
|
|
1113
1120
|
# klaviyo api revision
|
|
1114
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1121
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1115
1122
|
# HTTP header 'Accept' (if needed)
|
|
1116
1123
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1117
1124
|
|
|
@@ -1148,7 +1155,7 @@ module KlaviyoAPI
|
|
|
1148
1155
|
alias get_mapped_metric_relationships_metric_with_http_info get_metric_id_for_mapped_metric_with_http_info
|
|
1149
1156
|
|
|
1150
1157
|
# Get Metric ID for Metric Property
|
|
1151
|
-
# Get the ID of the metric for the given metric property.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1158
|
+
# Get the ID of the metric for the given metric property.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_id_for_metric_property.json)
|
|
1152
1159
|
# @param id [String] The ID of the metric property
|
|
1153
1160
|
# @param [Hash] opts the optional parameters
|
|
1154
1161
|
# @return [Hash<String, Object>]
|
|
@@ -1161,7 +1168,7 @@ module KlaviyoAPI
|
|
|
1161
1168
|
alias get_metric_property_relationships_metric get_metric_id_for_metric_property
|
|
1162
1169
|
|
|
1163
1170
|
# Get Metric ID for Metric Property
|
|
1164
|
-
# Get the ID of the metric for the given metric property.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1171
|
+
# Get the ID of the metric for the given metric property.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_id_for_metric_property.json)
|
|
1165
1172
|
# @param id [String] The ID of the metric property
|
|
1166
1173
|
# @param [Hash] opts the optional parameters
|
|
1167
1174
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -1182,7 +1189,7 @@ module KlaviyoAPI
|
|
|
1182
1189
|
# header parameters
|
|
1183
1190
|
header_params = opts[:header_params] || {}
|
|
1184
1191
|
# klaviyo api revision
|
|
1185
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1192
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1186
1193
|
# HTTP header 'Accept' (if needed)
|
|
1187
1194
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1188
1195
|
|
|
@@ -1219,7 +1226,7 @@ module KlaviyoAPI
|
|
|
1219
1226
|
alias get_metric_property_relationships_metric_with_http_info get_metric_id_for_metric_property_with_http_info
|
|
1220
1227
|
|
|
1221
1228
|
# Get Metric IDs for Custom Metric
|
|
1222
|
-
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1229
|
+
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_ids_for_custom_metric.json)
|
|
1223
1230
|
# @param id [String] The ID of the custom metric
|
|
1224
1231
|
# @param [Hash] opts the optional parameters
|
|
1225
1232
|
# @return [Hash<String, Object>]
|
|
@@ -1232,7 +1239,7 @@ module KlaviyoAPI
|
|
|
1232
1239
|
alias get_custom_metric_relationships_metrics get_metric_ids_for_custom_metric
|
|
1233
1240
|
|
|
1234
1241
|
# Get Metric IDs for Custom Metric
|
|
1235
|
-
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1242
|
+
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_ids_for_custom_metric.json)
|
|
1236
1243
|
# @param id [String] The ID of the custom metric
|
|
1237
1244
|
# @param [Hash] opts the optional parameters
|
|
1238
1245
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -1253,7 +1260,7 @@ module KlaviyoAPI
|
|
|
1253
1260
|
# header parameters
|
|
1254
1261
|
header_params = opts[:header_params] || {}
|
|
1255
1262
|
# klaviyo api revision
|
|
1256
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1263
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1257
1264
|
# HTTP header 'Accept' (if needed)
|
|
1258
1265
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1259
1266
|
|
|
@@ -1290,13 +1297,13 @@ module KlaviyoAPI
|
|
|
1290
1297
|
alias get_custom_metric_relationships_metrics_with_http_info get_metric_ids_for_custom_metric_with_http_info
|
|
1291
1298
|
|
|
1292
1299
|
# Get Metric Property
|
|
1293
|
-
# Get a metric property with the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1300
|
+
# Get a metric property with the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_property.json)
|
|
1294
1301
|
# @param id [String] The ID of the metric property
|
|
1295
1302
|
# @param [Hash] opts the optional parameters
|
|
1296
1303
|
# @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values'
|
|
1297
|
-
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1298
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1299
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1304
|
+
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1305
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1306
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1300
1307
|
# @return [Hash<String, Object>]
|
|
1301
1308
|
def get_metric_property(id, opts = {})
|
|
1302
1309
|
data, _status_code, _headers = get_metric_property_with_http_info(id, opts)
|
|
@@ -1304,13 +1311,13 @@ module KlaviyoAPI
|
|
|
1304
1311
|
end
|
|
1305
1312
|
|
|
1306
1313
|
# Get Metric Property
|
|
1307
|
-
# Get a metric property with the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1314
|
+
# Get a metric property with the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metric_property.json)
|
|
1308
1315
|
# @param id [String] The ID of the metric property
|
|
1309
1316
|
# @param [Hash] opts the optional parameters
|
|
1310
1317
|
# @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values'
|
|
1311
|
-
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1312
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1313
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1318
|
+
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1319
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1320
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1314
1321
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1315
1322
|
def get_metric_property_with_http_info(id, opts = {})
|
|
1316
1323
|
if @api_client.config.debugging
|
|
@@ -1324,11 +1331,11 @@ module KlaviyoAPI
|
|
|
1324
1331
|
if @api_client.config.client_side_validation && opts[:'additional_fields_metric_property'] && !opts[:'additional_fields_metric_property'].all? { |item| allowable_values.include?(item) }
|
|
1325
1332
|
fail ArgumentError, "invalid value for \"additional_fields_metric_property\", must include one of #{allowable_values}"
|
|
1326
1333
|
end
|
|
1327
|
-
allowable_values = ["inferred_type", "label", "property", "sample_values"]
|
|
1334
|
+
allowable_values = ["id", "inferred_type", "label", "property", "sample_values"]
|
|
1328
1335
|
if @api_client.config.client_side_validation && opts[:'fields_metric_property'] && !opts[:'fields_metric_property'].all? { |item| allowable_values.include?(item) }
|
|
1329
1336
|
fail ArgumentError, "invalid value for \"fields_metric_property\", must include one of #{allowable_values}"
|
|
1330
1337
|
end
|
|
1331
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
1338
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
1332
1339
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
1333
1340
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
1334
1341
|
end
|
|
@@ -1349,7 +1356,7 @@ module KlaviyoAPI
|
|
|
1349
1356
|
# header parameters
|
|
1350
1357
|
header_params = opts[:header_params] || {}
|
|
1351
1358
|
# klaviyo api revision
|
|
1352
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1359
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1353
1360
|
# HTTP header 'Accept' (if needed)
|
|
1354
1361
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1355
1362
|
|
|
@@ -1383,13 +1390,13 @@ module KlaviyoAPI
|
|
|
1383
1390
|
end
|
|
1384
1391
|
|
|
1385
1392
|
# Get Metrics
|
|
1386
|
-
# Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
|
1393
|
+
# Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metrics.json)
|
|
1387
1394
|
# @param [Hash] opts the optional parameters
|
|
1388
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1389
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1390
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1391
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1392
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1395
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1396
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1397
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals`
|
|
1398
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1399
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1393
1400
|
# @return [Hash<String, Object>]
|
|
1394
1401
|
def get_metrics(opts = {})
|
|
1395
1402
|
data, _status_code, _headers = get_metrics_with_http_info(opts)
|
|
@@ -1397,23 +1404,23 @@ module KlaviyoAPI
|
|
|
1397
1404
|
end
|
|
1398
1405
|
|
|
1399
1406
|
# Get Metrics
|
|
1400
|
-
# Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
|
1407
|
+
# Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metrics.json)
|
|
1401
1408
|
# @param [Hash] opts the optional parameters
|
|
1402
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1403
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1404
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1405
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1406
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1409
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1410
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1411
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals`
|
|
1412
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1413
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1407
1414
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1408
1415
|
def get_metrics_with_http_info(opts = {})
|
|
1409
1416
|
if @api_client.config.debugging
|
|
1410
1417
|
@api_client.config.logger.debug 'Calling API: MetricsApi.get_metrics ...'
|
|
1411
1418
|
end
|
|
1412
|
-
allowable_values = ["archived", "created", "name", "status", "trigger_type", "updated"]
|
|
1419
|
+
allowable_values = ["archived", "created", "id", "name", "status", "trigger_type", "updated"]
|
|
1413
1420
|
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
|
1414
1421
|
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
|
1415
1422
|
end
|
|
1416
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
1423
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
1417
1424
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
1418
1425
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
1419
1426
|
end
|
|
@@ -1435,7 +1442,7 @@ module KlaviyoAPI
|
|
|
1435
1442
|
# header parameters
|
|
1436
1443
|
header_params = opts[:header_params] || {}
|
|
1437
1444
|
# klaviyo api revision
|
|
1438
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1445
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1439
1446
|
# HTTP header 'Accept' (if needed)
|
|
1440
1447
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1441
1448
|
|
|
@@ -1469,10 +1476,10 @@ module KlaviyoAPI
|
|
|
1469
1476
|
end
|
|
1470
1477
|
|
|
1471
1478
|
# Get Metrics for Custom Metric
|
|
1472
|
-
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1479
|
+
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metrics_for_custom_metric.json)
|
|
1473
1480
|
# @param id [String] The ID of the custom metric
|
|
1474
1481
|
# @param [Hash] opts the optional parameters
|
|
1475
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1482
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1476
1483
|
# @return [Hash<String, Object>]
|
|
1477
1484
|
def get_metrics_for_custom_metric(id, opts = {})
|
|
1478
1485
|
data, _status_code, _headers = get_metrics_for_custom_metric_with_http_info(id, opts)
|
|
@@ -1483,10 +1490,10 @@ module KlaviyoAPI
|
|
|
1483
1490
|
alias get_custom_metric_metrics get_metrics_for_custom_metric
|
|
1484
1491
|
|
|
1485
1492
|
# Get Metrics for Custom Metric
|
|
1486
|
-
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1493
|
+
# Get all metrics for the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_metrics_for_custom_metric.json)
|
|
1487
1494
|
# @param id [String] The ID of the custom metric
|
|
1488
1495
|
# @param [Hash] opts the optional parameters
|
|
1489
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1496
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1490
1497
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1491
1498
|
def get_metrics_for_custom_metric_with_http_info(id, opts = {})
|
|
1492
1499
|
if @api_client.config.debugging
|
|
@@ -1496,7 +1503,7 @@ module KlaviyoAPI
|
|
|
1496
1503
|
if @api_client.config.client_side_validation && id.nil?
|
|
1497
1504
|
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metrics_for_custom_metric"
|
|
1498
1505
|
end
|
|
1499
|
-
allowable_values = ["created", "integration", "name", "updated"]
|
|
1506
|
+
allowable_values = ["created", "id", "integration", "name", "updated"]
|
|
1500
1507
|
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
|
1501
1508
|
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
|
1502
1509
|
end
|
|
@@ -1510,7 +1517,7 @@ module KlaviyoAPI
|
|
|
1510
1517
|
# header parameters
|
|
1511
1518
|
header_params = opts[:header_params] || {}
|
|
1512
1519
|
# klaviyo api revision
|
|
1513
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1520
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1514
1521
|
# HTTP header 'Accept' (if needed)
|
|
1515
1522
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1516
1523
|
|
|
@@ -1547,11 +1554,11 @@ module KlaviyoAPI
|
|
|
1547
1554
|
alias get_custom_metric_metrics_with_http_info get_metrics_for_custom_metric_with_http_info
|
|
1548
1555
|
|
|
1549
1556
|
# Get Properties for Metric
|
|
1550
|
-
# Get the metric properties for the given metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1557
|
+
# Get the metric properties for the given metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_properties_for_metric.json)
|
|
1551
1558
|
# @param id [String] The ID of the metric
|
|
1552
1559
|
# @param [Hash] opts the optional parameters
|
|
1553
1560
|
# @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values'
|
|
1554
|
-
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1561
|
+
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1555
1562
|
# @return [Hash<String, Object>]
|
|
1556
1563
|
def get_properties_for_metric(id, opts = {})
|
|
1557
1564
|
data, _status_code, _headers = get_properties_for_metric_with_http_info(id, opts)
|
|
@@ -1565,11 +1572,11 @@ module KlaviyoAPI
|
|
|
1565
1572
|
alias get_metric_properties get_properties_for_metric
|
|
1566
1573
|
|
|
1567
1574
|
# Get Properties for Metric
|
|
1568
|
-
# Get the metric properties for the given metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1575
|
+
# Get the metric properties for the given metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_properties_for_metric.json)
|
|
1569
1576
|
# @param id [String] The ID of the metric
|
|
1570
1577
|
# @param [Hash] opts the optional parameters
|
|
1571
1578
|
# @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values'
|
|
1572
|
-
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1579
|
+
# @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1573
1580
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1574
1581
|
def get_properties_for_metric_with_http_info(id, opts = {})
|
|
1575
1582
|
if @api_client.config.debugging
|
|
@@ -1583,7 +1590,7 @@ module KlaviyoAPI
|
|
|
1583
1590
|
if @api_client.config.client_side_validation && opts[:'additional_fields_metric_property'] && !opts[:'additional_fields_metric_property'].all? { |item| allowable_values.include?(item) }
|
|
1584
1591
|
fail ArgumentError, "invalid value for \"additional_fields_metric_property\", must include one of #{allowable_values}"
|
|
1585
1592
|
end
|
|
1586
|
-
allowable_values = ["inferred_type", "label", "property", "sample_values"]
|
|
1593
|
+
allowable_values = ["id", "inferred_type", "label", "property", "sample_values"]
|
|
1587
1594
|
if @api_client.config.client_side_validation && opts[:'fields_metric_property'] && !opts[:'fields_metric_property'].all? { |item| allowable_values.include?(item) }
|
|
1588
1595
|
fail ArgumentError, "invalid value for \"fields_metric_property\", must include one of #{allowable_values}"
|
|
1589
1596
|
end
|
|
@@ -1598,7 +1605,7 @@ module KlaviyoAPI
|
|
|
1598
1605
|
# header parameters
|
|
1599
1606
|
header_params = opts[:header_params] || {}
|
|
1600
1607
|
# klaviyo api revision
|
|
1601
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1608
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1602
1609
|
# HTTP header 'Accept' (if needed)
|
|
1603
1610
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1604
1611
|
|
|
@@ -1638,7 +1645,7 @@ module KlaviyoAPI
|
|
|
1638
1645
|
alias get_metric_properties_with_http_info get_properties_for_metric_with_http_info
|
|
1639
1646
|
|
|
1640
1647
|
# Get Property IDs for Metric
|
|
1641
|
-
# Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1648
|
+
# Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_property_ids_for_metric.json)
|
|
1642
1649
|
# @param id [String] The ID of the metric
|
|
1643
1650
|
# @param [Hash] opts the optional parameters
|
|
1644
1651
|
# @return [Hash<String, Object>]
|
|
@@ -1654,7 +1661,7 @@ module KlaviyoAPI
|
|
|
1654
1661
|
alias get_metric_relationships_properties get_property_ids_for_metric
|
|
1655
1662
|
|
|
1656
1663
|
# Get Property IDs for Metric
|
|
1657
|
-
# Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
|
1664
|
+
# Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_property_ids_for_metric.json)
|
|
1658
1665
|
# @param id [String] The ID of the metric
|
|
1659
1666
|
# @param [Hash] opts the optional parameters
|
|
1660
1667
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -1675,7 +1682,7 @@ module KlaviyoAPI
|
|
|
1675
1682
|
# header parameters
|
|
1676
1683
|
header_params = opts[:header_params] || {}
|
|
1677
1684
|
# klaviyo api revision
|
|
1678
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1685
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1679
1686
|
# HTTP header 'Accept' (if needed)
|
|
1680
1687
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1681
1688
|
|
|
@@ -1715,9 +1722,10 @@ module KlaviyoAPI
|
|
|
1715
1722
|
alias get_metric_relationships_properties_with_http_info get_property_ids_for_metric_with_http_info
|
|
1716
1723
|
|
|
1717
1724
|
# Query Metric Aggregates
|
|
1718
|
-
# Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events (not to be confused with [custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview), which are not supported at this time). Queries must be passed in the JSON body of your `POST` request. To request campaign and flow performance data that matches the data shown in Klaviyo's UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview). Results can be filtered and grouped by time, event, or profile dimensions. To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint). For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1725
|
+
# Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events (not to be confused with [custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview), which are not supported at this time). Queries must be passed in the JSON body of your `POST` request. To request campaign and flow performance data that matches the data shown in Klaviyo's UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview). Results can be filtered and grouped by time, event, or profile dimensions. To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint). For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/query_metric_aggregates.json)
|
|
1719
1726
|
# @param metric_aggregate_query [MetricAggregateQuery] Retrieve Metric Aggregations
|
|
1720
1727
|
# @param [Hash] opts the optional parameters
|
|
1728
|
+
# @option opts [Array<String>] :fields_metric_aggregate For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1721
1729
|
# @return [Hash<String, Object>]
|
|
1722
1730
|
def query_metric_aggregates(metric_aggregate_query, opts = {})
|
|
1723
1731
|
data, _status_code, _headers = query_metric_aggregates_with_http_info(metric_aggregate_query, opts)
|
|
@@ -1728,9 +1736,10 @@ module KlaviyoAPI
|
|
|
1728
1736
|
alias create_metric_aggregate query_metric_aggregates
|
|
1729
1737
|
|
|
1730
1738
|
# Query Metric Aggregates
|
|
1731
|
-
# Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events (not to be confused with [custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview), which are not supported at this time). Queries must be passed in the JSON body of your `POST` request. To request campaign and flow performance data that matches the data shown in Klaviyo's UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview). Results can be filtered and grouped by time, event, or profile dimensions. To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint). For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
|
1739
|
+
# Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events (not to be confused with [custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview), which are not supported at this time). Queries must be passed in the JSON body of your `POST` request. To request campaign and flow performance data that matches the data shown in Klaviyo's UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview). Results can be filtered and grouped by time, event, or profile dimensions. To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint). For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/query_metric_aggregates.json)
|
|
1732
1740
|
# @param metric_aggregate_query [MetricAggregateQuery] Retrieve Metric Aggregations
|
|
1733
1741
|
# @param [Hash] opts the optional parameters
|
|
1742
|
+
# @option opts [Array<String>] :fields_metric_aggregate For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1734
1743
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1735
1744
|
def query_metric_aggregates_with_http_info(metric_aggregate_query, opts = {})
|
|
1736
1745
|
if @api_client.config.debugging
|
|
@@ -1740,16 +1749,21 @@ module KlaviyoAPI
|
|
|
1740
1749
|
if @api_client.config.client_side_validation && metric_aggregate_query.nil?
|
|
1741
1750
|
fail ArgumentError, "Missing the required parameter 'metric_aggregate_query' when calling MetricsApi.query_metric_aggregates"
|
|
1742
1751
|
end
|
|
1752
|
+
allowable_values = ["data", "dates", "id"]
|
|
1753
|
+
if @api_client.config.client_side_validation && opts[:'fields_metric_aggregate'] && !opts[:'fields_metric_aggregate'].all? { |item| allowable_values.include?(item) }
|
|
1754
|
+
fail ArgumentError, "invalid value for \"fields_metric_aggregate\", must include one of #{allowable_values}"
|
|
1755
|
+
end
|
|
1743
1756
|
# resource path
|
|
1744
1757
|
local_var_path = '/api/metric-aggregates'
|
|
1745
1758
|
|
|
1746
1759
|
# query parameters
|
|
1747
1760
|
query_params = opts[:query_params] || {}
|
|
1761
|
+
query_params[:'fields[metric-aggregate]'] = @api_client.build_collection_param(opts[:'fields_metric_aggregate'], :csv) if !opts[:'fields_metric_aggregate'].nil?
|
|
1748
1762
|
|
|
1749
1763
|
# header parameters
|
|
1750
1764
|
header_params = opts[:header_params] || {}
|
|
1751
1765
|
# klaviyo api revision
|
|
1752
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1766
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1753
1767
|
# HTTP header 'Accept' (if needed)
|
|
1754
1768
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1755
1769
|
# HTTP header 'Content-Type'
|
|
@@ -1791,10 +1805,11 @@ module KlaviyoAPI
|
|
|
1791
1805
|
alias create_metric_aggregate_with_http_info query_metric_aggregates_with_http_info
|
|
1792
1806
|
|
|
1793
1807
|
# Update Custom Metric
|
|
1794
|
-
# Update a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write`
|
|
1808
|
+
# Update a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_custom_metric.json)
|
|
1795
1809
|
# @param id [String] The ID of the custom metric
|
|
1796
1810
|
# @param custom_metric_partial_update_query [CustomMetricPartialUpdateQuery] Update a custom metric by ID.
|
|
1797
1811
|
# @param [Hash] opts the optional parameters
|
|
1812
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1798
1813
|
# @return [Hash<String, Object>]
|
|
1799
1814
|
def update_custom_metric(id, custom_metric_partial_update_query, opts = {})
|
|
1800
1815
|
data, _status_code, _headers = update_custom_metric_with_http_info(id, custom_metric_partial_update_query, opts)
|
|
@@ -1802,10 +1817,11 @@ module KlaviyoAPI
|
|
|
1802
1817
|
end
|
|
1803
1818
|
|
|
1804
1819
|
# Update Custom Metric
|
|
1805
|
-
# Update a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write`
|
|
1820
|
+
# Update a custom metric with the given custom metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `15/d` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_custom_metric.json)
|
|
1806
1821
|
# @param id [String] The ID of the custom metric
|
|
1807
1822
|
# @param custom_metric_partial_update_query [CustomMetricPartialUpdateQuery] Update a custom metric by ID.
|
|
1808
1823
|
# @param [Hash] opts the optional parameters
|
|
1824
|
+
# @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1809
1825
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1810
1826
|
def update_custom_metric_with_http_info(id, custom_metric_partial_update_query, opts = {})
|
|
1811
1827
|
if @api_client.config.debugging
|
|
@@ -1819,16 +1835,21 @@ module KlaviyoAPI
|
|
|
1819
1835
|
if @api_client.config.client_side_validation && custom_metric_partial_update_query.nil?
|
|
1820
1836
|
fail ArgumentError, "Missing the required parameter 'custom_metric_partial_update_query' when calling MetricsApi.update_custom_metric"
|
|
1821
1837
|
end
|
|
1838
|
+
allowable_values = ["created", "definition", "definition.aggregation_method", "definition.metric_groups", "id", "name", "updated"]
|
|
1839
|
+
if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
|
|
1840
|
+
fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
|
|
1841
|
+
end
|
|
1822
1842
|
# resource path
|
|
1823
1843
|
local_var_path = '/api/custom-metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1824
1844
|
|
|
1825
1845
|
# query parameters
|
|
1826
1846
|
query_params = opts[:query_params] || {}
|
|
1847
|
+
query_params[:'fields[custom-metric]'] = @api_client.build_collection_param(opts[:'fields_custom_metric'], :csv) if !opts[:'fields_custom_metric'].nil?
|
|
1827
1848
|
|
|
1828
1849
|
# header parameters
|
|
1829
1850
|
header_params = opts[:header_params] || {}
|
|
1830
1851
|
# klaviyo api revision
|
|
1831
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1852
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1832
1853
|
# HTTP header 'Accept' (if needed)
|
|
1833
1854
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1834
1855
|
# HTTP header 'Content-Type'
|
|
@@ -1867,10 +1888,11 @@ module KlaviyoAPI
|
|
|
1867
1888
|
end
|
|
1868
1889
|
|
|
1869
1890
|
# Update Mapped Metric
|
|
1870
|
-
# Update the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `30/d` **Scopes:** `metrics:write`
|
|
1891
|
+
# Update the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `30/d` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_mapped_metric.json)
|
|
1871
1892
|
# @param id [String] The type of mapping.
|
|
1872
1893
|
# @param mapped_metric_partial_update_query [MappedMetricPartialUpdateQuery] Update a mapped metric by ID
|
|
1873
1894
|
# @param [Hash] opts the optional parameters
|
|
1895
|
+
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1874
1896
|
# @return [Hash<String, Object>]
|
|
1875
1897
|
def update_mapped_metric(id, mapped_metric_partial_update_query, opts = {})
|
|
1876
1898
|
data, _status_code, _headers = update_mapped_metric_with_http_info(id, mapped_metric_partial_update_query, opts)
|
|
@@ -1878,10 +1900,11 @@ module KlaviyoAPI
|
|
|
1878
1900
|
end
|
|
1879
1901
|
|
|
1880
1902
|
# Update Mapped Metric
|
|
1881
|
-
# Update the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `30/d` **Scopes:** `metrics:write`
|
|
1903
|
+
# Update the mapped metric with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m`<br>Daily: `30/d` **Scopes:** `metrics:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_mapped_metric.json)
|
|
1882
1904
|
# @param id [String] The type of mapping.
|
|
1883
1905
|
# @param mapped_metric_partial_update_query [MappedMetricPartialUpdateQuery] Update a mapped metric by ID
|
|
1884
1906
|
# @param [Hash] opts the optional parameters
|
|
1907
|
+
# @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1885
1908
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1886
1909
|
def update_mapped_metric_with_http_info(id, mapped_metric_partial_update_query, opts = {})
|
|
1887
1910
|
if @api_client.config.debugging
|
|
@@ -1900,16 +1923,21 @@ module KlaviyoAPI
|
|
|
1900
1923
|
if @api_client.config.client_side_validation && mapped_metric_partial_update_query.nil?
|
|
1901
1924
|
fail ArgumentError, "Missing the required parameter 'mapped_metric_partial_update_query' when calling MetricsApi.update_mapped_metric"
|
|
1902
1925
|
end
|
|
1926
|
+
allowable_values = ["id", "updated"]
|
|
1927
|
+
if @api_client.config.client_side_validation && opts[:'fields_mapped_metric'] && !opts[:'fields_mapped_metric'].all? { |item| allowable_values.include?(item) }
|
|
1928
|
+
fail ArgumentError, "invalid value for \"fields_mapped_metric\", must include one of #{allowable_values}"
|
|
1929
|
+
end
|
|
1903
1930
|
# resource path
|
|
1904
1931
|
local_var_path = '/api/mapped-metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1905
1932
|
|
|
1906
1933
|
# query parameters
|
|
1907
1934
|
query_params = opts[:query_params] || {}
|
|
1935
|
+
query_params[:'fields[mapped-metric]'] = @api_client.build_collection_param(opts[:'fields_mapped_metric'], :csv) if !opts[:'fields_mapped_metric'].nil?
|
|
1908
1936
|
|
|
1909
1937
|
# header parameters
|
|
1910
1938
|
header_params = opts[:header_params] || {}
|
|
1911
1939
|
# klaviyo api revision
|
|
1912
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1940
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1913
1941
|
# HTTP header 'Accept' (if needed)
|
|
1914
1942
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1915
1943
|
# HTTP header 'Content-Type'
|