klaviyo_sdk 1.0.0.20220329 → 1.0.3.20220329

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile +10 -0
  4. data/README.md +99 -99
  5. data/Rakefile +10 -0
  6. data/docs/Campaign.md +38 -0
  7. data/docs/CampaignsApi.md +707 -0
  8. data/docs/CheckMembershipRequest.md +22 -0
  9. data/docs/DataPrivacyApi.md +81 -0
  10. data/docs/DeleteEmail.md +18 -0
  11. data/docs/DeletePerson.md +18 -0
  12. data/docs/DeletePhone.md +18 -0
  13. data/docs/DeprecatedGetListResponse.md +30 -0
  14. data/docs/DeprecatedGetListResponseData.md +28 -0
  15. data/docs/GlobalExclusionResponseData.md +30 -0
  16. data/docs/IdentifyPayload.md +20 -0
  17. data/docs/IdentifyPayloadProperties.md +42 -0
  18. data/docs/InlineObject.md +18 -0
  19. data/docs/InlineObject3.md +18 -0
  20. data/docs/InlineObject4.md +18 -0
  21. data/docs/InlineObject5.md +22 -0
  22. data/docs/ListsSegmentsApi.md +1198 -0
  23. data/docs/Metric.md +28 -0
  24. data/docs/MetricExport.md +32 -0
  25. data/docs/MetricTimeline.md +24 -0
  26. data/docs/MetricTimelineData.md +34 -0
  27. data/docs/MetricsApi.md +329 -0
  28. data/docs/Person.md +56 -0
  29. data/docs/PrivacyEmail.md +18 -0
  30. data/docs/PrivacyId.md +18 -0
  31. data/docs/PrivacyPhone.md +18 -0
  32. data/docs/ProfilesApi.md +391 -0
  33. data/docs/RenderedTemplate.md +24 -0
  34. data/docs/Template.md +30 -0
  35. data/docs/TemplatesApi.md +541 -0
  36. data/docs/TrackIdentifyApi.md +267 -0
  37. data/docs/TrackPayload.md +24 -0
  38. data/docs/TrackPayloadCustomerProperties.md +20 -0
  39. data/docs/TrackPayloadProperties.md +22 -0
  40. data/git_push.sh +57 -0
  41. data/klaviyo_sdk-1.0.3.2022.03.29.gem +0 -0
  42. data/klaviyo_sdk.gemspec +6 -1
  43. data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
  44. data/lib/klaviyo_sdk/api/data_privacy_api.rb +1 -1
  45. data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
  46. data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
  47. data/lib/klaviyo_sdk/api/profiles_api.rb +1 -1
  48. data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
  49. data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
  50. data/lib/klaviyo_sdk/api_client.rb +2 -2
  51. data/lib/klaviyo_sdk/api_error.rb +1 -1
  52. data/lib/klaviyo_sdk/configuration.rb +1 -1
  53. data/lib/klaviyo_sdk/models/campaign.rb +4 -4
  54. data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
  55. data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
  56. data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
  57. data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
  58. data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
  59. data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
  60. data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
  61. data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
  62. data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
  63. data/lib/klaviyo_sdk/models/inline_object.rb +9 -4
  64. data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
  65. data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
  66. data/lib/klaviyo_sdk/models/inline_object5.rb +4 -4
  67. data/lib/klaviyo_sdk/models/metric.rb +4 -4
  68. data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
  69. data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
  70. data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
  71. data/lib/klaviyo_sdk/models/person.rb +4 -4
  72. data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
  73. data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
  74. data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
  75. data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
  76. data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
  77. data/lib/klaviyo_sdk/models/template.rb +4 -4
  78. data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
  79. data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
  80. data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
  81. data/lib/klaviyo_sdk/version.rb +1 -1
  82. data/lib/klaviyo_sdk.rb +7 -7
  83. data/spec/api/campaigns_api_spec.rb +165 -0
  84. data/spec/api/data_privacy_api_spec.rb +47 -0
  85. data/spec/api/lists_segments_api_spec.rb +239 -0
  86. data/spec/api/metrics_api_spec.rb +96 -0
  87. data/spec/api/profiles_api_spec.rb +103 -0
  88. data/spec/api/templates_api_spec.rb +130 -0
  89. data/spec/api/track_identify_api_spec.rb +83 -0
  90. data/spec/api_client_spec.rb +226 -0
  91. data/spec/configuration_spec.rb +42 -0
  92. data/spec/models/campaign_spec.rb +94 -0
  93. data/spec/models/check_membership_request_spec.rb +46 -0
  94. data/spec/models/delete_email_spec.rb +34 -0
  95. data/spec/models/delete_person_spec.rb +34 -0
  96. data/spec/models/delete_phone_spec.rb +34 -0
  97. data/spec/models/deprecated_get_list_response_data_spec.rb +64 -0
  98. data/spec/models/deprecated_get_list_response_spec.rb +70 -0
  99. data/spec/models/global_exclusion_response_data_spec.rb +70 -0
  100. data/spec/models/identify_payload_properties_spec.rb +106 -0
  101. data/spec/models/identify_payload_spec.rb +40 -0
  102. data/spec/models/inline_object3_spec.rb +34 -0
  103. data/spec/models/inline_object4_spec.rb +34 -0
  104. data/spec/models/inline_object5_spec.rb +46 -0
  105. data/spec/models/inline_object_spec.rb +34 -0
  106. data/spec/models/metric_export_spec.rb +76 -0
  107. data/spec/models/metric_spec.rb +64 -0
  108. data/spec/models/metric_timeline_data_spec.rb +82 -0
  109. data/spec/models/metric_timeline_spec.rb +52 -0
  110. data/spec/models/person_spec.rb +148 -0
  111. data/spec/models/privacy_email_spec.rb +34 -0
  112. data/spec/models/privacy_id_spec.rb +34 -0
  113. data/spec/models/privacy_phone_spec.rb +34 -0
  114. data/spec/models/rendered_template_spec.rb +52 -0
  115. data/spec/models/template_spec.rb +70 -0
  116. data/spec/models/track_payload_customer_properties_spec.rb +40 -0
  117. data/spec/models/track_payload_properties_spec.rb +46 -0
  118. data/spec/models/track_payload_spec.rb +52 -0
  119. data/spec/spec_helper.rb +111 -0
  120. metadata +80 -3
