klaviyo-api-sdk 13.0.1 → 14.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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +434 -286
  4. data/klaviyo-api-sdk.gemspec +1 -1
  5. data/lib/klaviyo-api-sdk/api/accounts_api.rb +6 -6
  6. data/lib/klaviyo-api-sdk/api/campaigns_api.rb +82 -82
  7. data/lib/klaviyo-api-sdk/api/catalogs_api.rb +235 -235
  8. data/lib/klaviyo-api-sdk/api/coupons_api.rb +63 -63
  9. data/lib/klaviyo-api-sdk/api/custom_objects_api.rb +384 -0
  10. data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +1 -1
  11. data/lib/klaviyo-api-sdk/api/events_api.rb +34 -34
  12. data/lib/klaviyo-api-sdk/api/flows_api.rb +93 -93
  13. data/lib/klaviyo-api-sdk/api/forms_api.rb +40 -40
  14. data/lib/klaviyo-api-sdk/api/images_api.rb +15 -15
  15. data/lib/klaviyo-api-sdk/api/lists_api.rb +59 -59
  16. data/lib/klaviyo-api-sdk/api/metrics_api.rb +643 -59
  17. data/lib/klaviyo-api-sdk/api/profiles_api.rb +128 -128
  18. data/lib/klaviyo-api-sdk/api/reporting_api.rb +13 -13
  19. data/lib/klaviyo-api-sdk/api/reviews_api.rb +21 -21
  20. data/lib/klaviyo-api-sdk/api/segments_api.rb +53 -53
  21. data/lib/klaviyo-api-sdk/api/tags_api.rb +58 -58
  22. data/lib/klaviyo-api-sdk/api/templates_api.rb +36 -36
  23. data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +15 -15
  24. data/lib/klaviyo-api-sdk/api/web_feeds_api.rb +15 -15
  25. data/lib/klaviyo-api-sdk/api/webhooks_api.rb +15 -15
  26. data/lib/klaviyo-api-sdk/api_client.rb +1 -1
  27. data/lib/klaviyo-api-sdk/models/base_event_create_query_bulk_entry_resource_object_attributes.rb +1 -1
  28. data/lib/klaviyo-api-sdk/models/button_block.rb +247 -0
  29. data/lib/klaviyo-api-sdk/models/{custom_object_property_enum.rb → button_enum.rb} +4 -4
  30. data/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes_timeframe.rb +1 -1
  31. data/lib/klaviyo-api-sdk/models/condition_group_conditions_inner.rb +3 -0
  32. data/lib/klaviyo-api-sdk/models/conditional_branch_action_data_profile_filter_condition_groups_inner_conditions_inner.rb +1 -0
  33. data/lib/klaviyo-api-sdk/models/data_source_create_query.rb +223 -0
  34. data/lib/klaviyo-api-sdk/models/data_source_create_query_resource_object.rb +237 -0
  35. data/lib/klaviyo-api-sdk/models/data_source_create_query_resource_object_attributes.rb +284 -0
  36. data/lib/klaviyo-api-sdk/models/data_source_enum.rb +35 -0
  37. data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query.rb +223 -0
  38. data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object.rb +246 -0
  39. data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object_attributes.rb +219 -0
  40. data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object_relationships.rb +218 -0
  41. data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_create_query_resource_object_relationships_data_source.rb +218 -0
  42. data/lib/klaviyo-api-sdk/models/data_source_record_bulk_create_job_enum.rb +35 -0
  43. data/lib/klaviyo-api-sdk/models/data_source_record_enum.rb +35 -0
  44. data/lib/klaviyo-api-sdk/models/data_source_record_resource_object.rb +237 -0
  45. data/lib/klaviyo-api-sdk/models/data_source_record_resource_object_attributes.rb +223 -0
  46. data/lib/klaviyo-api-sdk/models/drop_shadow_block.rb +247 -0
  47. data/lib/klaviyo-api-sdk/models/drop_shadow_enum.rb +35 -0
  48. data/lib/klaviyo-api-sdk/models/{trigger_branch_action_data_trigger_filter.rb → dsr_bulk_create_attrs_data_source_records.rb} +15 -14
  49. data/lib/klaviyo-api-sdk/models/dsr_bulk_create_rels_data_source_data.rb +238 -0
  50. data/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +1 -1
  51. data/lib/klaviyo-api-sdk/models/flow_definition_profile_filter_condition_groups_inner_conditions_inner.rb +1 -0
  52. data/lib/klaviyo-api-sdk/models/flow_email_additional_filters_condition_groups_inner_conditions_inner.rb +1 -0
  53. data/lib/klaviyo-api-sdk/models/flow_push_notification_additional_filters_condition_groups_inner_conditions_inner.rb +1 -0
  54. data/lib/klaviyo-api-sdk/models/flow_sms_additional_filters_condition_groups_inner_conditions_inner.rb +1 -0
  55. data/lib/klaviyo-api-sdk/models/horizontal_rule_block.rb +247 -0
  56. data/lib/klaviyo-api-sdk/models/horizontal_rule_enum.rb +35 -0
  57. data/lib/klaviyo-api-sdk/models/image_block.rb +247 -0
  58. data/lib/klaviyo-api-sdk/models/mapped_metric_enum.rb +35 -0
  59. data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query.rb +223 -0
  60. data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object.rb +281 -0
  61. data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships.rb +227 -0
  62. data/lib/klaviyo-api-sdk/models/{trigger_branch_action_data_trigger_filter_condition_groups_inner.rb → mapped_metric_partial_update_query_resource_object_relationships_custom_metric.rb} +10 -17
  63. data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships_custom_metric_data.rb +238 -0
  64. data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships_metric.rb +218 -0
  65. data/lib/klaviyo-api-sdk/models/mapped_metric_partial_update_query_resource_object_relationships_metric_data.rb +238 -0
  66. data/lib/klaviyo-api-sdk/models/priority_enum.rb +35 -0
  67. data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb +327 -0
  68. data/lib/klaviyo-api-sdk/models/{custom_object_property_condition.rb → profile_predictive_analytics_channel_affinity_priority_filter.rb} +23 -37
  69. data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_condition.rb +327 -0
  70. data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_filter.rb +286 -0
  71. data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_date_condition.rb +286 -0
  72. data/lib/klaviyo-api-sdk/models/rank_enum.rb +35 -0
  73. data/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes_timeframe.rb +1 -1
  74. data/lib/klaviyo-api-sdk/models/spacer_block.rb +247 -0
  75. data/lib/klaviyo-api-sdk/models/spacer_enum.rb +35 -0
  76. data/lib/klaviyo-api-sdk/models/trigger_branch_action_data.rb +6 -2
  77. data/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes_definition.rb +5 -0
  78. data/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes_definition.rb +5 -0
  79. data/lib/klaviyo-api-sdk.rb +40 -5
  80. data/lib/klaviyo-api-sdk.rb.bak +974 -0
  81. metadata +43 -7
  82. data/lib/klaviyo-api-sdk/models/trigger_branch_action_data_trigger_filter_condition_groups_inner_conditions_inner.rb +0 -106
