Class: KlaviyoAPI::ProfilesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/klaviyo-api-sdk/api/profiles_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProfilesApi

Returns a new instance of ProfilesApi.



18
19
20
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 18

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



16
17
18
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#bulk_import_profiles(profile_import_job_create_query, opts = {}) ⇒ Hash<String, Object> Also known as: spawn_bulk_profile_import_job, create_profile_bulk_import_job

Bulk Import Profiles Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request. The maximum allowed payload size is 5MB. The maximum allowed payload size per-profile is 100KB. To learn more, see our Bulk Profile Import API guide.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: lists:write profiles:write OpenAPI Spec

Parameters:

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


27
28
29
30
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 27

def bulk_import_profiles(profile_import_job_create_query, opts = {})
  data, _status_code, _headers = bulk_import_profiles_with_http_info(profile_import_job_create_query, opts)
  data
end

#bulk_import_profiles_with_http_info(profile_import_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: spawn_bulk_profile_import_job_with_http_info, create_profile_bulk_import_job_with_http_info

Bulk Import Profiles Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request. The maximum allowed payload size is 5MB. The maximum allowed payload size per-profile is 100KB. To learn more, see our Bulk Profile Import API guide.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `lists:write` `profiles:write` OpenAPI Spec

Parameters:

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 44

def bulk_import_profiles_with_http_info(profile_import_job_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_import_profiles ...'
  end
  # verify the required parameter 'profile_import_job_create_query' is set
  if @api_client.config.client_side_validation && profile_import_job_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'profile_import_job_create_query' when calling ProfilesApi.bulk_import_profiles"
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "expires_at", "failed_count", "id", "started_at", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_bulk_import_job'] && !opts[:'fields_profile_bulk_import_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_bulk_import_job\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-bulk-import-jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-bulk-import-job]'] = @api_client.build_collection_param(opts[:'fields_profile_bulk_import_job'], :csv) if !opts[:'fields_profile_bulk_import_job'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_import_job_create_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.bulk_import_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#bulk_import_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bulk_subscribe_profiles(subscription_create_job_create_query, opts = {}) ⇒ nil Also known as: subscribe_profiles, create_profile_subscription_bulk_create_job

Bulk Subscribe Profiles Subscribe one or more profiles to email marketing, SMS marketing, WhatsApp, or push. If the provided list has double opt-in enabled, profiles will receive a message requiring their confirmation before subscribing. Otherwise, profiles will be immediately subscribed without receiving a confirmation message. Learn more about consent in this guide. If a list is not provided, the opt-in process used will be determined by the account-level default opt-in setting. To add someone to a list without changing their subscription status, use Add Profile to List. This API will remove any UNSUBSCRIBE, SPAM_REPORT or USER_SUPPRESSED suppressions from the provided profiles. Learn more about suppressed profiles. Maximum number of profiles can be submitted for subscription: 1000 This endpoint now supports a historical_import flag. If this flag is set true, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated "Added to list" flows. This is useful for importing historical data where you have already collected consent. If historical_import is set to true, the consented_at field is required and must be in the past. Push tokens provided in push_tokens will be registered for each profile as long as push subscriptions are consented to.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: lists:write profiles:write subscriptions:write OpenAPI Spec

Parameters:

  • subscription_create_job_create_query (SubscriptionCreateJobCreateQuery) —

    Subscribes one or more profiles to marketing, with support for push channel and push tokens. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (nil)


115
116
117
118
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 115

def bulk_subscribe_profiles(subscription_create_job_create_query, opts = {})
  bulk_subscribe_profiles_with_http_info(subscription_create_job_create_query, opts)
  nil
end

#bulk_subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)> Also known as: subscribe_profiles_with_http_info, create_profile_subscription_bulk_create_job_with_http_info