@@ -0,0 +1,1198 @@
1
+ # Klaviyo::ListsSegmentsApi
2
+
3
+ All URIs are relative to *https://a.klaviyo.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**add_members**](ListsSegmentsApi.md#add_members) | **POST** /v2/list/{list_id}/members | Add Members to a List |
8
+ | [**create_list**](ListsSegmentsApi.md#create_list) | **POST** /v2/lists | Create List |
9
+ | [**delete_list**](ListsSegmentsApi.md#delete_list) | **DELETE** /v2/list/{list_id} | Delete List |
10
+ | [**exclude_globally**](ListsSegmentsApi.md#exclude_globally) | **POST** /v1/people/exclusions | Exclude Profile From All Email |
11
+ | [**get_global_exclusions**](ListsSegmentsApi.md#get_global_exclusions) | **GET** /v1/people/exclusions | Get Global Exclusions & Unsubscribes |
12
+ | [**get_list_exclusions**](ListsSegmentsApi.md#get_list_exclusions) | **GET** /v2/list/{list_id}/exclusions/all | Get All Exclusions for a List |
13
+ | [**get_list_info**](ListsSegmentsApi.md#get_list_info) | **GET** /v2/list/{list_id} | Get List Info |
14
+ | [**get_list_members**](ListsSegmentsApi.md#get_list_members) | **POST** /v2/list/{list_id}/get-members | Check if Profiles Are in a List |
15
+ | [**get_list_subscriptions**](ListsSegmentsApi.md#get_list_subscriptions) | **POST** /v2/list/{list_id}/get-list-subscriptions | Check if Profiles Are in a List and not Suppressed |
16
+ | [**get_lists**](ListsSegmentsApi.md#get_lists) | **GET** /v2/lists | Get Lists |
17
+ | [**get_members**](ListsSegmentsApi.md#get_members) | **GET** /v2/group/{list_or_segment_id}/members/all | Get List and Segment Members |
18
+ | [**get_segment_members**](ListsSegmentsApi.md#get_segment_members) | **POST** /v2/segment/{segment_id}/get-members | Check if Profiles Are in a Segment |
19
+ | [**remove_members**](ListsSegmentsApi.md#remove_members) | **DELETE** /v2/list/{list_id}/members | Remove Profiles From List |
20
+ | [**subscribe**](ListsSegmentsApi.md#subscribe) | **POST** /v2/list/{list_id}/subscribe | Subscribe Profiles to List |
21
+ | [**unsubscribe**](ListsSegmentsApi.md#unsubscribe) | **DELETE** /v2/list/{list_id}/subscribe | Unsubscribe Profiles From List |
22
+ | [**update_list_name**](ListsSegmentsApi.md#update_list_name) | **PUT** /v2/list/{list_id} | Update List Name |
23
+
24
+
25
+ ## add_members
26
+
27
+ > Array<Hash<String, Object>> add_members(list_id, opts)
28
+
29
+ Add Members to a List
30
+
31
+ Adds profiles to a list. This endpoint is functionally equivalent to adding profiles to a list via a CSV upload and will immediately add profiles to the list. If you would like to subscribe profiles to a list and use the double opt-in settings for the list, please use the subscribe endpoint.
32
+
33
+ ### Examples
34
+
35
+ ```ruby
36
+ require 'time'
37
+ require 'klaviyo_sdk'
38
+ # setup authorization
39
+ Klaviyo.configure do |config|
40
+ # Configure API key authorization: ApiKeyAuth
41
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
42
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
43
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
44
+ end
45
+
46
+ api_instance = Klaviyo::ListsSegmentsApi.new
47
+ list_id = 'LIST_ID' # String |
48
+ opts = {
49
+ inline_object4: Klaviyo::InlineObject4.new({profiles: [{"email": "george.washington@klaviyo.com"}, {"phone_number": "+13239169023"}]}) # InlineObject4 |
50
+ }
51
+
52
+ begin
53
+ # Add Members to a List
54
+ result = api_instance.add_members(list_id, opts)
55
+ p result
56
+ rescue Klaviyo::ApiError => e
57
+ puts "Error when calling ListsSegmentsApi->add_members: #{e}"
58
+ end
59
+ ```
60
+
61
+ #### Using the add_members_with_http_info variant
62
+
63
+ This returns an Array which contains the response data, status code and headers.
64
+
65
+ > <Array(Array&lt;Hash&lt;String, Object&gt;&gt;, Integer, Hash)> add_members_with_http_info(list_id, opts)
66
+
67
+ ```ruby
68
+ begin
69
+ # Add Members to a List
70
+ data, status_code, headers = api_instance.add_members_with_http_info(list_id, opts)
71
+ p status_code # => 2xx
72
+ p headers # => { ... }
73
+ p data # => Array&lt;Hash&lt;String, Object&gt;&gt;
74
+ rescue Klaviyo::ApiError => e
75
+ puts "Error when calling ListsSegmentsApi->add_members_with_http_info: #{e}"
76
+ end
77
+ ```
78
+
79
+ ### Parameters
80
+
81
+ | Name | Type | Description | Notes |
82
+ | ---- | ---- | ----------- | ----- |
83
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
84
+ | **inline_object4** | [**InlineObject4**](InlineObject4.md) | | [optional] |
85
+
86
+ ### Return type
87
+
88
+ **Array&lt;Hash&lt;String, Object&gt;&gt;**
89
+
90
+ ### Authorization
91
+
92
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
93
+
94
+ ### HTTP request headers
95
+
96
+ - **Content-Type**: application/json
97
+ - **Accept**: application/json
98
+
99
+
100
+ ## create_list
101
+
102
+ > Hash&lt;String, Object&gt; create_list(list_name)
103
+
104
+ Create List
105
+
106
+ Creates a new list.
107
+
108
+ ### Examples
109
+
110
+ ```ruby
111
+ require 'time'
112
+ require 'klaviyo_sdk'
113
+ # setup authorization
114
+ Klaviyo.configure do |config|
115
+ # Configure API key authorization: ApiKeyAuth
116
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
117
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
118
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
119
+ end
120
+
121
+ api_instance = Klaviyo::ListsSegmentsApi.new
122
+ list_name = 'list_name_example' # String |
123
+
124
+ begin
125
+ # Create List
126
+ result = api_instance.create_list(list_name)
127
+ p result
128
+ rescue Klaviyo::ApiError => e
129
+ puts "Error when calling ListsSegmentsApi->create_list: #{e}"
130
+ end
131
+ ```
132
+
133
+ #### Using the create_list_with_http_info variant
134
+
135
+ This returns an Array which contains the response data, status code and headers.
136
+
137
+ > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> create_list_with_http_info(list_name)
138
+
139
+ ```ruby
140
+ begin
141
+ # Create List
142
+ data, status_code, headers = api_instance.create_list_with_http_info(list_name)
143
+ p status_code # => 2xx
144
+ p headers # => { ... }
145
+ p data # => Hash&lt;String, Object&gt;
146
+ rescue Klaviyo::ApiError => e
147
+ puts "Error when calling ListsSegmentsApi->create_list_with_http_info: #{e}"
148
+ end
149
+ ```
150
+
151
+ ### Parameters
152
+
153
+ | Name | Type | Description | Notes |
154
+ | ---- | ---- | ----------- | ----- |
155
+ | **list_name** | **String** | | [default to &#39;MyNewList&#39;] |
156
+
157
+ ### Return type
158
+
159
+ **Hash&lt;String, Object&gt;**
160
+
161
+ ### Authorization
162
+
163
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
164
+
165
+ ### HTTP request headers
166
+
167
+ - **Content-Type**: application/x-www-form-urlencoded
168
+ - **Accept**: application/json
169
+
170
+
171
+ ## delete_list
172
+
173
+ > delete_list(list_id)
174
+
175
+ Delete List
176
+
177
+ Deletes a list from an account. This is a destructive operation and cannot be undone. It will also remove flow triggers associated with the list.
178
+
179
+ ### Examples
180
+
181
+ ```ruby
182
+ require 'time'
183
+ require 'klaviyo_sdk'
184
+ # setup authorization
185
+ Klaviyo.configure do |config|
186
+ # Configure API key authorization: ApiKeyAuth
187
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
188
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
189
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
190
+ end
191
+
192
+ api_instance = Klaviyo::ListsSegmentsApi.new
193
+ list_id = 'LIST_ID' # String |
194
+
195
+ begin
196
+ # Delete List
197
+ api_instance.delete_list(list_id)
198
+ rescue Klaviyo::ApiError => e
199
+ puts "Error when calling ListsSegmentsApi->delete_list: #{e}"
200
+ end
201
+ ```
202
+
203
+ #### Using the delete_list_with_http_info variant
204
+
205
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
206
+
207
+ > <Array(nil, Integer, Hash)> delete_list_with_http_info(list_id)
208
+
209
+ ```ruby
210
+ begin
211
+ # Delete List
212
+ data, status_code, headers = api_instance.delete_list_with_http_info(list_id)
213
+ p status_code # => 2xx
214
+ p headers # => { ... }
215
+ p data # => nil
216
+ rescue Klaviyo::ApiError => e
217
+ puts "Error when calling ListsSegmentsApi->delete_list_with_http_info: #{e}"
218
+ end
219
+ ```
220
+
221
+ ### Parameters
222
+
223
+ | Name | Type | Description | Notes |
224
+ | ---- | ---- | ----------- | ----- |
225
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
226
+
227
+ ### Return type
228
+
229
+ nil (empty response body)
230
+
231
+ ### Authorization
232
+
233
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
234
+
235
+ ### HTTP request headers
236
+
237
+ - **Content-Type**: Not defined
238
+ - **Accept**: Not defined
239
+
240
+
241
+ ## exclude_globally
242
+
243
+ > Hash&lt;String, Object&gt; exclude_globally(email)
244
+
245
+ Exclude Profile From All Email
246
+
247
+ Marks a person as excluded from all email. This works the same way as manually excluding someone via the excluded people page. Someone who is excluded will no longer receive any campaigns or flow emails.
248
+
249
+ ### Examples
250
+
251
+ ```ruby
252
+ require 'time'
253
+ require 'klaviyo_sdk'
254
+ # setup authorization
255
+ Klaviyo.configure do |config|
256
+ # Configure API key authorization: ApiKeyAuth
257
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
258
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
259
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
260
+ end
261
+
262
+ api_instance = Klaviyo::ListsSegmentsApi.new
263
+ email = 'email_example' # String |
264
+
265
+ begin
266
+ # Exclude Profile From All Email
267
+ result = api_instance.exclude_globally(email)
268
+ p result
269
+ rescue Klaviyo::ApiError => e
270
+ puts "Error when calling ListsSegmentsApi->exclude_globally: #{e}"
271
+ end
272
+ ```
273
+
274
+ #### Using the exclude_globally_with_http_info variant
275
+
276
+ This returns an Array which contains the response data, status code and headers.
277
+
278
+ > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> exclude_globally_with_http_info(email)
279
+
280
+ ```ruby
281
+ begin
282
+ # Exclude Profile From All Email
283
+ data, status_code, headers = api_instance.exclude_globally_with_http_info(email)
284
+ p status_code # => 2xx
285
+ p headers # => { ... }
286
+ p data # => Hash&lt;String, Object&gt;
287
+ rescue Klaviyo::ApiError => e
288
+ puts "Error when calling ListsSegmentsApi->exclude_globally_with_http_info: #{e}"
289
+ end
290
+ ```
291
+
292
+ ### Parameters
293
+
294
+ | Name | Type | Description | Notes |
295
+ | ---- | ---- | ----------- | ----- |
296
+ | **email** | **String** | | [default to &#39;george.washington@klaviyo.com&#39;] |
297
+
298
+ ### Return type
299
+
300
+ **Hash&lt;String, Object&gt;**
301
+
302
+ ### Authorization
303
+
304
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
305
+
306
+ ### HTTP request headers
307
+
308
+ - **Content-Type**: application/x-www-form-urlencoded
309
+ - **Accept**: application/json
310
+
311
+
312
+ ## get_global_exclusions
313
+
314
+ > <GlobalExclusionResponseData> get_global_exclusions(opts)
315
+
316
+ Get Global Exclusions & Unsubscribes
317
+
318
+ Returns global exclusions/unsubscribes. Global exclusions are distinct from list exclusions in that these email addresses will not receive any emails from any list. Typically, when someone unsubscribes from a campaign, they are only unsubscribed from that list and are not globally unsubscribed.
319
+
320
+ ### Examples
321
+
322
+ ```ruby
323
+ require 'time'
324
+ require 'klaviyo_sdk'
325
+ # setup authorization
326
+ Klaviyo.configure do |config|
327
+ # Configure API key authorization: ApiKeyAuth
328
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
329
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
330
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
331
+ end
332
+
333
+ api_instance = Klaviyo::ListsSegmentsApi.new
334
+ opts = {
335
+ reason: 'reason_example', # String | Filter results based on the reason for someone being excluded. The possible values are `unsubscribed`, `bounced`, `invalid_email`, `reported_spam` and `manually_excluded`. Only a single value may be specified at a time. Defaults to return all profiles regardless of reason.
336
+ sort: 'asc', # String | Sort order to apply to results, either ascending or descending. Valid values are `asc` or `desc`. Defaults to `asc`.
337
+ count: 500, # Integer | For pagination, the number of results to return. Default = 500
338
+ page: 0 # Integer | For pagination, which page of results to return. Default = 0
339
+ }
340
+
341
+ begin
342
+ # Get Global Exclusions & Unsubscribes
343
+ result = api_instance.get_global_exclusions(opts)
344
+ p result
345
+ rescue Klaviyo::ApiError => e
346
+ puts "Error when calling ListsSegmentsApi->get_global_exclusions: #{e}"
347
+ end
348
+ ```
349
+
350
+ #### Using the get_global_exclusions_with_http_info variant
351
+
352
+ This returns an Array which contains the response data, status code and headers.
353
+
354
+ > <Array(<GlobalExclusionResponseData>, Integer, Hash)> get_global_exclusions_with_http_info(opts)
355
+
356
+ ```ruby
357
+ begin
358
+ # Get Global Exclusions & Unsubscribes
359
+ data, status_code, headers = api_instance.get_global_exclusions_with_http_info(opts)
360
+ p status_code # => 2xx
361
+ p headers # => { ... }
362
+ p data # => <GlobalExclusionResponseData>
363
+ rescue Klaviyo::ApiError => e
364
+ puts "Error when calling ListsSegmentsApi->get_global_exclusions_with_http_info: #{e}"
365
+ end
366
+ ```
367
+
368
+ ### Parameters
369
+
370
+ | Name | Type | Description | Notes |
371
+ | ---- | ---- | ----------- | ----- |
372
+ | **reason** | **String** | Filter results based on the reason for someone being excluded. The possible values are &#x60;unsubscribed&#x60;, &#x60;bounced&#x60;, &#x60;invalid_email&#x60;, &#x60;reported_spam&#x60; and &#x60;manually_excluded&#x60;. Only a single value may be specified at a time. Defaults to return all profiles regardless of reason. | [optional] |
373
+ | **sort** | **String** | Sort order to apply to results, either ascending or descending. Valid values are &#x60;asc&#x60; or &#x60;desc&#x60;. Defaults to &#x60;asc&#x60;. | [optional][default to &#39;asc&#39;] |
374
+ | **count** | **Integer** | For pagination, the number of results to return. Default &#x3D; 500 | [optional][default to 500] |
375
+ | **page** | **Integer** | For pagination, which page of results to return. Default &#x3D; 0 | [optional][default to 0] |
376
+
377
+ ### Return type
378
+
379
+ [**GlobalExclusionResponseData**](GlobalExclusionResponseData.md)
380
+
381
+ ### Authorization
382
+
383
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
384
+
385
+ ### HTTP request headers
386
+
387
+ - **Content-Type**: Not defined
388
+ - **Accept**: application/json
389
+
390
+
391
+ ## get_list_exclusions
392
+
393
+ > Hash&lt;String, Object&gt; get_list_exclusions(list_id, opts)
394
+
395
+ Get All Exclusions for a List
396
+
397
+ Gets all of the emails and phone numbers that have been excluded from a list along with the exclusion reasons and exclusion time. This endpoint uses batching to return the records, so for a large list multiple calls will need to be made to get all of the records.
398
+
399
+ ### Examples
400
+
401
+ ```ruby
402
+ require 'time'
403
+ require 'klaviyo_sdk'
404
+ # setup authorization
405
+ Klaviyo.configure do |config|
406
+ # Configure API key authorization: ApiKeyAuth
407
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
408
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
409
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
410
+ end
411
+
412
+ api_instance = Klaviyo::ListsSegmentsApi.new
413
+ list_id = 'LIST_ID' # String |
414
+ opts = {
415
+ marker: 123456 # Integer | A marker value returned by a previous GET call. Use this to grab the next batch of records.
416
+ }
417
+
418
+ begin
419
+ # Get All Exclusions for a List
420
+ result = api_instance.get_list_exclusions(list_id, opts)
421
+ p result
422
+ rescue Klaviyo::ApiError => e
423
+ puts "Error when calling ListsSegmentsApi->get_list_exclusions: #{e}"
424
+ end
425
+ ```
426
+
427
+ #### Using the get_list_exclusions_with_http_info variant
428
+
429
+ This returns an Array which contains the response data, status code and headers.
430
+
431
+ > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_list_exclusions_with_http_info(list_id, opts)
432
+
433
+ ```ruby
434
+ begin
435
+ # Get All Exclusions for a List
436
+ data, status_code, headers = api_instance.get_list_exclusions_with_http_info(list_id, opts)
437
+ p status_code # => 2xx
438
+ p headers # => { ... }
439
+ p data # => Hash&lt;String, Object&gt;
440
+ rescue Klaviyo::ApiError => e
441
+ puts "Error when calling ListsSegmentsApi->get_list_exclusions_with_http_info: #{e}"
442
+ end
443
+ ```
444
+
445
+ ### Parameters
446
+
447
+ | Name | Type | Description | Notes |
448
+ | ---- | ---- | ----------- | ----- |
449
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
450
+ | **marker** | **Integer** | A marker value returned by a previous GET call. Use this to grab the next batch of records. | [optional] |
451
+
452
+ ### Return type
453
+
454
+ **Hash&lt;String, Object&gt;**
455
+
456
+ ### Authorization
457
+
458
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
459
+
460
+ ### HTTP request headers
461
+
462
+ - **Content-Type**: Not defined
463
+ - **Accept**: application/json
464
+
465
+
466
+ ## get_list_info
467
+
468
+ > Hash&lt;String, Object&gt; get_list_info(list_id)
469
+
470
+ Get List Info
471
+
472
+ Returns information about a list.
473
+
474
+ ### Examples
475
+
476
+ ```ruby
477
+ require 'time'
478
+ require 'klaviyo_sdk'
479
+ # setup authorization
480
+ Klaviyo.configure do |config|
481
+ # Configure API key authorization: ApiKeyAuth
482
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
483
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
484
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
485
+ end
486
+
487
+ api_instance = Klaviyo::ListsSegmentsApi.new
488
+ list_id = 'LIST_ID' # String |
489
+
490
+ begin
491
+ # Get List Info
492
+ result = api_instance.get_list_info(list_id)
493
+ p result
494
+ rescue Klaviyo::ApiError => e
495
+ puts "Error when calling ListsSegmentsApi->get_list_info: #{e}"
496
+ end
497
+ ```
498
+
499
+ #### Using the get_list_info_with_http_info variant
500
+
501
+ This returns an Array which contains the response data, status code and headers.
502
+
503
+ > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_list_info_with_http_info(list_id)
504
+
505
+ ```ruby
506
+ begin
507
+ # Get List Info
508
+ data, status_code, headers = api_instance.get_list_info_with_http_info(list_id)
509
+ p status_code # => 2xx
510
+ p headers # => { ... }
511
+ p data # => Hash&lt;String, Object&gt;
512
+ rescue Klaviyo::ApiError => e
513
+ puts "Error when calling ListsSegmentsApi->get_list_info_with_http_info: #{e}"
514
+ end
515
+ ```
516
+
517
+ ### Parameters
518
+
519
+ | Name | Type | Description | Notes |
520
+ | ---- | ---- | ----------- | ----- |
521
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
522
+
523
+ ### Return type
524
+
525
+ **Hash&lt;String, Object&gt;**
526
+
527
+ ### Authorization
528
+
529
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
530
+
531
+ ### HTTP request headers
532
+
533
+ - **Content-Type**: Not defined
534
+ - **Accept**: application/json
535
+
536
+
537
+ ## get_list_members
538
+
539
+ > Array&lt;Hash&lt;String, Object&gt;&gt; get_list_members(list_id, opts)
540
+
541
+ Check if Profiles Are in a List
542
+
543
+ Checks if one or more emails, phone numbers, or push tokens are in a given list. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
544
+
545
+ ### Examples
546
+
547
+ ```ruby
548
+ require 'time'
549
+ require 'klaviyo_sdk'
550
+ # setup authorization
551
+ Klaviyo.configure do |config|
552
+ # Configure API key authorization: ApiKeyAuth
553
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
554
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
555
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
556
+ end
557
+
558
+ api_instance = Klaviyo::ListsSegmentsApi.new
559
+ list_id = 'LIST_ID' # String |
560
+ opts = {
561
+ check_membership_request: Klaviyo::CheckMembershipRequest.new # CheckMembershipRequest |
562
+ }
563
+
564
+ begin
565
+ # Check if Profiles Are in a List
566
+ result = api_instance.get_list_members(list_id, opts)
567
+ p result
568
+ rescue Klaviyo::ApiError => e
569
+ puts "Error when calling ListsSegmentsApi->get_list_members: #{e}"
570
+ end
571
+ ```
572
+
573
+ #### Using the get_list_members_with_http_info variant
574
+
575
+ This returns an Array which contains the response data, status code and headers.
576
+
577
+ > <Array(Array&lt;Hash&lt;String, Object&gt;&gt;, Integer, Hash)> get_list_members_with_http_info(list_id, opts)
578
+
579
+ ```ruby
580
+ begin
581
+ # Check if Profiles Are in a List
582
+ data, status_code, headers = api_instance.get_list_members_with_http_info(list_id, opts)
583
+ p status_code # => 2xx
584
+ p headers # => { ... }
585
+ p data # => Array&lt;Hash&lt;String, Object&gt;&gt;
586
+ rescue Klaviyo::ApiError => e
587
+ puts "Error when calling ListsSegmentsApi->get_list_members_with_http_info: #{e}"
588
+ end
589
+ ```
590
+
591
+ ### Parameters
592
+
593
+ | Name | Type | Description | Notes |
594
+ | ---- | ---- | ----------- | ----- |
595
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
596
+ | **check_membership_request** | [**CheckMembershipRequest**](CheckMembershipRequest.md) | | [optional] |
597
+
598
+ ### Return type
599
+
600
+ **Array&lt;Hash&lt;String, Object&gt;&gt;**
601
+
602
+ ### Authorization
603
+
604
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
605
+
606
+ ### HTTP request headers
607
+
608
+ - **Content-Type**: application/json
609
+ - **Accept**: application/json
610
+
611
+
612
+ ## get_list_subscriptions
613
+
614
+ > Array&lt;Hash&lt;String, Object&gt;&gt; get_list_subscriptions(list_id, opts)
615
+
616
+ Check if Profiles Are in a List and not Suppressed
617
+
618
+ Checks if one or more emails are in a given list and not suppressed. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
619
+
620
+ ### Examples
621
+
622
+ ```ruby
623
+ require 'time'
624
+ require 'klaviyo_sdk'
625
+ # setup authorization
626
+ Klaviyo.configure do |config|
627
+ # Configure API key authorization: ApiKeyAuth
628
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
629
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
630
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
631
+ end
632
+
633
+ api_instance = Klaviyo::ListsSegmentsApi.new
634
+ list_id = 'LIST_ID' # String |
635
+ opts = {
636
+ check_membership_request: Klaviyo::CheckMembershipRequest.new # CheckMembershipRequest |
637
+ }
638
+
639
+ begin
640
+ # Check if Profiles Are in a List and not Suppressed
641
+ result = api_instance.get_list_subscriptions(list_id, opts)
642
+ p result
643
+ rescue Klaviyo::ApiError => e
644
+ puts "Error when calling ListsSegmentsApi->get_list_subscriptions: #{e}"
645
+ end
646
+ ```
647
+
648
+ #### Using the get_list_subscriptions_with_http_info variant
649
+
650
+ This returns an Array which contains the response data, status code and headers.
651
+
652
+ > <Array(Array&lt;Hash&lt;String, Object&gt;&gt;, Integer, Hash)> get_list_subscriptions_with_http_info(list_id, opts)
653
+
654
+ ```ruby
655
+ begin
656
+ # Check if Profiles Are in a List and not Suppressed
657
+ data, status_code, headers = api_instance.get_list_subscriptions_with_http_info(list_id, opts)
658
+ p status_code # => 2xx
659
+ p headers # => { ... }
660
+ p data # => Array&lt;Hash&lt;String, Object&gt;&gt;
661
+ rescue Klaviyo::ApiError => e
662
+ puts "Error when calling ListsSegmentsApi->get_list_subscriptions_with_http_info: #{e}"
663
+ end
664
+ ```
665
+
666
+ ### Parameters
667
+
668
+ | Name | Type | Description | Notes |
669
+ | ---- | ---- | ----------- | ----- |
670
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
671
+ | **check_membership_request** | [**CheckMembershipRequest**](CheckMembershipRequest.md) | | [optional] |
672
+
673
+ ### Return type
674
+
675
+ **Array&lt;Hash&lt;String, Object&gt;&gt;**
676
+
677
+ ### Authorization
678
+
679
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
680
+
681
+ ### HTTP request headers
682
+
683
+ - **Content-Type**: application/json
684
+ - **Accept**: application/json
685
+
686
+
687
+ ## get_lists
688
+
689
+ > Array&lt;Hash&lt;String, Object&gt;&gt; get_lists
690
+
691
+ Get Lists
692
+
693
+ Returns a listing of all of the lists in an account.
694
+
695
+ ### Examples
696
+
697
+ ```ruby
698
+ require 'time'
699
+ require 'klaviyo_sdk'
700
+ # setup authorization
701
+ Klaviyo.configure do |config|
702
+ # Configure API key authorization: ApiKeyAuth
703
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
704
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
705
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
706
+ end
707
+
708
+ api_instance = Klaviyo::ListsSegmentsApi.new
709
+
710
+ begin
711
+ # Get Lists
712
+ result = api_instance.get_lists
713
+ p result
714
+ rescue Klaviyo::ApiError => e
715
+ puts "Error when calling ListsSegmentsApi->get_lists: #{e}"
716
+ end
717
+ ```
718
+
719
+ #### Using the get_lists_with_http_info variant
720
+
721
+ This returns an Array which contains the response data, status code and headers.
722
+
723
+ > <Array(Array&lt;Hash&lt;String, Object&gt;&gt;, Integer, Hash)> get_lists_with_http_info
724
+
725
+ ```ruby
726
+ begin
727
+ # Get Lists
728
+ data, status_code, headers = api_instance.get_lists_with_http_info
729
+ p status_code # => 2xx
730
+ p headers # => { ... }
731
+ p data # => Array&lt;Hash&lt;String, Object&gt;&gt;
732
+ rescue Klaviyo::ApiError => e
733
+ puts "Error when calling ListsSegmentsApi->get_lists_with_http_info: #{e}"
734
+ end
735
+ ```
736
+
737
+ ### Parameters
738
+
739
+ This endpoint does not need any parameter.
740
+
741
+ ### Return type
742
+
743
+ **Array&lt;Hash&lt;String, Object&gt;&gt;**
744
+
745
+ ### Authorization
746
+
747
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
748
+
749
+ ### HTTP request headers
750
+
751
+ - **Content-Type**: Not defined
752
+ - **Accept**: application/json
753
+
754
+
755
+ ## get_members
756
+
757
+ > Hash&lt;String, Object&gt; get_members(list_or_segment_id, opts)
758
+
759
+ Get List and Segment Members
760
+
761
+ Gets all of the emails, phone numbers, and push tokens for profiles in a given list or segment
762
+
763
+ ### Examples
764
+
765
+ ```ruby
766
+ require 'time'
767
+ require 'klaviyo_sdk'
768
+ # setup authorization
769
+ Klaviyo.configure do |config|
770
+ # Configure API key authorization: ApiKeyAuth
771
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
772
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
773
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
774
+ end
775
+
776
+ api_instance = Klaviyo::ListsSegmentsApi.new
777
+ list_or_segment_id = 'LIST_OR_SEGMENT_ID' # String |
778
+ opts = {
779
+ marker: 123456 # Integer | A marker value returned by a previous GET call. Use this to grab the next batch of records.
780
+ }
781
+
782
+ begin
783
+ # Get List and Segment Members
784
+ result = api_instance.get_members(list_or_segment_id, opts)
785
+ p result
786
+ rescue Klaviyo::ApiError => e
787
+ puts "Error when calling ListsSegmentsApi->get_members: #{e}"
788
+ end
789
+ ```
790
+
791
+ #### Using the get_members_with_http_info variant
792
+
793
+ This returns an Array which contains the response data, status code and headers.
794
+
795
+ > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_members_with_http_info(list_or_segment_id, opts)
796
+
797
+ ```ruby
798
+ begin
799
+ # Get List and Segment Members
800
+ data, status_code, headers = api_instance.get_members_with_http_info(list_or_segment_id, opts)
801
+ p status_code # => 2xx
802
+ p headers # => { ... }
803
+ p data # => Hash&lt;String, Object&gt;
804
+ rescue Klaviyo::ApiError => e
805
+ puts "Error when calling ListsSegmentsApi->get_members_with_http_info: #{e}"
806
+ end
807
+ ```
808
+
809
+ ### Parameters
810
+
811
+ | Name | Type | Description | Notes |
812
+ | ---- | ---- | ----------- | ----- |
813
+ | **list_or_segment_id** | **String** | | [default to &#39;LIST_OR_SEGMENT_ID&#39;] |
814
+ | **marker** | **Integer** | A marker value returned by a previous GET call. Use this to grab the next batch of records. | [optional] |
815
+
816
+ ### Return type
817
+
818
+ **Hash&lt;String, Object&gt;**
819
+
820
+ ### Authorization
821
+
822
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
823
+
824
+ ### HTTP request headers
825
+
826
+ - **Content-Type**: Not defined
827
+ - **Accept**: application/json
828
+
829
+
830
+ ## get_segment_members
831
+
832
+ > Array&lt;Hash&lt;String, Object&gt;&gt; get_segment_members(segment_id, opts)
833
+
834
+ Check if Profiles Are in a Segment
835
+
836
+ Checks if one or more emails, phone numbers, or push tokens are in a given segment. No distinction is made between a person not being in a given segment, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
837
+
838
+ ### Examples
839
+
840
+ ```ruby
841
+ require 'time'
842
+ require 'klaviyo_sdk'
843
+ # setup authorization
844
+ Klaviyo.configure do |config|
845
+ # Configure API key authorization: ApiKeyAuth
846
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
847
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
848
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
849
+ end
850
+
851
+ api_instance = Klaviyo::ListsSegmentsApi.new
852
+ segment_id = 'SEGMENT_ID' # String |
853
+ opts = {
854
+ check_membership_request: Klaviyo::CheckMembershipRequest.new # CheckMembershipRequest |
855
+ }
856
+
857
+ begin
858
+ # Check if Profiles Are in a Segment
859
+ result = api_instance.get_segment_members(segment_id, opts)
860
+ p result
861
+ rescue Klaviyo::ApiError => e
862
+ puts "Error when calling ListsSegmentsApi->get_segment_members: #{e}"
863
+ end
864
+ ```
865
+
866
+ #### Using the get_segment_members_with_http_info variant
867
+
868
+ This returns an Array which contains the response data, status code and headers.
869
+
870
+ > <Array(Array&lt;Hash&lt;String, Object&gt;&gt;, Integer, Hash)> get_segment_members_with_http_info(segment_id, opts)
871
+
872
+ ```ruby
873
+ begin
874
+ # Check if Profiles Are in a Segment
875
+ data, status_code, headers = api_instance.get_segment_members_with_http_info(segment_id, opts)
876
+ p status_code # => 2xx
877
+ p headers # => { ... }
878
+ p data # => Array&lt;Hash&lt;String, Object&gt;&gt;
879
+ rescue Klaviyo::ApiError => e
880
+ puts "Error when calling ListsSegmentsApi->get_segment_members_with_http_info: #{e}"
881
+ end
882
+ ```
883
+
884
+ ### Parameters
885
+
886
+ | Name | Type | Description | Notes |
887
+ | ---- | ---- | ----------- | ----- |
888
+ | **segment_id** | **String** | | [default to &#39;SEGMENT_ID&#39;] |
889
+ | **check_membership_request** | [**CheckMembershipRequest**](CheckMembershipRequest.md) | | [optional] |
890
+
891
+ ### Return type
892
+
893
+ **Array&lt;Hash&lt;String, Object&gt;&gt;**
894
+
895
+ ### Authorization
896
+
897
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
898
+
899
+ ### HTTP request headers
900
+
901
+ - **Content-Type**: application/json
902
+ - **Accept**: application/json
903
+
904
+
905
+ ## remove_members
906
+
907
+ > remove_members(list_id, opts)
908
+
909
+ Remove Profiles From List
910
+
911
+ Removes profiles from a list.
912
+
913
+ ### Examples
914
+
915
+ ```ruby
916
+ require 'time'
917
+ require 'klaviyo_sdk'
918
+ # setup authorization
919
+ Klaviyo.configure do |config|
920
+ # Configure API key authorization: ApiKeyAuth
921
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
922
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
923
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
924
+ end
925
+
926
+ api_instance = Klaviyo::ListsSegmentsApi.new
927
+ list_id = 'LIST_ID' # String |
928
+ opts = {
929
+ inline_object5: Klaviyo::InlineObject5.new # InlineObject5 |
930
+ }
931
+
932
+ begin
933
+ # Remove Profiles From List
934
+ api_instance.remove_members(list_id, opts)
935
+ rescue Klaviyo::ApiError => e
936
+ puts "Error when calling ListsSegmentsApi->remove_members: #{e}"
937
+ end
938
+ ```
939
+
940
+ #### Using the remove_members_with_http_info variant
941
+
942
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
943
+
944
+ > <Array(nil, Integer, Hash)> remove_members_with_http_info(list_id, opts)
945
+
946
+ ```ruby
947
+ begin
948
+ # Remove Profiles From List
949
+ data, status_code, headers = api_instance.remove_members_with_http_info(list_id, opts)
950
+ p status_code # => 2xx
951
+ p headers # => { ... }
952
+ p data # => nil
953
+ rescue Klaviyo::ApiError => e
954
+ puts "Error when calling ListsSegmentsApi->remove_members_with_http_info: #{e}"
955
+ end
956
+ ```
957
+
958
+ ### Parameters
959
+
960
+ | Name | Type | Description | Notes |
961
+ | ---- | ---- | ----------- | ----- |
962
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
963
+ | **inline_object5** | [**InlineObject5**](InlineObject5.md) | | [optional] |
964
+
965
+ ### Return type
966
+
967
+ nil (empty response body)
968
+
969
+ ### Authorization
970
+
971
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
972
+
973
+ ### HTTP request headers
974
+
975
+ - **Content-Type**: application/json
976
+ - **Accept**: Not defined
977
+
978
+
979
+ ## subscribe
980
+
981
+ > Array&lt;Object&gt; subscribe(list_id, opts)
982
+
983
+ Subscribe Profiles to List
984
+
985
+ Subscribes profiles to a list. Profiles will be single or double opted into the specified list in accordance with that list’s settings. **Note:** If you have double opt-in enabled (default behavior), users will not be added to list until they opt-in, and so API will respond with an empty list: `[]`
986
+
987
+ ### Examples
988
+
989
+ ```ruby
990
+ require 'time'
991
+ require 'klaviyo_sdk'
992
+ # setup authorization
993
+ Klaviyo.configure do |config|
994
+ # Configure API key authorization: ApiKeyAuth
995
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
996
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
997
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
998
+ end
999
+
1000
+ api_instance = Klaviyo::ListsSegmentsApi.new
1001
+ list_id = 'LIST_ID' # String |
1002
+ opts = {
1003
+ inline_object3: Klaviyo::InlineObject3.new({profiles: [{"email": "george.washington@klaviyo.com"}, {"phone_number": "+13239169023", "sms_consent": true}]}) # InlineObject3 |
1004
+ }
1005
+
1006
+ begin
1007
+ # Subscribe Profiles to List
1008
+ result = api_instance.subscribe(list_id, opts)
1009
+ p result
1010
+ rescue Klaviyo::ApiError => e
1011
+ puts "Error when calling ListsSegmentsApi->subscribe: #{e}"
1012
+ end
1013
+ ```
1014
+
1015
+ #### Using the subscribe_with_http_info variant
1016
+
1017
+ This returns an Array which contains the response data, status code and headers.
1018
+
1019
+ > <Array(Array&lt;Object&gt;, Integer, Hash)> subscribe_with_http_info(list_id, opts)
1020
+
1021
+ ```ruby
1022
+ begin
1023
+ # Subscribe Profiles to List
1024
+ data, status_code, headers = api_instance.subscribe_with_http_info(list_id, opts)
1025
+ p status_code # => 2xx
1026
+ p headers # => { ... }
1027
+ p data # => Array&lt;Object&gt;
1028
+ rescue Klaviyo::ApiError => e
1029
+ puts "Error when calling ListsSegmentsApi->subscribe_with_http_info: #{e}"
1030
+ end
1031
+ ```
1032
+
1033
+ ### Parameters
1034
+
1035
+ | Name | Type | Description | Notes |
1036
+ | ---- | ---- | ----------- | ----- |
1037
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
1038
+ | **inline_object3** | [**InlineObject3**](InlineObject3.md) | | [optional] |
1039
+
1040
+ ### Return type
1041
+
1042
+ **Array&lt;Object&gt;**
1043
+
1044
+ ### Authorization
1045
+
1046
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
1047
+
1048
+ ### HTTP request headers
1049
+
1050
+ - **Content-Type**: application/json
1051
+ - **Accept**: application/json
1052
+
1053
+
1054
+ ## unsubscribe
1055
+
1056
+ > unsubscribe(list_id, opts)
1057
+
1058
+ Unsubscribe Profiles From List
1059
+
1060
+ Unsubscribes and removes profiles from a list.
1061
+
1062
+ ### Examples
1063
+
1064
+ ```ruby
1065
+ require 'time'
1066
+ require 'klaviyo_sdk'
1067
+ # setup authorization
1068
+ Klaviyo.configure do |config|
1069
+ # Configure API key authorization: ApiKeyAuth
1070
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
1071
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
1072
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
1073
+ end
1074
+
1075
+ api_instance = Klaviyo::ListsSegmentsApi.new
1076
+ list_id = 'LIST_ID' # String |
1077
+ opts = {
1078
+ request_body: { key: 3.56} # Hash<String, Object> | Unsubscribe and remove profiles from a list.
1079
+ }
1080
+
1081
+ begin
1082
+ # Unsubscribe Profiles From List
1083
+ api_instance.unsubscribe(list_id, opts)
1084
+ rescue Klaviyo::ApiError => e
1085
+ puts "Error when calling ListsSegmentsApi->unsubscribe: #{e}"
1086
+ end
1087
+ ```
1088
+
1089
+ #### Using the unsubscribe_with_http_info variant
1090
+
1091
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
1092
+
1093
+ > <Array(nil, Integer, Hash)> unsubscribe_with_http_info(list_id, opts)
1094
+
1095
+ ```ruby
1096
+ begin
1097
+ # Unsubscribe Profiles From List
1098
+ data, status_code, headers = api_instance.unsubscribe_with_http_info(list_id, opts)
1099
+ p status_code # => 2xx
1100
+ p headers # => { ... }
1101
+ p data # => nil
1102
+ rescue Klaviyo::ApiError => e
1103
+ puts "Error when calling ListsSegmentsApi->unsubscribe_with_http_info: #{e}"
1104
+ end
1105
+ ```
1106
+
1107
+ ### Parameters
1108
+
1109
+ | Name | Type | Description | Notes |
1110
+ | ---- | ---- | ----------- | ----- |
1111
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
1112
+ | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | Unsubscribe and remove profiles from a list. | [optional] |
1113
+
1114
+ ### Return type
1115
+
1116
+ nil (empty response body)
1117
+
1118
+ ### Authorization
1119
+
1120
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
1121
+
1122
+ ### HTTP request headers
1123
+
1124
+ - **Content-Type**: application/json
1125
+ - **Accept**: Not defined
1126
+
1127
+
1128
+ ## update_list_name
1129
+
1130
+ > update_list_name(list_id, list_name)
1131
+
1132
+ Update List Name
1133
+
1134
+ Updates a list's name.
1135
+
1136
+ ### Examples
1137
+
1138
+ ```ruby
1139
+ require 'time'
1140
+ require 'klaviyo_sdk'
1141
+ # setup authorization
1142
+ Klaviyo.configure do |config|
1143
+ # Configure API key authorization: ApiKeyAuth
1144
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
1145
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
1146
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
1147
+ end
1148
+
1149
+ api_instance = Klaviyo::ListsSegmentsApi.new
1150
+ list_id = 'LIST_ID' # String |
1151
+ list_name = 'list_name_example' # String |
1152
+
1153
+ begin
1154
+ # Update List Name
1155
+ api_instance.update_list_name(list_id, list_name)
1156
+ rescue Klaviyo::ApiError => e
1157
+ puts "Error when calling ListsSegmentsApi->update_list_name: #{e}"
1158
+ end
1159
+ ```
1160
+
1161
+ #### Using the update_list_name_with_http_info variant
1162
+
1163
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
1164
+
1165
+ > <Array(nil, Integer, Hash)> update_list_name_with_http_info(list_id, list_name)
1166
+
1167
+ ```ruby
1168
+ begin
1169
+ # Update List Name
1170
+ data, status_code, headers = api_instance.update_list_name_with_http_info(list_id, list_name)
1171
+ p status_code # => 2xx
1172
+ p headers # => { ... }
1173
+ p data # => nil
1174
+ rescue Klaviyo::ApiError => e
1175
+ puts "Error when calling ListsSegmentsApi->update_list_name_with_http_info: #{e}"
1176
+ end
1177
+ ```
1178
+
1179
+ ### Parameters
1180
+
1181
+ | Name | Type | Description | Notes |
1182
+ | ---- | ---- | ----------- | ----- |
1183
+ | **list_id** | **String** | | [default to &#39;LIST_ID&#39;] |
1184
+ | **list_name** | **String** | | [default to &#39;MyRenamedList&#39;] |
1185
+
1186
+ ### Return type
1187
+
1188
+ nil (empty response body)
1189
+
1190
+ ### Authorization
1191
+
1192
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
1193
+
1194
+ ### HTTP request headers
1195
+
1196
+ - **Content-Type**: application/x-www-form-urlencoded
1197
+ - **Accept**: Not defined
1198
+