@@ -50,7 +50,7 @@ module KlaviyoAPI
50
50
  # header parameters
51
51
  header_params = opts[:header_params] || {}
52
52
  # klaviyo api revision
53
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
53
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
54
54
  # HTTP header 'Accept' (if needed)
55
55
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
56
56
  # HTTP header 'Content-Type'
@@ -120,7 +120,7 @@ module KlaviyoAPI
120
120
  # header parameters
121
121
  header_params = opts[:header_params] || {}
122
122
  # klaviyo api revision
123
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
123
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
124
124
  # HTTP header 'Accept' (if needed)
125
125
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
126
126
 
@@ -157,9 +157,9 @@ module KlaviyoAPI
157
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`
158
158
  # @param id [String] The ID of the custom metric
159
159
  # @param [Hash] opts the optional parameters
160
- # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
161
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
162
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
160
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
161
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
162
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
163
163
  # @return [Hash<String, Object>]
164
164
  def get_custom_metric(id, opts = {})
165
165
  data, _status_code, _headers = get_custom_metric_with_http_info(id, opts)
@@ -170,9 +170,9 @@ module KlaviyoAPI
170
170
  # Get a custom metric with the given custom metric ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
171
171
  # @param id [String] The ID of the custom metric
172
172
  # @param [Hash] opts the optional parameters
173
- # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
174
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
175
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
173
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
174
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
175
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
176
176
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
177
177
  def get_custom_metric_with_http_info(id, opts = {})
178
178
  if @api_client.config.debugging
@@ -206,7 +206,7 @@ module KlaviyoAPI
206
206
  # header parameters
207
207
  header_params = opts[:header_params] || {}
208
208
  # klaviyo api revision
209
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
209
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
210
210
  # HTTP header 'Accept' (if needed)
211
211
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
212
212
 
@@ -239,12 +239,171 @@ module KlaviyoAPI
239
239
  return data, status_code, headers
240
240
  end
241
241
 
242
+ # 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`
244
+ # @param id [String] The type of mapping.
245
+ # @param [Hash] opts the optional parameters
246
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
247
+ # @return [Hash<String, Object>]
248
+ def get_custom_metric_for_mapped_metric(id, opts = {})
249
+ data, _status_code, _headers = get_custom_metric_for_mapped_metric_with_http_info(id, opts)
250
+ data
251
+ end
252
+
253
+ # alias of `get_custom_metric_for_mapped_metric`
254
+ alias get_mapped_metric_custom_metric get_custom_metric_for_mapped_metric
255
+
256
+ # Get Custom Metric for Mapped Metric
257
+ # Get the custom metric for the given mapped metric ID (if applicable).&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
258
+ # @param id [String] The type of mapping.
259
+ # @param [Hash] opts the optional parameters
260
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
261
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
262
+ def get_custom_metric_for_mapped_metric_with_http_info(id, opts = {})
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_custom_metric_for_mapped_metric ...'
265
+ end
266
+ # verify the required parameter 'id' is set
267
+ if @api_client.config.client_side_validation && id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_custom_metric_for_mapped_metric"
269
+ end
270
+ # verify enum value
271
+ allowable_values = ["added_to_cart", "cancelled_sales", "ordered_product", "refunded_sales", "revenue", "started_checkout", "viewed_product"]
272
+ if @api_client.config.client_side_validation && !allowable_values.include?(id)
273
+ fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
274
+ end
275
+ allowable_values = ["name", "created", "updated", "definition", "definition.aggregation_method", "definition.metric_groups"]
276
+ if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
277
+ fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
278
+ end
279
+ # resource path
280
+ local_var_path = '/api/mapped-metrics/{id}/custom-metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
281
+
282
+ # query parameters
283
+ query_params = opts[:query_params] || {}
284
+ query_params[:'fields[custom-metric]'] = @api_client.build_collection_param(opts[:'fields_custom_metric'], :csv) if !opts[:'fields_custom_metric'].nil?
285
+
286
+ # header parameters
287
+ header_params = opts[:header_params] || {}
288
+ # klaviyo api revision
289
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
290
+ # HTTP header 'Accept' (if needed)
291
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
292
+
293
+ # form parameters
294
+ form_params = opts[:form_params] || {}
295
+
296
+ # http body (model)
297
+ post_body = opts[:debug_body]
298
+
299
+ # return_type
300
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
301
+
302
+ # auth_names
303
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
304
+
305
+ new_options = opts.merge(
306
+ :operation => :"MetricsApi.get_custom_metric_for_mapped_metric",
307
+ :header_params => header_params,
308
+ :query_params => query_params,
309
+ :form_params => form_params,
310
+ :body => post_body,
311
+ :auth_names => auth_names,
312
+ :return_type => return_type
313
+ )
314
+
315
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
316
+ if @api_client.config.debugging
317
+ @api_client.config.logger.debug "API called: MetricsApi#get_custom_metric_for_mapped_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
318
+ end
319
+ return data, status_code, headers
320
+ end
321
+
322
+ # alias of `get_custom_metric_for_mapped_metric_with_http_info`
323
+ alias get_mapped_metric_custom_metric_with_http_info get_custom_metric_for_mapped_metric_with_http_info
324
+
325
+ # 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`
327
+ # @param id [String] The type of mapping.
328
+ # @param [Hash] opts the optional parameters
329
+ # @return [Hash<String, Object>]
330
+ def get_custom_metric_id_for_mapped_metric(id, opts = {})
331
+ data, _status_code, _headers = get_custom_metric_id_for_mapped_metric_with_http_info(id, opts)
332
+ data
333
+ end
334
+
335
+ # alias of `get_custom_metric_id_for_mapped_metric`
336
+ alias get_mapped_metric_relationships_custom_metric get_custom_metric_id_for_mapped_metric
337
+
338
+ # Get Custom Metric ID for Mapped Metric
339
+ # Get the ID of the custom metric for the given mapped metric.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
340
+ # @param id [String] The type of mapping.
341
+ # @param [Hash] opts the optional parameters
342
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
343
+ def get_custom_metric_id_for_mapped_metric_with_http_info(id, opts = {})
344
+ if @api_client.config.debugging
345
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_custom_metric_id_for_mapped_metric ...'
346
+ end
347
+ # verify the required parameter 'id' is set
348
+ if @api_client.config.client_side_validation && id.nil?
349
+ fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_custom_metric_id_for_mapped_metric"
350
+ end
351
+ # verify enum value
352
+ allowable_values = ["added_to_cart", "cancelled_sales", "ordered_product", "refunded_sales", "revenue", "started_checkout", "viewed_product"]
353
+ if @api_client.config.client_side_validation && !allowable_values.include?(id)
354
+ fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
355
+ end
356
+ # resource path
357
+ local_var_path = '/api/mapped-metrics/{id}/relationships/custom-metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
358
+
359
+ # query parameters
360
+ query_params = opts[:query_params] || {}
361
+
362
+ # header parameters
363
+ header_params = opts[:header_params] || {}
364
+ # klaviyo api revision
365
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
366
+ # HTTP header 'Accept' (if needed)
367
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
368
+
369
+ # form parameters
370
+ form_params = opts[:form_params] || {}
371
+
372
+ # http body (model)
373
+ post_body = opts[:debug_body]
374
+
375
+ # return_type
376
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
377
+
378
+ # auth_names
379
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
380
+
381
+ new_options = opts.merge(
382
+ :operation => :"MetricsApi.get_custom_metric_id_for_mapped_metric",
383
+ :header_params => header_params,
384
+ :query_params => query_params,
385
+ :form_params => form_params,
386
+ :body => post_body,
387
+ :auth_names => auth_names,
388
+ :return_type => return_type
389
+ )
390
+
391
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug "API called: MetricsApi#get_custom_metric_id_for_mapped_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
394
+ end
395
+ return data, status_code, headers
396
+ end
397
+
398
+ # alias of `get_custom_metric_id_for_mapped_metric_with_http_info`
399
+ alias get_mapped_metric_relationships_custom_metric_with_http_info get_custom_metric_id_for_mapped_metric_with_http_info
400
+
242
401
  # Get Custom Metrics