Bulk Subscribe Profiles Subscribe one or more profiles to email marketing, SMS marketing, WhatsApp, or push. If the provided list has double opt-in enabled, profiles will receive a message requiring their confirmation before subscribing. Otherwise, profiles will be immediately subscribed without receiving a confirmation message. Learn more about consent in this guide. If a list is not provided, the opt-in process used will be determined by the account-level default opt-in setting. To add someone to a list without changing their subscription status, use Add Profile to List. This API will remove any `UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about suppressed profiles. Maximum number of profiles can be submitted for subscription: 1000 This endpoint now supports a `historical_import` flag. If this flag is set `true`, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated &quot;Added to list&quot; flows. This is useful for importing historical data where you have already collected consent. If `historical_import` is set to true, the `consented_at` field is required and must be in the past. Push tokens provided in `push_tokens` will be registered for each profile as long as push subscriptions are consented to.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `lists:write` `profiles:write` `subscriptions:write` OpenAPI Spec

Parameters:

  • subscription_create_job_create_query (SubscriptionCreateJobCreateQuery) —

    Subscribes one or more profiles to marketing, with support for push channel and push tokens. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 131

def bulk_subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_subscribe_profiles ...'
  end
  # verify the required parameter 'subscription_create_job_create_query' is set
  if @api_client.config.client_side_validation && subscription_create_job_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_create_job_create_query' when calling ProfilesApi.bulk_subscribe_profiles"
  end
  # resource path
  local_var_path = '/api/profile-subscription-bulk-create-jobs'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_create_job_create_query)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.bulk_subscribe_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#bulk_subscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bulk_suppress_profiles(suppression_create_job_create_query, opts = {}) ⇒ Hash<String, Object> Also known as: suppress_profiles, create_profile_suppression_bulk_create_job

Bulk Suppress Profiles Manually suppress profiles by email address or specify a segment/list ID to suppress all current members of a segment/list. Suppressed profiles cannot receive email marketing, independent of their consent status. To learn more, see our guides on email suppressions and collecting consent. Email address per request limit: 100

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: profiles:write subscriptions:write OpenAPI Spec

Parameters:

  • suppression_create_job_create_query (SuppressionCreateJobCreateQuery) —

    Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


198
199
200
201
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 198

def bulk_suppress_profiles(suppression_create_job_create_query, opts = {})
  data, _status_code, _headers = bulk_suppress_profiles_with_http_info(suppression_create_job_create_query, opts)
  data
end

#bulk_suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: suppress_profiles_with_http_info, create_profile_suppression_bulk_create_job_with_http_info

Bulk Suppress Profiles Manually suppress profiles by email address or specify a segment/list ID to suppress all current members of a segment/list. Suppressed profiles cannot receive email marketing, independent of their consent status. To learn more, see our guides on email suppressions and collecting consent. Email address per request limit: 100<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `profiles:write` `subscriptions:write` OpenAPI Spec

Parameters:

  • suppression_create_job_create_query (SuppressionCreateJobCreateQuery) —

    Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 215

def bulk_suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_suppress_profiles ...'
  end
  # verify the required parameter 'suppression_create_job_create_query' is set
  if @api_client.config.client_side_validation && suppression_create_job_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'suppression_create_job_create_query' when calling ProfilesApi.bulk_suppress_profiles"
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "id", "skipped_count", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_create_job'] && !opts[:'fields_profile_suppression_bulk_create_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_create_job\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-suppression-bulk-create-jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-suppression-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_create_job'], :csv) if !opts[:'fields_profile_suppression_bulk_create_job'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_create_job_create_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.bulk_suppress_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#bulk_suppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bulk_unsubscribe_profiles(subscription_delete_job_create_query, opts = {}) ⇒ nil Also known as: unsubscribe_profiles, create_profile_subscription_bulk_delete_job

Bulk Unsubscribe Profiles

🚧 > > Profiles not in the specified list will be globally unsubscribed. Always verify profile list membership before calling this endpoint to avoid unintended global unsubscribes. Unsubscribe one or more profiles from email marketing, SMS marketing, push marketing, or a combination. Learn more about consent in this guide. Push tokens provided in subscriptions.push.tokens will be removed for the specified profiles. To remove someone from a list without changing their subscription status, use Remove Profiles from List. Maximum number of profiles per call: 100

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: lists:write profiles:write subscriptions:write OpenAPI Spec

Parameters:

  • subscription_delete_job_create_query (SubscriptionDeleteJobCreateQuery) —

    Unsubscribes one or more profiles from marketing. Supports email, SMS, WhatsApp, and push channels. All profiles will be removed from the provided list. Either email or phone number is required for email/SMS/WhatsApp channels. Push tokens can be removed by providing token strings directly. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (nil)


286
287
288
289
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 286

def bulk_unsubscribe_profiles(subscription_delete_job_create_query, opts = {})
  bulk_unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts)
  nil
end

#bulk_unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)> Also known as: unsubscribe_profiles_with_http_info, create_profile_subscription_bulk_delete_job_with_http_info

Bulk Unsubscribe Profiles > 🚧 > > Profiles not in the specified list will be globally unsubscribed. Always verify profile list membership before calling this endpoint to avoid unintended global unsubscribes. Unsubscribe one or more profiles from email marketing, SMS marketing, push marketing, or a combination. Learn more about consent in this guide. Push tokens provided in `subscriptions.push.tokens` will be removed for the specified profiles. To remove someone from a list without changing their subscription status, use Remove Profiles from List. Maximum number of profiles per call: 100<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `lists:write` `profiles:write` `subscriptions:write` OpenAPI Spec

Parameters:

  • subscription_delete_job_create_query (SubscriptionDeleteJobCreateQuery) —

    Unsubscribes one or more profiles from marketing. Supports email, SMS, WhatsApp, and push channels. All profiles will be removed from the provided list. Either email or phone number is required for email/SMS/WhatsApp channels. Push tokens can be removed by providing token strings directly. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 302

def bulk_unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_unsubscribe_profiles ...'
  end
  # verify the required parameter 'subscription_delete_job_create_query' is set
  if @api_client.config.client_side_validation && subscription_delete_job_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_delete_job_create_query' when calling ProfilesApi.bulk_unsubscribe_profiles"
  end
  # resource path
  local_var_path = '/api/profile-subscription-bulk-delete-jobs'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_delete_job_create_query)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.bulk_unsubscribe_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#bulk_unsubscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bulk_unsuppress_profiles(suppression_delete_job_create_query, opts = {}) ⇒ Hash<String, Object> Also known as: unsuppress_profiles, create_profile_suppression_bulk_delete_job

Bulk Unsuppress Profiles Manually unsuppress profiles by email address or specify a segment/list ID to unsuppress all current members of a segment/list. This only removes suppressions with reason USER_SUPPRESSED ; unsubscribed profiles and suppressed profiles with reason INVALID_EMAIL or HARD_BOUNCE remain unchanged. To learn more, see our guides on email suppressions and collecting consent. Email address per request limit: 100

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: subscriptions:write OpenAPI Spec

Parameters:

  • suppression_delete_job_create_query (SuppressionDeleteJobCreateQuery) —

    Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


369
370
371
372
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 369

def bulk_unsuppress_profiles(suppression_delete_job_create_query, opts = {})
  data, _status_code, _headers = bulk_unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts)
  data
end

#bulk_unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: unsuppress_profiles_with_http_info, create_profile_suppression_bulk_delete_job_with_http_info

Bulk Unsuppress Profiles Manually unsuppress profiles by email address or specify a segment/list ID to unsuppress all current members of a segment/list. This only removes suppressions with reason USER_SUPPRESSED ; unsubscribed profiles and suppressed profiles with reason INVALID_EMAIL or HARD_BOUNCE remain unchanged. To learn more, see our guides on email suppressions and collecting consent. Email address per request limit: 100<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `subscriptions:write` OpenAPI Spec

Parameters:

  • suppression_delete_job_create_query (SuppressionDeleteJobCreateQuery) —

    Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 386

def bulk_unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_unsuppress_profiles ...'
  end
  # verify the required parameter 'suppression_delete_job_create_query' is set
  if @api_client.config.client_side_validation && suppression_delete_job_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'suppression_delete_job_create_query' when calling ProfilesApi.bulk_unsuppress_profiles"
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "id", "skipped_count", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_delete_job'] && !opts[:'fields_profile_suppression_bulk_delete_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_delete_job\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-suppression-bulk-delete-jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-suppression-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_delete_job'], :csv) if !opts[:'fields_profile_suppression_bulk_delete_job'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_delete_job_create_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.bulk_unsuppress_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#bulk_unsuppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_or_update_profile(profile_upsert_query, opts = {}) ⇒ Hash<String, Object> Also known as: create_profile_import

Create or Update Profile Given a set of profile attributes and optionally an ID, create or update a profile. Returns 201 if a new profile was created, 200 if an existing profile was updated. Use the additional-fields parameter to include subscriptions and predictive analytics data in your response. Note that setting a field to null will clear out the field, whereas not including a field in your request will leave it unchanged. The maximum allowed payload size is 100KB.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: profiles:write OpenAPI Spec

Parameters:

  • profile_upsert_query (ProfileUpsertQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


459
460
461
462
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 459

def create_or_update_profile(profile_upsert_query, opts = {})
  data, _status_code, _headers = create_or_update_profile_with_http_info(profile_upsert_query, opts)
  data
end

#create_or_update_profile_with_http_info(profile_upsert_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: create_profile_import_with_http_info

Create or Update Profile Given a set of profile attributes and optionally an ID, create or update a profile. Returns 201 if a new profile was created, 200 if an existing profile was updated. Use the `additional-fields` parameter to include subscriptions and predictive analytics data in your response. Note that setting a field to `null` will clear out the field, whereas not including a field in your request will leave it unchanged. The maximum allowed payload size is 100KB.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `profiles:write` OpenAPI Spec

Parameters:

  • profile_upsert_query (ProfileUpsertQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 474

def create_or_update_profile_with_http_info(profile_upsert_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.create_or_update_profile ...'
  end
  # verify the required parameter 'profile_upsert_query' is set
  if @api_client.config.client_side_validation && profile_upsert_query.nil?
    fail ArgumentError, "Missing the required parameter 'profile_upsert_query' when calling ProfilesApi.create_or_update_profile"
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-import'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_upsert_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.create_or_update_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#create_or_update_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_profile(profile_create_query, opts = {}) ⇒ Hash<String, Object>

Create Profile Create a new profile. Use the additional-fields parameter to include subscriptions and predictive analytics data in your response. The maximum allowed payload size is 100KB.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: profiles:write OpenAPI Spec

Parameters:

  • profile_create_query (ProfileCreateQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


549
550
551
552
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 549

def create_profile(profile_create_query, opts = {})
  data, _status_code, _headers = create_profile_with_http_info(profile_create_query, opts)
  data
end

#create_profile_with_http_info(profile_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Create Profile Create a new profile. Use the `additional-fields` parameter to include subscriptions and predictive analytics data in your response. The maximum allowed payload size is 100KB.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `profiles:write` OpenAPI Spec

Parameters:

  • profile_create_query (ProfileCreateQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 561

def create_profile_with_http_info(profile_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.create_profile ...'
  end
  # verify the required parameter 'profile_create_query' is set
  if @api_client.config.client_side_validation && profile_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'profile_create_query' when calling ProfilesApi.create_profile"
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_create_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.create_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#create_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_push_token(push_token_create_query, opts = {}) ⇒ nil

Create or Update Push Token Create or update a push token. This endpoint can be used to migrate push tokens from another platform to Klaviyo. Please use our mobile SDKs (iOS and Android) to create push tokens from users' devices. The maximum allowed payload size is 100KB.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: profiles:write push-tokens:write OpenAPI Spec

Parameters:

  • push_token_create_query (PushTokenCreateQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (nil)


631
632
633
634
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 631

def create_push_token(push_token_create_query, opts = {})
  create_push_token_with_http_info(push_token_create_query, opts)
  nil
end

#create_push_token_with_http_info(push_token_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create or Update Push Token Create or update a push token. This endpoint can be used to migrate push tokens from another platform to Klaviyo. Please use our mobile SDKs (iOS and Android) to create push tokens from users' devices. The maximum allowed payload size is 100KB.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `profiles:write` `push-tokens:write` OpenAPI Spec

Parameters:

  • push_token_create_query (PushTokenCreateQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 641

def create_push_token_with_http_info(push_token_create_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.create_push_token ...'
  end
  # verify the required parameter 'push_token_create_query' is set
  if @api_client.config.client_side_validation && push_token_create_query.nil?
    fail ArgumentError, "Missing the required parameter 'push_token_create_query' when calling ProfilesApi.create_push_token"
  end
  # resource path
  local_var_path = '/api/push-tokens'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(push_token_create_query)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.create_push_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#create_push_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_push_token(id, opts = {}) ⇒ nil

Delete Push Token Delete a specific push token based on its ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: push-tokens:write OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token to delete

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (nil)


701
702
703
704
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 701

def delete_push_token(id, opts = {})
  delete_push_token_with_http_info(id, opts)
  nil
end

#delete_push_token_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Push Token Delete a specific push token based on its ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `push-tokens:write` OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token to delete

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 711

def delete_push_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.delete_push_token ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.delete_push_token"
  end
  # resource path
  local_var_path = '/api/push-tokens/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.delete_push_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#delete_push_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_import_profiles_job(job_id, opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_job, get_profile_bulk_import_job

Get Bulk Import Profiles Job Get a bulk profile import job with the given job ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: lists:read profiles:read OpenAPI Spec

Parameters:

  • job_id (String) —

    ID of the job to retrieve.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


769
770
771
772
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 769

def get_bulk_import_profiles_job(job_id, opts = {})
  data, _status_code, _headers = get_bulk_import_profiles_job_with_http_info(job_id, opts)
  data
end

#get_bulk_import_profiles_job_with_http_info(job_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_job_with_http_info, get_profile_bulk_import_job_with_http_info

Get Bulk Import Profiles Job Get a bulk profile import job with the given job ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `lists:read` `profiles:read` OpenAPI Spec

Parameters:

  • job_id (String) —

    ID of the job to retrieve.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 788

def get_bulk_import_profiles_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_import_profiles_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_import_profiles_job"
  end
  allowable_values = ["created", "id", "name", "opt_in_process", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}"
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "expires_at", "failed_count", "id", "started_at", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_bulk_import_job'] && !opts[:'fields_profile_bulk_import_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_bulk_import_job\", must include one of #{allowable_values}"
  end
  allowable_values = ["lists"]
  if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-bulk-import-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil?
  query_params[:'fields[profile-bulk-import-job]'] = @api_client.build_collection_param(opts[:'fields_profile_bulk_import_job'], :csv) if !opts[:'fields_profile_bulk_import_job'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_bulk_import_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_import_profiles_jobs(opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_jobs, get_profile_bulk_import_jobs

Get Bulk Import Profiles Jobs Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: lists:read profiles:read OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


868
869
870
871
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 868

def get_bulk_import_profiles_jobs(opts = {})
  data, _status_code, _headers = get_bulk_import_profiles_jobs_with_http_info(opts)
  data
end

#get_bulk_import_profiles_jobs_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_jobs_with_http_info, get_profile_bulk_import_jobs_with_http_info

Get Bulk Import Profiles Jobs Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `lists:read` `profiles:read` OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 888

def get_bulk_import_profiles_jobs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_import_profiles_jobs ...'
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "expires_at", "failed_count", "id", "started_at", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_bulk_import_job'] && !opts[:'fields_profile_bulk_import_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_bulk_import_job\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_import_profiles_jobs, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_import_profiles_jobs, must be greater than or equal to 1.'
  end

  allowable_values = ["created_at", "-created_at"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-bulk-import-jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-bulk-import-job]'] = @api_client.build_collection_param(opts[:'fields_profile_bulk_import_job'], :csv) if !opts[:'fields_profile_bulk_import_job'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_bulk_import_profiles_jobs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_import_profiles_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_suppress_profiles_job(job_id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_suppression_bulk_create_job

Get Bulk Suppress Profiles Job Get the bulk suppress profiles job with the given job ID.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: subscriptions:read OpenAPI Spec

Parameters:

  • job_id (String) —

    ID of the job to retrieve.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


967
968
969
970
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 967

def get_bulk_suppress_profiles_job(job_id, opts = {})
  data, _status_code, _headers = get_bulk_suppress_profiles_job_with_http_info(job_id, opts)
  data
end

#get_bulk_suppress_profiles_job_with_http_info(job_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_suppression_bulk_create_job_with_http_info

Get Bulk Suppress Profiles Job Get the bulk suppress profiles job with the given job ID.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `subscriptions:read` OpenAPI Spec

Parameters:

  • job_id (String) —

    ID of the job to retrieve.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 981

def get_bulk_suppress_profiles_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_suppress_profiles_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_suppress_profiles_job"
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "id", "skipped_count", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_create_job'] && !opts[:'fields_profile_suppression_bulk_create_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_create_job\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-suppression-bulk-create-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-suppression-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_create_job'], :csv) if !opts[:'fields_profile_suppression_bulk_create_job'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_bulk_suppress_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_suppress_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_suppress_profiles_jobs(opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_suppression_bulk_create_jobs

Get Bulk Suppress Profiles Jobs Get the status of all bulk profile suppression jobs.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: subscriptions:read OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1047
1048
1049
1050
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1047

def get_bulk_suppress_profiles_jobs(opts = {})
  data, _status_code, _headers = get_bulk_suppress_profiles_jobs_with_http_info(opts)
  data
end

#get_bulk_suppress_profiles_jobs_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_suppression_bulk_create_jobs_with_http_info

Get Bulk Suppress Profiles Jobs Get the status of all bulk profile suppression jobs.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `subscriptions:read` OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1063

def get_bulk_suppress_profiles_jobs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_suppress_profiles_jobs ...'
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "id", "skipped_count", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_create_job'] && !opts[:'fields_profile_suppression_bulk_create_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_create_job\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "-created"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-suppression-bulk-create-jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-suppression-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_create_job'], :csv) if !opts[:'fields_profile_suppression_bulk_create_job'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_bulk_suppress_profiles_jobs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_suppress_profiles_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_unsuppress_profiles_job(job_id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_suppression_bulk_delete_job

Get Bulk Unsuppress Profiles Job Get the bulk unsuppress profiles job with the given job ID.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: subscriptions:read OpenAPI Spec

Parameters:

  • job_id (String) —

    ID of the job to retrieve.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1130
1131
1132
1133
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1130

def get_bulk_unsuppress_profiles_job(job_id, opts = {})
  data, _status_code, _headers = get_bulk_unsuppress_profiles_job_with_http_info(job_id, opts)
  data
end

#get_bulk_unsuppress_profiles_job_with_http_info(job_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_suppression_bulk_delete_job_with_http_info

Get Bulk Unsuppress Profiles Job Get the bulk unsuppress profiles job with the given job ID.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `subscriptions:read` OpenAPI Spec

Parameters:

  • job_id (String) —

    ID of the job to retrieve.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1144

def get_bulk_unsuppress_profiles_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_unsuppress_profiles_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_unsuppress_profiles_job"
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "id", "skipped_count", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_delete_job'] && !opts[:'fields_profile_suppression_bulk_delete_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_delete_job\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-suppression-bulk-delete-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-suppression-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_delete_job'], :csv) if !opts[:'fields_profile_suppression_bulk_delete_job'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_bulk_unsuppress_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_unsuppress_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_unsuppress_profiles_jobs(opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_suppression_bulk_delete_jobs

Get Bulk Unsuppress Profiles Jobs Get all bulk unsuppress profiles jobs.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: subscriptions:read OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1210
1211
1212
1213
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1210

def get_bulk_unsuppress_profiles_jobs(opts = {})
  data, _status_code, _headers = get_bulk_unsuppress_profiles_jobs_with_http_info(opts)
  data
end

#get_bulk_unsuppress_profiles_jobs_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_suppression_bulk_delete_jobs_with_http_info

Get Bulk Unsuppress Profiles Jobs Get all bulk unsuppress profiles jobs.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `subscriptions:read` OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1226

def get_bulk_unsuppress_profiles_jobs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_unsuppress_profiles_jobs ...'
  end
  allowable_values = ["completed_at", "completed_count", "created_at", "id", "skipped_count", "status", "total_count"]
  if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_delete_job'] && !opts[:'fields_profile_suppression_bulk_delete_job'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_delete_job\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "-created"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-suppression-bulk-delete-jobs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile-suppression-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_delete_job'], :csv) if !opts[:'fields_profile_suppression_bulk_delete_job'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_bulk_unsuppress_profiles_jobs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_unsuppress_profiles_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_conversation_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_conversation

Get Conversation for Profile Get the conversation for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: conversations:read profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1293
1294
1295
1296
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1293

def get_conversation_for_profile(id, opts = {})
  data, _status_code, _headers = get_conversation_for_profile_with_http_info(id, opts)
  data
end

#get_conversation_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_conversation_with_http_info

Get Conversation for Profile Get the conversation for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `conversations:read` `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1307