243
402
  # Get all custom metrics in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
244
403
  # @param [Hash] opts the optional parameters
245
- # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
246
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
247
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
404
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
405
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
406
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
248
407
  # @return [Hash<String, Object>]
249
408
  def get_custom_metrics(opts = {})
250
409
  data, _status_code, _headers = get_custom_metrics_with_http_info(opts)
@@ -254,9 +413,9 @@ module KlaviyoAPI
254
413
  # Get Custom Metrics
255
414
  # Get all custom metrics in an account.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
256
415
  # @param [Hash] opts the optional parameters
257
- # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
258
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
259
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
416
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
417
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
418
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
260
419
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
261
420
  def get_custom_metrics_with_http_info(opts = {})
262
421
  if @api_client.config.debugging
@@ -286,7 +445,7 @@ module KlaviyoAPI
286
445
  # header parameters
287
446
  header_params = opts[:header_params] || {}
288
447
  # klaviyo api revision
289
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
448
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
290
449
  # HTTP header 'Accept' (if needed)
291
450
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
292
451
 
@@ -323,7 +482,7 @@ module KlaviyoAPI
323
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`
324
483
  # @param id [String]
325
484
  # @param [Hash] opts the optional parameters
326
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
485
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
327
486
  # @return [Hash<String, Object>]
328
487
  def get_flows_triggered_by_metric(id, opts = {})
329
488
  data, _status_code, _headers = get_flows_triggered_by_metric_with_http_info(id, opts)
@@ -340,7 +499,7 @@ module KlaviyoAPI
340
499
  # Get all flows where the given metric is being used as the trigger.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;10/s&#x60;&lt;br&gt;Steady: &#x60;150/m&#x60; **Scopes:** &#x60;flows:read&#x60; &#x60;metrics:read&#x60;
341
500
  # @param id [String]
342
501
  # @param [Hash] opts the optional parameters
343
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
502
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
344
503
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
345
504
  def get_flows_triggered_by_metric_with_http_info(id, opts = {})
346
505
  if @api_client.config.debugging
@@ -364,7 +523,7 @@ module KlaviyoAPI
364
523
  # header parameters
365
524
  header_params = opts[:header_params] || {}
366
525
  # klaviyo api revision
367
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
526
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
368
527
  # HTTP header 'Accept' (if needed)
369
528
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
370
529
 
@@ -441,7 +600,7 @@ module KlaviyoAPI
441
600
  # header parameters
442
601
  header_params = opts[:header_params] || {}
443
602
  # klaviyo api revision
444
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
603
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
445
604
  # HTTP header 'Accept' (if needed)
446
605
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
447
606
 
@@ -480,13 +639,198 @@ module KlaviyoAPI
480
639
  # alias of `get_ids_for_flows_triggered_by_metric_with_http_info`
481
640
  alias get_metric_relationships_flow_triggers_with_http_info get_ids_for_flows_triggered_by_metric_with_http_info
482
641
 
642
+ # 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`
644
+ # @param id [String] The type of mapping.
645
+ # @param [Hash] opts the optional parameters
646
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
647
+ # @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
648
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
649
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
650
+ # @return [Hash<String, Object>]
651
+ def get_mapped_metric(id, opts = {})
652
+ data, _status_code, _headers = get_mapped_metric_with_http_info(id, opts)
653
+ data
654
+ end
655
+
656
+ # Get Mapped Metric
657
+ # Get the mapped metric with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
658
+ # @param id [String] The type of mapping.
659
+ # @param [Hash] opts the optional parameters
660
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
661
+ # @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
662
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
663
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
664
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
665
+ def get_mapped_metric_with_http_info(id, opts = {})
666
+ if @api_client.config.debugging
667
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_mapped_metric ...'
668
+ end
669
+ # verify the required parameter 'id' is set
670
+ if @api_client.config.client_side_validation && id.nil?
671
+ fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_mapped_metric"
672
+ end
673
+ # verify enum value
674
+ allowable_values = ["added_to_cart", "cancelled_sales", "ordered_product", "refunded_sales", "revenue", "started_checkout", "viewed_product"]
675
+ if @api_client.config.client_side_validation && !allowable_values.include?(id)
676
+ fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
677
+ end
678
+ allowable_values = ["name", "created", "updated", "definition", "definition.aggregation_method", "definition.metric_groups"]
679
+ if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
680
+ fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
681
+ end
682
+ allowable_values = ["updated"]
683
+ if @api_client.config.client_side_validation && opts[:'fields_mapped_metric'] && !opts[:'fields_mapped_metric'].all? { |item| allowable_values.include?(item) }
684
+ fail ArgumentError, "invalid value for \"fields_mapped_metric\", must include one of #{allowable_values}"
685
+ end
686
+ allowable_values = ["name", "created", "updated", "integration"]
687
+ if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
688
+ fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
689
+ end
690
+ allowable_values = ["custom-metric", "metric"]
691
+ if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
692
+ fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
693
+ end
694
+ # resource path
695
+ local_var_path = '/api/mapped-metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
696
+
697
+ # query parameters
698
+ query_params = opts[:query_params] || {}
699
+ query_params[:'fields[custom-metric]'] = @api_client.build_collection_param(opts[:'fields_custom_metric'], :csv) if !opts[:'fields_custom_metric'].nil?
700
+ query_params[:'fields[mapped-metric]'] = @api_client.build_collection_param(opts[:'fields_mapped_metric'], :csv) if !opts[:'fields_mapped_metric'].nil?
701
+ query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
702
+ query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
703
+
704
+ # header parameters
705
+ header_params = opts[:header_params] || {}
706
+ # klaviyo api revision
707
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
708
+ # HTTP header 'Accept' (if needed)
709
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
710
+
711
+ # form parameters
712
+ form_params = opts[:form_params] || {}
713
+
714
+ # http body (model)
715
+ post_body = opts[:debug_body]
716
+
717
+ # return_type
718
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
719
+
720
+ # auth_names
721
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
722
+
723
+ new_options = opts.merge(
724
+ :operation => :"MetricsApi.get_mapped_metric",
725
+ :header_params => header_params,
726
+ :query_params => query_params,
727
+ :form_params => form_params,
728
+ :body => post_body,
729
+ :auth_names => auth_names,
730
+ :return_type => return_type
731
+ )
732
+
733
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
734
+ if @api_client.config.debugging
735
+ @api_client.config.logger.debug "API called: MetricsApi#get_mapped_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
736
+ end
737
+ return data, status_code, headers
738
+ end
739
+
740
+ # 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`
742
+ # @param [Hash] opts the optional parameters
743
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
744
+ # @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
745
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
746
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
747
+ # @return [Hash<String, Object>]
748
+ def get_mapped_metrics(opts = {})
749
+ data, _status_code, _headers = get_mapped_metrics_with_http_info(opts)
750
+ data
751
+ end
752
+
753
+ # Get Mapped Metrics
754
+ # Get all mapped metrics in an account.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
755
+ # @param [Hash] opts the optional parameters
756
+ # @option opts [Array<String>] :fields_custom_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
757
+ # @option opts [Array<String>] :fields_mapped_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
758
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
759
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
760
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
761
+ def get_mapped_metrics_with_http_info(opts = {})
762
+ if @api_client.config.debugging
763
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_mapped_metrics ...'
764
+ end
765
+ allowable_values = ["name", "created", "updated", "definition", "definition.aggregation_method", "definition.metric_groups"]
766
+ if @api_client.config.client_side_validation && opts[:'fields_custom_metric'] && !opts[:'fields_custom_metric'].all? { |item| allowable_values.include?(item) }
767
+ fail ArgumentError, "invalid value for \"fields_custom_metric\", must include one of #{allowable_values}"
768
+ end
769
+ allowable_values = ["updated"]
770
+ if @api_client.config.client_side_validation && opts[:'fields_mapped_metric'] && !opts[:'fields_mapped_metric'].all? { |item| allowable_values.include?(item) }
771
+ fail ArgumentError, "invalid value for \"fields_mapped_metric\", must include one of #{allowable_values}"
772
+ end
773
+ allowable_values = ["name", "created", "updated", "integration"]
774
+ if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
775
+ fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
776
+ end
777
+ allowable_values = ["custom-metric", "metric"]
778
+ if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
779
+ fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
780
+ end
781
+ # resource path
782
+ local_var_path = '/api/mapped-metrics'
783
+
784
+ # query parameters
785
+ query_params = opts[:query_params] || {}
786
+ query_params[:'fields[custom-metric]'] = @api_client.build_collection_param(opts[:'fields_custom_metric'], :csv) if !opts[:'fields_custom_metric'].nil?
787
+ query_params[:'fields[mapped-metric]'] = @api_client.build_collection_param(opts[:'fields_mapped_metric'], :csv) if !opts[:'fields_mapped_metric'].nil?
788
+ query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
789
+ query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
790
+
791
+ # header parameters
792
+ header_params = opts[:header_params] || {}
793
+ # klaviyo api revision
794
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
795
+ # HTTP header 'Accept' (if needed)
796
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
797
+
798
+ # form parameters
799
+ form_params = opts[:form_params] || {}
800
+
801
+ # http body (model)
802
+ post_body = opts[:debug_body]
803
+
804
+ # return_type
805
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
806
+
807
+ # auth_names
808
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
809
+
810
+ new_options = opts.merge(
811
+ :operation => :"MetricsApi.get_mapped_metrics",
812
+ :header_params => header_params,
813
+ :query_params => query_params,
814
+ :form_params => form_params,
815
+ :body => post_body,
816
+ :auth_names => auth_names,
817
+ :return_type => return_type
818
+ )
819
+
820
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
821
+ if @api_client.config.debugging
822
+ @api_client.config.logger.debug "API called: MetricsApi#get_mapped_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
823
+ end
824
+ return data, status_code, headers
825
+ end
826
+
483
827
  # Get Metric
484
828
  # Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
485
829
  # @param id [String] Metric ID
486
830
  # @param [Hash] opts the optional parameters
487
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
488
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
489
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
831
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
832
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
833
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
490
834
  # @return [Hash<String, Object>]
491
835
  def get_metric(id, opts = {})
492
836
  data, _status_code, _headers = get_metric_with_http_info(id, opts)
@@ -497,9 +841,9 @@ module KlaviyoAPI
497
841
  # Get a metric with the given metric ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;10/s&#x60;&lt;br&gt;Steady: &#x60;150/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
498
842
  # @param id [String] Metric ID
499
843
  # @param [Hash] opts the optional parameters
500
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
501
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
502
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
844
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
845
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
846
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
503
847
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
504
848
  def get_metric_with_http_info(id, opts = {})
505
849
  if @api_client.config.debugging
@@ -533,7 +877,7 @@ module KlaviyoAPI
533
877
  # header parameters
534
878
  header_params = opts[:header_params] || {}
535
879
  # klaviyo api revision
536
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
880
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
537
881
  # HTTP header 'Accept' (if needed)
538
882
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
539
883
 
@@ -566,11 +910,94 @@ module KlaviyoAPI
566
910
  return data, status_code, headers
567
911
  end
568
912
 
913
+ # 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`
915
+ # @param id [String] The type of mapping.
916
+ # @param [Hash] opts the optional parameters
917
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
918
+ # @return [Hash<String, Object>]
919
+ def get_metric_for_mapped_metric(id, opts = {})
920
+ data, _status_code, _headers = get_metric_for_mapped_metric_with_http_info(id, opts)
921
+ data
922
+ end
923
+
924
+ # alias of `get_metric_for_mapped_metric`
925
+ alias get_mapped_metric_metric get_metric_for_mapped_metric
926
+
927
+ # Get Metric for Mapped Metric
928
+ # Get the metric for the given mapped metric ID (if applicable).&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
929
+ # @param id [String] The type of mapping.
930
+ # @param [Hash] opts the optional parameters
931
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
932
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
933
+ def get_metric_for_mapped_metric_with_http_info(id, opts = {})
934
+ if @api_client.config.debugging
935
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_for_mapped_metric ...'
936
+ end
937
+ # verify the required parameter 'id' is set
938
+ if @api_client.config.client_side_validation && id.nil?
939
+ fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_for_mapped_metric"
940
+ end
941
+ # verify enum value
942
+ allowable_values = ["added_to_cart", "cancelled_sales", "ordered_product", "refunded_sales", "revenue", "started_checkout", "viewed_product"]
943
+ if @api_client.config.client_side_validation && !allowable_values.include?(id)
944
+ fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
945
+ end
946
+ allowable_values = ["name", "created", "updated", "integration"]
947
+ if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
948
+ fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
949
+ end
950
+ # resource path
951
+ local_var_path = '/api/mapped-metrics/{id}/metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
952
+
953
+ # query parameters
954
+ query_params = opts[:query_params] || {}
955
+ query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
956
+
957
+ # header parameters
958
+ header_params = opts[:header_params] || {}
959
+ # klaviyo api revision
960
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
961
+ # HTTP header 'Accept' (if needed)
962
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
963
+
964
+ # form parameters
965
+ form_params = opts[:form_params] || {}
966
+
967
+ # http body (model)
968
+ post_body = opts[:debug_body]
969
+
970
+ # return_type
971
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
972
+
973
+ # auth_names
974
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
975
+
976
+ new_options = opts.merge(
977
+ :operation => :"MetricsApi.get_metric_for_mapped_metric",
978
+ :header_params => header_params,
979
+ :query_params => query_params,
980
+ :form_params => form_params,
981
+ :body => post_body,
982
+ :auth_names => auth_names,
983
+ :return_type => return_type
984
+ )
985
+
986
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
987
+ if @api_client.config.debugging
988
+ @api_client.config.logger.debug "API called: MetricsApi#get_metric_for_mapped_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
989
+ end
990
+ return data, status_code, headers
991
+ end
992
+
993
+ # alias of `get_metric_for_mapped_metric_with_http_info`
994
+ alias get_mapped_metric_metric_with_http_info get_metric_for_mapped_metric_with_http_info
995
+
569
996
  # Get Metric for Metric Property