def get_conversation_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_conversation_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_conversation_for_profile"
  end
  allowable_values = ["channel", "id"]
  if @api_client.config.client_side_validation && opts[:'fields_conversation'] && !opts[:'fields_conversation'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_conversation\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/conversation'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[conversation]'] = @api_client.build_collection_param(opts[:'fields_conversation'], :csv) if !opts[:'fields_conversation'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_conversation_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_conversation_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_conversation_id_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_relationships_conversation

Get Conversation ID for Profile Get the conversation relationship for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: conversations:read profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


1370
1371
1372
1373
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1370

def get_conversation_id_for_profile(id, opts = {})
  data, _status_code, _headers = get_conversation_id_for_profile_with_http_info(id, opts)
  data
end

#get_conversation_id_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_relationships_conversation_with_http_info

Get Conversation ID for Profile Get the conversation relationship for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `conversations:read` `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1383

def get_conversation_id_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_conversation_id_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_conversation_id_for_profile"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/relationships/conversation'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_conversation_id_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_conversation_id_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_conversation_ids_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_relationships_conversations

Get Conversation IDs for Profile Get the IDs of all conversations for a profile across all channels.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: conversations:read profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


1441
1442
1443
1444
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1441

def get_conversation_ids_for_profile(id, opts = {})
  data, _status_code, _headers = get_conversation_ids_for_profile_with_http_info(id, opts)
  data
end

#get_conversation_ids_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_relationships_conversations_with_http_info

Get Conversation IDs for Profile Get the IDs of all conversations for a profile across all channels.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `conversations:read` `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1454

def get_conversation_ids_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_conversation_ids_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_conversation_ids_for_profile"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/relationships/conversations'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_conversation_ids_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_conversation_ids_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_conversations_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_conversations

Get Conversations for Profile Get all conversations for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: conversations:read profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1513
1514
1515
1516
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1513

def get_conversations_for_profile(id, opts = {})
  data, _status_code, _headers = get_conversations_for_profile_with_http_info(id, opts)
  data
end

#get_conversations_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_conversations_with_http_info

Get Conversations for Profile Get all conversations for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `conversations:read` `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1527

def get_conversations_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_conversations_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_conversations_for_profile"
  end
  allowable_values = ["channel", "id"]
  if @api_client.config.client_side_validation && opts[:'fields_conversation'] && !opts[:'fields_conversation'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_conversation\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/conversations'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[conversation]'] = @api_client.build_collection_param(opts[:'fields_conversation'], :csv) if !opts[:'fields_conversation'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_conversations_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_conversations_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_errors_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_job_import_errors, get_import_errors_for_profile_bulk_import_job, get_profile_bulk_import_job_import_errors

Get Errors for Bulk Import Profiles Job Get import errors for the bulk profile import job with the given ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1593
1594
1595
1596
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1593

def get_errors_for_bulk_import_profiles_job(id, opts = {})
  data, _status_code, _headers = get_errors_for_bulk_import_profiles_job_with_http_info(id, opts)
  data
end

#get_errors_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_job_import_errors_with_http_info, get_import_errors_for_profile_bulk_import_job_with_http_info, get_profile_bulk_import_job_import_errors_with_http_info

Get Errors for Bulk Import Profiles Job Get import errors for the bulk profile import job with the given ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1615

def get_errors_for_bulk_import_profiles_job_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_errors_for_bulk_import_profiles_job ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_errors_for_bulk_import_profiles_job"
  end
  allowable_values = ["code", "detail", "id", "original_payload", "source", "source.pointer", "title"]
  if @api_client.config.client_side_validation && opts[:'fields_import_error'] && !opts[:'fields_import_error'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_import_error\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_errors_for_bulk_import_profiles_job, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_errors_for_bulk_import_profiles_job, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/profile-bulk-import-jobs/{id}/import-errors'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[import-error]'] = @api_client.build_collection_param(opts[:'fields_import_error'], :csv) if !opts[:'fields_import_error'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_errors_for_bulk_import_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_errors_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_job_lists, get_lists_for_profile_bulk_import_job, get_profile_bulk_import_job_lists

Get List for Bulk Import Profiles Job Get list for the bulk profile import job with the given ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: lists:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1695
1696
1697
1698
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1695

def get_list_for_bulk_import_profiles_job(id, opts = {})
  data, _status_code, _headers = get_list_for_bulk_import_profiles_job_with_http_info(id, opts)
  data
end

#get_list_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_job_lists_with_http_info, get_lists_for_profile_bulk_import_job_with_http_info, get_profile_bulk_import_job_lists_with_http_info

Get List for Bulk Import Profiles Job Get list for the bulk profile import job with the given ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `lists:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1715

def get_list_for_bulk_import_profiles_job_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_list_for_bulk_import_profiles_job ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_list_for_bulk_import_profiles_job"
  end
  allowable_values = ["created", "id", "name", "opt_in_process", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-bulk-import-jobs/{id}/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_list_for_bulk_import_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_list_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list_ids_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_job_relationships_lists, get_list_ids_for_profile_bulk_import_job, get_profile_bulk_import_job_relationships_lists

Get List IDs for Bulk Import Profiles Job Get list relationship for the bulk profile import job with the given ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: lists:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


1784
1785
1786
1787
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1784

def get_list_ids_for_bulk_import_profiles_job(id, opts = {})
  data, _status_code, _headers = get_list_ids_for_bulk_import_profiles_job_with_http_info(id, opts)
  data
end

#get_list_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_job_relationships_lists_with_http_info, get_list_ids_for_profile_bulk_import_job_with_http_info, get_profile_bulk_import_job_relationships_lists_with_http_info

Get List IDs for Bulk Import Profiles Job Get list relationship for the bulk profile import job with the given ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `lists:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1803

def get_list_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_list_ids_for_bulk_import_profiles_job ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_list_ids_for_bulk_import_profiles_job"
  end
  # resource path
  local_var_path = '/api/profile-bulk-import-jobs/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_list_ids_for_bulk_import_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_list_ids_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list_ids_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_relationships_lists

Get List IDs for Profile Get list memberships for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: lists:read profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


1867
1868
1869
1870
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1867

def get_list_ids_for_profile(id, opts = {})
  data, _status_code, _headers = get_list_ids_for_profile_with_http_info(id, opts)
  data
end

#get_list_ids_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_relationships_lists_with_http_info

Get List IDs for Profile Get list memberships for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `lists:read` `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1880

def get_list_ids_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_list_ids_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_list_ids_for_profile"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_list_ids_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_list_ids_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_lists_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_lists

Get Lists for Profile Get list memberships for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: lists:read profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


1939
1940
1941
1942
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1939

def get_lists_for_profile(id, opts = {})
  data, _status_code, _headers = get_lists_for_profile_with_http_info(id, opts)
  data
end

#get_lists_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_lists_with_http_info

Get Lists for Profile Get list memberships for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `lists:read` `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1953

def get_lists_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_lists_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_lists_for_profile"
  end
  allowable_values = ["created", "id", "name", "opt_in_process", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_lists_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_lists_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profile(id, opts = {}) ⇒ Hash<String, Object>

Get Profile Get the profile with the given profile ID. Use the additional-fields parameter to include subscriptions and predictive analytics data in your response.

Rate limits:
Burst: 75/s<br>Steady: 750/m<br>
Rate limits when using the include=list parameter in your API request:
Burst: 1/s<br>Steady: 15/m<br>
Rate limits when using the include=segment parameter in your API request:
Burst: 1/s<br>Steady: 15/m<br>
To learn more about how the include parameter impacts rate limits, check out our Rate limits, status codes, and errors guide. Scopes: profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2023
2024
2025
2026
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2023

def get_profile(id, opts = {})
  data, _status_code, _headers = get_profile_with_http_info(id, opts)
  data
end

#get_profile_for_push_token(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_push_token_profile

Get Profile for Push Token Return the profile associated with the given push token.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read push-tokens:read OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2132
2133
2134
2135
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2132

def get_profile_for_push_token(id, opts = {})
  data, _status_code, _headers = get_profile_for_push_token_with_http_info(id, opts)
  data
end

#get_profile_for_push_token_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_push_token_profile_with_http_info

Get Profile for Push Token Return the profile associated with the given push token.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` `push-tokens:read` OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2147

def get_profile_for_push_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_for_push_token ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_for_push_token"
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/push-tokens/{id}/profile'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_profile_for_push_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_profile_for_push_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profile_id_for_push_token(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_push_token_relationships_profile

Get Profile ID for Push Token Return the ID of the profile associated with the given push token.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read push-tokens:read OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


2215
2216
2217
2218
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2215

def get_profile_id_for_push_token(id, opts = {})
  data, _status_code, _headers = get_profile_id_for_push_token_with_http_info(id, opts)
  data
end

#get_profile_id_for_push_token_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_push_token_relationships_profile_with_http_info

Get Profile ID for Push Token Return the ID of the profile associated with the given push token.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` `push-tokens:read` OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2228

def get_profile_id_for_push_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_id_for_push_token ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_id_for_push_token"
  end
  # resource path
  local_var_path = '/api/push-tokens/{id}/relationships/profile'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_profile_id_for_push_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_profile_id_for_push_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profile_ids_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_job_relationships_profiles, get_profile_bulk_import_job_relationships_profiles, get_profile_ids_for_profile_bulk_import_job

Get Profile IDs for Bulk Import Profiles Job Get profile relationships for the bulk profile import job with the given ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2288
2289
2290
2291
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2288

def get_profile_ids_for_bulk_import_profiles_job(id, opts = {})
  data, _status_code, _headers = get_profile_ids_for_bulk_import_profiles_job_with_http_info(id, opts)
  data
end

#get_profile_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_job_relationships_profiles_with_http_info, get_profile_bulk_import_job_relationships_profiles_with_http_info, get_profile_ids_for_profile_bulk_import_job_with_http_info

Get Profile IDs for Bulk Import Profiles Job Get profile relationships for the bulk profile import job with the given ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2309

def get_profile_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_ids_for_bulk_import_profiles_job ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_ids_for_bulk_import_profiles_job"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profile_ids_for_bulk_import_profiles_job, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profile_ids_for_bulk_import_profiles_job, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/profile-bulk-import-jobs/{id}/relationships/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_profile_ids_for_bulk_import_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_profile_ids_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Get Profile Get the profile with the given profile ID. Use the `additional-fields` parameter to include subscriptions and predictive analytics data in your response.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m`<br><br>Rate limits when using the `include=list` parameter in your API request:<br>Burst: `1/s`<br>Steady: `15/m`<br><br>Rate limits when using the `include=segment` parameter in your API request:<br>Burst: `1/s`<br>Steady: `15/m`<br><br>To learn more about how the `include` parameter impacts rate limits, check out our Rate limits, status codes, and errors guide. Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2040

def get_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile"
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["channel", "id"]
  if @api_client.config.client_side_validation && opts[:'fields_conversation'] && !opts[:'fields_conversation'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_conversation\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "id", "name", "opt_in_process", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["background", "created", "enablement_status", "id", "metadata", "metadata.app_build", "metadata.app_id", "metadata.app_name", "metadata.app_version", "metadata.device_id", "metadata.device_model", "metadata.environment", "metadata.klaviyo_sdk", "metadata.manufacturer", "metadata.os_name", "metadata.os_version", "metadata.sdk_version", "platform", "recorded_date", "token", "vendor"]
  if @api_client.config.client_side_validation && opts[:'fields_push_token'] && !opts[:'fields_push_token'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_push_token\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "definition", "definition.condition_groups", "id", "is_active", "is_processing", "is_starred", "name", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}"
  end
  allowable_values = ["conversations", "lists", "push-tokens", "segments"]
  if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[conversation]'] = @api_client.build_collection_param(opts[:'fields_conversation'], :csv) if !opts[:'fields_conversation'].nil?
  query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
  query_params[:'fields[push-token]'] = @api_client.build_collection_param(opts[:'fields_push_token'], :csv) if !opts[:'fields_push_token'].nil?
  query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profiles(opts = {}) ⇒ Hash<String, Object>

Get Profiles Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: id, created, updated, email, subscriptions.email.marketing.suppression.timestamp, subscriptions.email.marketing.list_suppressions.timestamp Use the additional-fields parameter to include subscriptions and predictive analytics data in your response.

Rate limits:
Burst: 75/s<br>Steady: 750/m<br>
Rate limits when using the additional-fields[profile]=predictive_analytics parameter in your API request:
Burst: 10/s<br>Steady: 150/m<br>
To learn more about how the additional-fields parameter impacts rate limits, check out our Rate limits, status codes, and errors guide. Scopes: profiles:read OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2391
2392
2393
2394
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2391

def get_profiles(opts = {})
  data, _status_code, _headers = get_profiles_with_http_info(opts)
  data
end

#get_profiles_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_bulk_profile_import_job_profiles, get_profile_bulk_import_job_profiles, get_profiles_for_profile_bulk_import_job

Get Profiles for Bulk Import Profiles Job Get profiles for the bulk profile import job with the given ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2505
2506
2507
2508
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2505

def get_profiles_for_bulk_import_profiles_job(id, opts = {})
  data, _status_code, _headers = get_profiles_for_bulk_import_profiles_job_with_http_info(id, opts)
  data
end

#get_profiles_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_bulk_profile_import_job_profiles_with_http_info, get_profile_bulk_import_job_profiles_with_http_info, get_profiles_for_profile_bulk_import_job_with_http_info

Get Profiles for Bulk Import Profiles Job Get profiles for the bulk profile import job with the given ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2528

def get_profiles_for_bulk_import_profiles_job_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profiles_for_bulk_import_profiles_job ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profiles_for_bulk_import_profiles_job"
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profiles_for_bulk_import_profiles_job, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profiles_for_bulk_import_profiles_job, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/profile-bulk-import-jobs/{id}/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_profiles_for_bulk_import_profiles_job",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_profiles_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_profiles_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Get Profiles Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: `id`, `created`, `updated`, `email`, `subscriptions.email.marketing.suppression.timestamp`, `subscriptions.email.marketing.list_suppressions.timestamp` Use the `additional-fields` parameter to include subscriptions and predictive analytics data in your response.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m`<br><br>Rate limits when using the `additional-fields=predictive_analytics` parameter in your API request:<br>Burst: `10/s`<br>Steady: `150/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our Rate limits, status codes, and errors guide. Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2409

def get_profiles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profiles ...'
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["channel", "id"]
  if @api_client.config.client_side_validation && opts[:'fields_conversation'] && !opts[:'fields_conversation'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_conversation\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["background", "created", "enablement_status", "id", "metadata", "metadata.app_build", "metadata.app_id", "metadata.app_name", "metadata.app_version", "metadata.device_id", "metadata.device_model", "metadata.environment", "metadata.klaviyo_sdk", "metadata.manufacturer", "metadata.os_name", "metadata.os_version", "metadata.sdk_version", "platform", "recorded_date", "token", "vendor"]
  if @api_client.config.client_side_validation && opts[:'fields_push_token'] && !opts[:'fields_push_token'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_push_token\", must include one of #{allowable_values}"
  end
  allowable_values = ["conversations", "push-tokens"]
  if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profiles, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profiles, must be greater than or equal to 1.'
  end

  allowable_values = ["created", "-created", "email", "-email", "id", "-id", "subscriptions.email.marketing.list_suppressions.timestamp", "-subscriptions.email.marketing.list_suppressions.timestamp", "subscriptions.email.marketing.suppression.timestamp", "-subscriptions.email.marketing.suppression.timestamp", "updated", "-updated"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[conversation]'] = @api_client.build_collection_param(opts[:'fields_conversation'], :csv) if !opts[:'fields_conversation'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
  query_params[:'fields[push-token]'] = @api_client.build_collection_param(opts[:'fields_push_token'], :csv) if !opts[:'fields_push_token'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_push_token(id, opts = {}) ⇒ Hash<String, Object>

Get Push Token Return a specific push token based on its ID.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read push-tokens:read OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2615
2616
2617
2618
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2615

def get_push_token(id, opts = {})
  data, _status_code, _headers = get_push_token_with_http_info(id, opts)
  data
end

#get_push_token_ids_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_relationships_push_tokens

Get Push Token IDs for Profile Return the IDs of all push tokens associated with the given profile.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


2698
2699
2700
2701
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2698

def get_push_token_ids_for_profile(id, opts = {})
  data, _status_code, _headers = get_push_token_ids_for_profile_with_http_info(id, opts)
  data
end

#get_push_token_ids_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_relationships_push_tokens_with_http_info

Get Push Token IDs for Profile Return the IDs of all push tokens associated with the given profile.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2711

def get_push_token_ids_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_push_token_ids_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_push_token_ids_for_profile"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/relationships/push-tokens'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_push_token_ids_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_push_token_ids_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_push_token_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Get Push Token Return a specific push token based on its ID.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` `push-tokens:read` OpenAPI Spec

Parameters:

  • id (String) —

    The value of the push token

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2628

def get_push_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_push_token ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_push_token"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "properties", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["background", "created", "enablement_status", "id", "metadata", "metadata.app_build", "metadata.app_id", "metadata.app_name", "metadata.app_version", "metadata.device_id", "metadata.device_model", "metadata.environment", "metadata.klaviyo_sdk", "metadata.manufacturer", "metadata.os_name", "metadata.os_version", "metadata.sdk_version", "platform", "recorded_date", "token", "vendor"]
  if @api_client.config.client_side_validation && opts[:'fields_push_token'] && !opts[:'fields_push_token'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_push_token\", must include one of #{allowable_values}"
  end
  allowable_values = ["profile"]
  if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/push-tokens/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
  query_params[:'fields[push-token]'] = @api_client.build_collection_param(opts[:'fields_push_token'], :csv) if !opts[:'fields_push_token'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_push_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_push_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_push_tokens(opts = {}) ⇒ Hash<String, Object>

Get Push Tokens Return push tokens associated with company.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read push-tokens:read OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2774
2775
2776
2777
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2774

def get_push_tokens(opts = {})
  data, _status_code, _headers = get_push_tokens_with_http_info(opts)
  data
end

#get_push_tokens_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_push_tokens

Get Push Tokens for Profile Return all push tokens that belong to the given profile.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


2867
2868
2869
2870
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2867

def get_push_tokens_for_profile(id, opts = {})
  data, _status_code, _headers = get_push_tokens_for_profile_with_http_info(id, opts)
  data
end

#get_push_tokens_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_push_tokens_with_http_info

Get Push Tokens for Profile Return all push tokens that belong to the given profile.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2881

def get_push_tokens_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_push_tokens_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_push_tokens_for_profile"
  end
  allowable_values = ["background", "created", "enablement_status", "id", "metadata", "metadata.app_build", "metadata.app_id", "metadata.app_name", "metadata.app_version", "metadata.device_id", "metadata.device_model", "metadata.environment", "metadata.klaviyo_sdk", "metadata.manufacturer", "metadata.os_name", "metadata.os_version", "metadata.sdk_version", "platform", "recorded_date", "token", "vendor"]
  if @api_client.config.client_side_validation && opts[:'fields_push_token'] && !opts[:'fields_push_token'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_push_token\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/push-tokens'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[push-token]'] = @api_client.build_collection_param(opts[:'fields_push_token'], :csv) if !opts[:'fields_push_token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_push_tokens_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_push_tokens_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_push_tokens_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Get Push Tokens Return push tokens associated with company.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:read` `push-tokens:read` OpenAPI Spec

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2789

def get_push_tokens_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_push_tokens ...'
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "properties", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["background", "created", "enablement_status", "id", "metadata", "metadata.app_build", "metadata.app_id", "metadata.app_name", "metadata.app_version", "metadata.device_id", "metadata.device_model", "metadata.environment", "metadata.klaviyo_sdk", "metadata.manufacturer", "metadata.os_name", "metadata.os_version", "metadata.sdk_version", "platform", "recorded_date", "token", "vendor"]
  if @api_client.config.client_side_validation && opts[:'fields_push_token'] && !opts[:'fields_push_token'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_push_token\", must include one of #{allowable_values}"
  end
  allowable_values = ["profile"]
  if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_push_tokens, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_push_tokens, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/push-tokens'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
  query_params[:'fields[push-token]'] = @api_client.build_collection_param(opts[:'fields_push_token'], :csv) if !opts[:'fields_push_token'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_push_tokens",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_push_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_segment_ids_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_relationships_segments

Get Segment IDs for Profile Get segment membership relationships for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: profiles:read segments:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Hash<String, Object>)


2944
2945
2946
2947
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2944

def get_segment_ids_for_profile(id, opts = {})
  data, _status_code, _headers = get_segment_ids_for_profile_with_http_info(id, opts)
  data
end

#get_segment_ids_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_relationships_segments_with_http_info

Get Segment IDs for Profile Get segment membership relationships for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `profiles:read` `segments:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2957

def get_segment_ids_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_segment_ids_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_segment_ids_for_profile"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/relationships/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_segment_ids_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_segment_ids_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_segments_for_profile(id, opts = {}) ⇒ Hash<String, Object> Also known as: get_profile_segments

Get Segments for Profile Get segment memberships for a profile with the given profile ID.

Rate limits:
Burst: 3/s<br>Steady: 60/m Scopes: profiles:read segments:read OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


3016
3017
3018
3019
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 3016

def get_segments_for_profile(id, opts = {})
  data, _status_code, _headers = get_segments_for_profile_with_http_info(id, opts)
  data
end

#get_segments_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: get_profile_segments_with_http_info

Get Segments for Profile Get segment memberships for a profile with the given profile ID.<br><br>Rate limits:<br>Burst: `3/s`<br>Steady: `60/m` Scopes: `profiles:read` `segments:read` OpenAPI Spec

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 3030

def get_segments_for_profile_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.get_segments_for_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_segments_for_profile"
  end
  allowable_values = ["created", "definition", "definition.condition_groups", "id", "is_active", "is_processing", "is_starred", "name", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.get_segments_for_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#get_segments_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#merge_profiles(profile_merge_query, opts = {}) ⇒ Hash<String, Object> Also known as: create_profile_merge

Merge Profiles Merge a given related profile into a profile with the given profile ID. The profile provided under relationships (the "source" profile) will be merged into the profile provided by the ID in the base data object (the "destination" profile). This endpoint queues an asynchronous task which will merge data from the source profile into the destination profile, deleting the source profile in the process. This endpoint accepts only one source profile. To learn more about how profile data is preserved or overwritten during a merge, please visit our Help Center.

Rate limits:
Burst: 10/s<br>Steady: 150/m Scopes: profiles:write OpenAPI Spec

Parameters:

  • profile_merge_query (ProfileMergeQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


3094
3095
3096
3097
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 3094

def merge_profiles(profile_merge_query, opts = {})
  data, _status_code, _headers = merge_profiles_with_http_info(profile_merge_query, opts)
  data
end

#merge_profiles_with_http_info(profile_merge_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: create_profile_merge_with_http_info

Merge Profiles Merge a given related profile into a profile with the given profile ID. The profile provided under `relationships` (the &quot;source&quot; profile) will be merged into the profile provided by the ID in the base data object (the &quot;destination&quot; profile). This endpoint queues an asynchronous task which will merge data from the source profile into the destination profile, deleting the source profile in the process. This endpoint accepts only one source profile. To learn more about how profile data is preserved or overwritten during a merge, please visit our Help Center.<br><br>Rate limits:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:write` OpenAPI Spec

Parameters:

  • profile_merge_query (ProfileMergeQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 3108

def merge_profiles_with_http_info(profile_merge_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.merge_profiles ...'
  end
  # verify the required parameter 'profile_merge_query' is set
  if @api_client.config.client_side_validation && profile_merge_query.nil?
    fail ArgumentError, "Missing the required parameter 'profile_merge_query' when calling ProfilesApi.merge_profiles"
  end
  allowable_values = ["id"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profile-merge'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_merge_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.merge_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#merge_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_profile(id, profile_partial_update_query, opts = {}) ⇒ Hash<String, Object>

Update Profile Update the profile with the given profile ID. Use the additional-fields parameter to include subscriptions and predictive analytics data in your response. Note that setting a field to null will clear out the field, whereas not including a field in your request will leave it unchanged. The maximum allowed payload size is 100KB.

Rate limits:
Burst: 75/s<br>Steady: 750/m Scopes: profiles:write OpenAPI Spec

Parameters:

  • id (String) —

    Primary key that uniquely identifies this profile. Generated by Klaviyo.

  • profile_partial_update_query (ProfilePartialUpdateQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Hash<String, Object>)


3179
3180
3181
3182
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 3179

def update_profile(id, profile_partial_update_query, opts = {})
  data, _status_code, _headers = update_profile_with_http_info(id, profile_partial_update_query, opts)
  data
end

#update_profile_with_http_info(id, profile_partial_update_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Update Profile Update the profile with the given profile ID. Use the `additional-fields` parameter to include subscriptions and predictive analytics data in your response. Note that setting a field to `null` will clear out the field, whereas not including a field in your request will leave it unchanged. The maximum allowed payload size is 100KB.<br><br>Rate limits:<br>Burst: `75/s`<br>Steady: `750/m` Scopes: `profiles:write` OpenAPI Spec

Parameters:

  • id (String) —

    Primary key that uniquely identifies this profile. Generated by Klaviyo.

  • profile_partial_update_query (ProfilePartialUpdateQuery)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>) —

    Hash<String, Object> data, response status code and response headers



3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 3192

def update_profile_with_http_info(id, profile_partial_update_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfilesApi.update_profile ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.update_profile"
  end
  # verify the required parameter 'profile_partial_update_query' is set
  if @api_client.config.client_side_validation && profile_partial_update_query.nil?
    fail ArgumentError, "Missing the required parameter 'profile_partial_update_query' when calling ProfilesApi.update_profile"
  end
  allowable_values = ["subscriptions", "predictive_analytics"]
  if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}"
  end
  allowable_values = ["created", "email", "external_id", "first_name", "id", "image", "last_event_date", "last_name", "locale", "location", "location.address1", "location.address2", "location.city", "location.country", "location.ip", "location.latitude", "location.longitude", "location.region", "location.timezone", "location.zip", "organization", "phone_number", "predictive_analytics", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order", "predictive_analytics.historic_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_clv", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.ranked_channel_affinity", "predictive_analytics.total_clv", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.list_suppressions", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.suppression", "subscriptions.email.open_tracking", "subscriptions.email.open_tracking.can_receive", "subscriptions.email.open_tracking.consent", "subscriptions.email.open_tracking.consent_timestamp", "subscriptions.email.open_tracking.created_timestamp", "subscriptions.email.open_tracking.last_updated", "subscriptions.email.open_tracking.metadata", "subscriptions.email.open_tracking.valid_until", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.last_updated", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.whatsapp", "subscriptions.whatsapp.conversational", "subscriptions.whatsapp.conversational.can_receive", "subscriptions.whatsapp.conversational.consent", "subscriptions.whatsapp.conversational.consent_timestamp", "subscriptions.whatsapp.conversational.created_timestamp", "subscriptions.whatsapp.conversational.last_updated", "subscriptions.whatsapp.conversational.metadata", "subscriptions.whatsapp.conversational.phone_number", "subscriptions.whatsapp.conversational.valid_until", "subscriptions.whatsapp.marketing", "subscriptions.whatsapp.marketing.can_receive", "subscriptions.whatsapp.marketing.consent", "subscriptions.whatsapp.marketing.consent_timestamp", "subscriptions.whatsapp.marketing.created_timestamp", "subscriptions.whatsapp.marketing.last_updated", "subscriptions.whatsapp.marketing.metadata", "subscriptions.whatsapp.marketing.phone_number", "subscriptions.whatsapp.marketing.valid_until", "subscriptions.whatsapp.transactional", "subscriptions.whatsapp.transactional.can_receive", "subscriptions.whatsapp.transactional.consent", "subscriptions.whatsapp.transactional.consent_timestamp", "subscriptions.whatsapp.transactional.created_timestamp", "subscriptions.whatsapp.transactional.last_updated", "subscriptions.whatsapp.transactional.metadata", "subscriptions.whatsapp.transactional.phone_number", "subscriptions.whatsapp.transactional.valid_until", "title", "updated"]
  if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/profiles/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil?
  query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_partial_update_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"ProfilesApi.update_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfilesApi#update_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end