570
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`
571
998
  # @param id [String] The ID of the metric property
572
999
  # @param [Hash] opts the optional parameters
573
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
1000
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
574
1001
  # @return [Hash<String, Object>]
575
1002
  def get_metric_for_metric_property(id, opts = {})
576
1003
  data, _status_code, _headers = get_metric_for_metric_property_with_http_info(id, opts)
@@ -584,7 +1011,7 @@ module KlaviyoAPI
584
1011
  # Get the metric for the given metric property ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
585
1012
  # @param id [String] The ID of the metric property
586
1013
  # @param [Hash] opts the optional parameters
587
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
1014
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
588
1015
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
589
1016
  def get_metric_for_metric_property_with_http_info(id, opts = {})
590
1017
  if @api_client.config.debugging
@@ -608,7 +1035,7 @@ module KlaviyoAPI
608
1035
  # header parameters
609
1036
  header_params = opts[:header_params] || {}
610
1037
  # klaviyo api revision
611
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1038
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
612
1039
  # HTTP header 'Accept' (if needed)
613
1040
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
614
1041
 
@@ -644,6 +1071,82 @@ module KlaviyoAPI
644
1071
  # alias of `get_metric_for_metric_property_with_http_info`
645
1072
  alias get_metric_property_metric_with_http_info get_metric_for_metric_property_with_http_info
646
1073
 
1074
+ # 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`
1076
+ # @param id [String] The type of mapping.
1077
+ # @param [Hash] opts the optional parameters
1078
+ # @return [Hash<String, Object>]
1079
+ def get_metric_id_for_mapped_metric(id, opts = {})
1080
+ data, _status_code, _headers = get_metric_id_for_mapped_metric_with_http_info(id, opts)
1081
+ data
1082
+ end
1083
+
1084
+ # alias of `get_metric_id_for_mapped_metric`
1085
+ alias get_mapped_metric_relationships_metric get_metric_id_for_mapped_metric
1086
+
1087
+ # Get Metric ID for Mapped Metric
1088
+ # Get the ID of the metric for the given mapped metric.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
1089
+ # @param id [String] The type of mapping.
1090
+ # @param [Hash] opts the optional parameters
1091
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
1092
+ def get_metric_id_for_mapped_metric_with_http_info(id, opts = {})
1093
+ if @api_client.config.debugging
1094
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_id_for_mapped_metric ...'
1095
+ end
1096
+ # verify the required parameter 'id' is set
1097
+ if @api_client.config.client_side_validation && id.nil?
1098
+ fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_id_for_mapped_metric"
1099
+ end
1100
+ # verify enum value
1101
+ allowable_values = ["added_to_cart", "cancelled_sales", "ordered_product", "refunded_sales", "revenue", "started_checkout", "viewed_product"]
1102
+ if @api_client.config.client_side_validation && !allowable_values.include?(id)
1103
+ fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
1104
+ end
1105
+ # resource path
1106
+ local_var_path = '/api/mapped-metrics/{id}/relationships/metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1107
+
1108
+ # query parameters
1109
+ query_params = opts[:query_params] || {}
1110
+
1111
+ # header parameters
1112
+ header_params = opts[:header_params] || {}
1113
+ # klaviyo api revision
1114
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1115
+ # HTTP header 'Accept' (if needed)
1116
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1117
+
1118
+ # form parameters
1119
+ form_params = opts[:form_params] || {}
1120
+
1121
+ # http body (model)
1122
+ post_body = opts[:debug_body]
1123
+
1124
+ # return_type
1125
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
1126
+
1127
+ # auth_names
1128
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
1129
+
1130
+ new_options = opts.merge(
1131
+ :operation => :"MetricsApi.get_metric_id_for_mapped_metric",
1132
+ :header_params => header_params,
1133
+ :query_params => query_params,
1134
+ :form_params => form_params,
1135
+ :body => post_body,
1136
+ :auth_names => auth_names,
1137
+ :return_type => return_type
1138
+ )
1139
+
1140
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1141
+ if @api_client.config.debugging
1142
+ @api_client.config.logger.debug "API called: MetricsApi#get_metric_id_for_mapped_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1143
+ end
1144
+ return data, status_code, headers
1145
+ end
1146
+
1147
+ # alias of `get_metric_id_for_mapped_metric_with_http_info`
1148
+ alias get_mapped_metric_relationships_metric_with_http_info get_metric_id_for_mapped_metric_with_http_info
1149
+
647
1150
  # Get Metric ID for Metric Property
648
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`
649
1152
  # @param id [String] The ID of the metric property
@@ -679,7 +1182,7 @@ module KlaviyoAPI
679
1182
  # header parameters
680
1183
  header_params = opts[:header_params] || {}
681
1184
  # klaviyo api revision
682
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1185
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
683
1186
  # HTTP header 'Accept' (if needed)
684
1187
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
685
1188
 
@@ -750,7 +1253,7 @@ module KlaviyoAPI
750
1253
  # header parameters
751
1254
  header_params = opts[:header_params] || {}
752
1255
  # klaviyo api revision
753
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1256
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
754
1257
  # HTTP header 'Accept' (if needed)
755
1258
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
756
1259
 
@@ -791,9 +1294,9 @@ module KlaviyoAPI
791
1294
  # @param id [String] The ID of the metric property
792
1295
  # @param [Hash] opts the optional parameters
793
1296
  # @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: &#39;sample_values&#39;
794
- # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
795
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
796
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
1297
+ # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1298
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1299
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
797
1300
  # @return [Hash<String, Object>]
798
1301
  def get_metric_property(id, opts = {})
799
1302
  data, _status_code, _headers = get_metric_property_with_http_info(id, opts)
@@ -805,9 +1308,9 @@ module KlaviyoAPI
805
1308
  # @param id [String] The ID of the metric property
806
1309
  # @param [Hash] opts the optional parameters
807
1310
  # @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: &#39;sample_values&#39;
808
- # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
809
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
810
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
1311
+ # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1312
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1313
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
811
1314
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
812
1315
  def get_metric_property_with_http_info(id, opts = {})
813
1316
  if @api_client.config.debugging
@@ -846,7 +1349,7 @@ module KlaviyoAPI
846
1349
  # header parameters
847
1350
  header_params = opts[:header_params] || {}
848
1351
  # klaviyo api revision
849
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1352
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
850
1353
  # HTTP header 'Accept' (if needed)
851
1354
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
852
1355
 
@@ -882,11 +1385,11 @@ module KlaviyoAPI
882
1385
  # Get Metrics
883
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`
884
1387
  # @param [Hash] opts the optional parameters
885
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
886
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
887
- # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;integration.name&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;integration.category&#x60;: &#x60;equals&#x60;
888
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
889
- # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#pagination
1388
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1389
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1390
+ # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;integration.name&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;integration.category&#x60;: &#x60;equals&#x60;
1391
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
1392
+ # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#pagination
890
1393
  # @return [Hash<String, Object>]
891
1394
  def get_metrics(opts = {})
892
1395
  data, _status_code, _headers = get_metrics_with_http_info(opts)
@@ -896,11 +1399,11 @@ module KlaviyoAPI
896
1399
  # Get Metrics
897
1400
  # Get all metrics in an account. Requests can be filtered by the following fields: integration &#x60;name&#x60;, integration &#x60;category&#x60; Returns a maximum of 200 results per page.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;10/s&#x60;&lt;br&gt;Steady: &#x60;150/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
898
1401
  # @param [Hash] opts the optional parameters
899
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
900
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
901
- # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;integration.name&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;integration.category&#x60;: &#x60;equals&#x60;
902
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#relationships
903
- # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#pagination
1402
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1403
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1404
+ # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;integration.name&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;integration.category&#x60;: &#x60;equals&#x60;
1405
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#relationships
1406
+ # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#pagination
904
1407
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
905
1408
  def get_metrics_with_http_info(opts = {})
906
1409
  if @api_client.config.debugging
@@ -932,7 +1435,7 @@ module KlaviyoAPI
932
1435
  # header parameters
933
1436
  header_params = opts[:header_params] || {}
934
1437
  # klaviyo api revision
935
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1438
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
936
1439
  # HTTP header 'Accept' (if needed)
937
1440
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
938
1441
 
@@ -969,7 +1472,7 @@ module KlaviyoAPI
969
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`
970
1473
  # @param id [String] The ID of the custom metric
971
1474
  # @param [Hash] opts the optional parameters
972
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
1475
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
973
1476
  # @return [Hash<String, Object>]
974
1477
  def get_metrics_for_custom_metric(id, opts = {})
975
1478
  data, _status_code, _headers = get_metrics_for_custom_metric_with_http_info(id, opts)
@@ -983,7 +1486,7 @@ module KlaviyoAPI
983
1486
  # Get all metrics for the given custom metric ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;metrics:read&#x60;
984
1487
  # @param id [String] The ID of the custom metric
985
1488
  # @param [Hash] opts the optional parameters
986
- # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
1489
+ # @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
987
1490
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
988
1491
  def get_metrics_for_custom_metric_with_http_info(id, opts = {})
989
1492
  if @api_client.config.debugging
@@ -1007,7 +1510,7 @@ module KlaviyoAPI
1007
1510
  # header parameters
1008
1511
  header_params = opts[:header_params] || {}
1009
1512
  # klaviyo api revision
1010
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1513
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1011
1514
  # HTTP header 'Accept' (if needed)
1012
1515
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1013
1516
 
@@ -1048,7 +1551,7 @@ module KlaviyoAPI
1048
1551
  # @param id [String] The ID of the metric
1049
1552
  # @param [Hash] opts the optional parameters
1050
1553
  # @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: &#39;sample_values&#39;
1051
- # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
1554
+ # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1052
1555
  # @return [Hash<String, Object>]
1053
1556
  def get_properties_for_metric(id, opts = {})
1054
1557
  data, _status_code, _headers = get_properties_for_metric_with_http_info(id, opts)
@@ -1066,7 +1569,7 @@ module KlaviyoAPI
1066
1569
  # @param id [String] The ID of the metric
1067
1570
  # @param [Hash] opts the optional parameters
1068
1571
  # @option opts [Array<String>] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: &#39;sample_values&#39;
1069
- # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-04-15/reference/api-overview#sparse-fieldsets
1572
+ # @option opts [Array<String>] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2025-07-15/reference/api-overview#sparse-fieldsets
1070
1573
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
1071
1574
  def get_properties_for_metric_with_http_info(id, opts = {})
1072
1575
  if @api_client.config.debugging
@@ -1095,7 +1598,7 @@ module KlaviyoAPI
1095
1598
  # header parameters
1096
1599
  header_params = opts[:header_params] || {}
1097
1600
  # klaviyo api revision
1098
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1601
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1099
1602
  # HTTP header 'Accept' (if needed)
1100
1603
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1101
1604
 
@@ -1172,7 +1675,7 @@ module KlaviyoAPI
1172
1675
  # header parameters
1173
1676
  header_params = opts[:header_params] || {}
1174
1677
  # klaviyo api revision
1175
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1678
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1176
1679
  # HTTP header 'Accept' (if needed)
1177
1680
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1178
1681
 
@@ -1246,7 +1749,7 @@ module KlaviyoAPI
1246
1749
  # header parameters
1247
1750
  header_params = opts[:header_params] || {}
1248
1751
  # klaviyo api revision
1249
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1752
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1250
1753
  # HTTP header 'Accept' (if needed)
1251
1754
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1252
1755
  # HTTP header 'Content-Type'
@@ -1325,7 +1828,7 @@ module KlaviyoAPI
1325
1828
  # header parameters
1326
1829
  header_params = opts[:header_params] || {}
1327
1830
  # klaviyo api revision
1328
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
1831
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1329
1832
  # HTTP header 'Accept' (if needed)
1330
1833
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1331
1834
  # HTTP header 'Content-Type'
@@ -1362,5 +1865,86 @@ module KlaviyoAPI
1362
1865
  end
1363
1866
  return data, status_code, headers
1364
1867
  end
1868
+
1869
+ # 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`
1871
+ # @param id [String] The type of mapping.
1872
+ # @param mapped_metric_partial_update_query [MappedMetricPartialUpdateQuery] Update a mapped metric by ID
1873
+ # @param [Hash] opts the optional parameters
1874
+ # @return [Hash<String, Object>]
1875
+ def update_mapped_metric(id, mapped_metric_partial_update_query, opts = {})
1876
+ data, _status_code, _headers = update_mapped_metric_with_http_info(id, mapped_metric_partial_update_query, opts)
1877
+ data
1878
+ end
1879
+
1880
+ # Update Mapped Metric
1881
+ # Update the mapped metric with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60;&lt;br&gt;Daily: &#x60;30/d&#x60; **Scopes:** &#x60;metrics:write&#x60;
1882
+ # @param id [String] The type of mapping.
1883
+ # @param mapped_metric_partial_update_query [MappedMetricPartialUpdateQuery] Update a mapped metric by ID
1884
+ # @param [Hash] opts the optional parameters
1885
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
1886
+ def update_mapped_metric_with_http_info(id, mapped_metric_partial_update_query, opts = {})
1887
+ if @api_client.config.debugging
1888
+ @api_client.config.logger.debug 'Calling API: MetricsApi.update_mapped_metric ...'
1889
+ end
1890
+ # verify the required parameter 'id' is set
1891
+ if @api_client.config.client_side_validation && id.nil?
1892
+ fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.update_mapped_metric"
1893
+ end
1894
+ # verify enum value
1895
+ allowable_values = ["added_to_cart", "cancelled_sales", "ordered_product", "refunded_sales", "revenue", "started_checkout", "viewed_product"]
1896
+ if @api_client.config.client_side_validation && !allowable_values.include?(id)
1897
+ fail ArgumentError, "invalid value for \"id\", must be one of #{allowable_values}"
1898
+ end
1899
+ # verify the required parameter 'mapped_metric_partial_update_query' is set
1900
+ if @api_client.config.client_side_validation && mapped_metric_partial_update_query.nil?
1901
+ fail ArgumentError, "Missing the required parameter 'mapped_metric_partial_update_query' when calling MetricsApi.update_mapped_metric"
1902
+ end
1903
+ # resource path
1904
+ local_var_path = '/api/mapped-metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1905
+
1906
+ # query parameters
1907
+ query_params = opts[:query_params] || {}
1908
+
1909
+ # header parameters
1910
+ header_params = opts[:header_params] || {}
1911
+ # klaviyo api revision
1912
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-07-15"
1913
+ # HTTP header 'Accept' (if needed)
1914
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
1915
+ # HTTP header 'Content-Type'
1916
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
1917
+ if !content_type.nil?
1918
+ header_params['Content-Type'] = content_type
1919
+ end
1920
+
1921
+ # form parameters
1922
+ form_params = opts[:form_params] || {}
1923
+
1924
+ # http body (model)
1925
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(mapped_metric_partial_update_query)
1926
+
1927
+ # return_type
1928
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
1929
+
1930
+ # auth_names
1931
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
1932
+
1933
+ new_options = opts.merge(
1934
+ :operation => :"MetricsApi.update_mapped_metric",
1935
+ :header_params => header_params,
1936
+ :query_params => query_params,
1937
+ :form_params => form_params,
1938
+ :body => post_body,
1939
+ :auth_names => auth_names,
1940
+ :return_type => return_type
1941
+ )
1942
+
1943
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1944
+ if @api_client.config.debugging
1945
+ @api_client.config.logger.debug "API called: MetricsApi#update_mapped_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1946
+ end
1947
+ return data, status_code, headers
1948
+ end
1365
1949
  end
1366
1950
  end