Class: KlaviyoAPI::ProfilesApi
- Inherits:
-
Object
- Object
- KlaviyoAPI::ProfilesApi
- Defined in:
- lib/klaviyo-api-sdk/api/profiles_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#bulk_import_profiles(profile_import_job_create_query, opts = {}) ⇒ Hash<String, Object>
(also: #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.
-
#bulk_import_profiles_with_http_info(profile_import_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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.
-
#bulk_subscribe_profiles(subscription_create_job_create_query, opts = {}) ⇒ nil
(also: #subscribe_profiles, #create_profile_subscription_bulk_create_job)
Bulk Subscribe Profiles Subscribe one or more profiles to email marketing, SMS marketing, or both.
-
#bulk_subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
(also: #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, or both.
-
#bulk_suppress_profiles(suppression_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
(also: #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.
-
#bulk_suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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.
-
#bulk_unsubscribe_profiles(subscription_delete_job_create_query, opts = {}) ⇒ nil
(also: #unsubscribe_profiles, #create_profile_subscription_bulk_delete_job)
Bulk Unsubscribe Profiles Unsubscribe one or more profiles to email marketing, SMS marketing, or both.
-
#bulk_unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts = {}) ⇒ Array<(nil, Integer, Hash)>
(also: #unsubscribe_profiles_with_http_info, #create_profile_subscription_bulk_delete_job_with_http_info)
Bulk Unsubscribe Profiles Unsubscribe one or more profiles to email marketing, SMS marketing, or both.
-
#bulk_unsuppress_profiles(suppression_delete_job_create_query, opts = {}) ⇒ Hash<String, Object>
(also: #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.
-
#bulk_unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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.
-
#create_or_update_profile(profile_upsert_query, opts = {}) ⇒ Hash<String, Object>
(also: #create_profile_import)
Create or Update Profile Given a set of profile attributes and optionally an ID, create or update a profile.
-
#create_or_update_profile_with_http_info(profile_upsert_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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.
-
#create_profile(profile_create_query, opts = {}) ⇒ Hash<String, Object>
Create Profile Create a new profile.
-
#create_profile_with_http_info(profile_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Create Profile Create a new profile.
-
#create_push_token(push_token_create_query, opts = {}) ⇒ nil
Create or Update Push Token Create or update a push token.
-
#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.
-
#get_bulk_import_profiles_job(job_id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `150/m` Scopes: `lists:read` `profiles:read`. -
#get_bulk_import_profiles_job_with_http_info(job_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_bulk_import_profiles_jobs(opts = {}) ⇒ Hash<String, Object>
(also: #get_bulk_profile_import_jobs, #get_profile_bulk_import_jobs)
Get Bulk Import Profiles Jobs Get all bulk profile import jobs.
-
#get_bulk_import_profiles_jobs_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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.
-
#get_bulk_suppress_profiles_job(job_id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `700/m` Scopes: `subscriptions:read`. -
#get_bulk_suppress_profiles_job_with_http_info(job_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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: `700/m` Scopes: `subscriptions:read`.
-
#get_bulk_suppress_profiles_jobs(opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `700/m` Scopes: `subscriptions:read`. -
#get_bulk_suppress_profiles_jobs_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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: `700/m` Scopes: `subscriptions:read`.
-
#get_bulk_unsuppress_profiles_job(job_id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `700/m` Scopes: `subscriptions:read`. -
#get_bulk_unsuppress_profiles_job_with_http_info(job_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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: `700/m` Scopes: `subscriptions:read`.
-
#get_bulk_unsuppress_profiles_jobs(opts = {}) ⇒ Hash<String, Object>
(also: #get_profile_suppression_bulk_delete_jobs)
Get Bulk Unsuppress Profiles Jobs Get all bulk unsuppress profiles jobs.
*Rate limits*:
Burst: ‘75/s`
Steady: `700/m` Scopes: `subscriptions:read`. -
#get_bulk_unsuppress_profiles_jobs_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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: `700/m` Scopes: `subscriptions:read`.
-
#get_errors_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `150/m` Scopes: `profiles:read`. -
#get_errors_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_list_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `150/m` Scopes: `lists:read`. -
#get_list_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_list_ids_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `150/m` Scopes: `lists:read`. -
#get_list_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_list_ids_for_profile(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `60/m` Scopes: `lists:read` `profiles:read`. -
#get_list_ids_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_lists_for_profile(id, opts = {}) ⇒ Hash<String, Object>
(also: #get_profile_lists)
Get Lists for Profile Get list memberships for a profile with the given profile ID.
*Rate limits*:
Burst: ‘3/s`
Steady: `60/m` Scopes: `lists:read` `profiles:read`. -
#get_lists_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_profile(id, opts = {}) ⇒ Hash<String, Object>
Get Profile Get the profile with the given profile ID.
-
#get_profile_ids_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `150/m` Scopes: `profiles:read`. -
#get_profile_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Get the profile with the given profile ID.
-
#get_profiles(opts = {}) ⇒ Hash<String, Object>
Get Profiles Get all profiles in an account.
-
#get_profiles_for_bulk_import_profiles_job(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `150/m` Scopes: `profiles:read`. -
#get_profiles_for_bulk_import_profiles_job_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_profiles_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profiles Get all profiles in an account.
-
#get_segment_ids_for_profile(id, opts = {}) ⇒ Hash<String, Object>
(also: #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`
Steady: `60/m` Scopes: `profiles:read` `segments:read`. -
#get_segment_ids_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#get_segments_for_profile(id, opts = {}) ⇒ Hash<String, Object>
(also: #get_profile_segments)
Get Segments for Profile Get segment memberships for a profile with the given profile ID.
*Rate limits*:
Burst: ‘3/s`
Steady: `60/m` Scopes: `profiles:read` `segments:read`. -
#get_segments_for_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #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`.
-
#initialize(api_client = ApiClient.default) ⇒ ProfilesApi
constructor
A new instance of ProfilesApi.
-
#merge_profiles(profile_merge_query, opts = {}) ⇒ Hash<String, Object>
(also: #create_profile_merge)
Merge Profiles Merge a given related profile into a profile with the given profile ID.
-
#merge_profiles_with_http_info(profile_merge_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
(also: #create_profile_merge_with_http_info)
Merge Profiles Merge a given related profile into a profile with the given profile ID.
-
#update_profile(id, profile_partial_update_query, opts = {}) ⇒ Hash<String, Object>
Update Profile Update the profile with the given profile ID.
-
#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.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ProfilesApi
Returns a new instance of ProfilesApi.
19 20 21 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 17 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. To learn more, see our [Bulk Profile Import API guide](developers.klaviyo.com/en/docs/use_klaviyos_bulk_profile_import_api).
*Rate limits*:
Burst: ‘10/s`
Steady: `150/m` Scopes: `lists:write` `profiles:write`
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. To learn more, see our [Bulk Profile Import API guide](developers.klaviyo.com/en/docs/use_klaviyos_bulk_profile_import_api).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `lists:write` `profiles:write`
43 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 43 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 # resource path local_var_path = '/api/profile-bulk-import-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'] || "2025-01-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'] = 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, ) 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, or both. 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](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). If a list is not provided, the opt-in process used will be determined by the [account-level default opt-in setting](www.klaviyo.com/settings/account/api-keys). To add someone to a list without changing their subscription status, use [Add Profile to List](developers.klaviyo.com/en/reference/create_list_relationships). This API will remove any ‘UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about [suppressed profiles](help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1). 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.
*Rate limits*:
Burst: `75/s`
Steady: `700/m` Scopes: `lists:write` `profiles:write` `subscriptions:write`
109 110 111 112 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 109 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, or both. 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](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). If a list is not provided, the opt-in process used will be determined by the [account-level default opt-in setting](www.klaviyo.com/settings/account/api-keys). To add someone to a list without changing their subscription status, use [Add Profile to List](developers.klaviyo.com/en/reference/create_list_relationships). This API will remove any `UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about [suppressed profiles](help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1). 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.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `lists:write` `profiles:write` `subscriptions:write`
125 126 127 128 129 130 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 125 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'] || "2025-01-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'] = 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, ) 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](help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100
*Rate limits*:
Burst: ‘75/s`
Steady: `700/m` Scopes: `profiles:write` `subscriptions:write`
191 192 193 194 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 191 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](help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `profiles:write` `subscriptions:write`
207 208 209 210 211 212 213 214 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 207 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 # resource path local_var_path = '/api/profile-suppression-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'] || "2025-01-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'] = 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, ) 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 Unsubscribe one or more profiles to email marketing, SMS marketing, or both. Learn more about [consent in this guide](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). To remove someone from a list without changing their subscription status, use [Remove Profile from List](developers.klaviyo.com/en/reference/delete_list_relationships). Maximum number of profile can be submitted for unsubscription: 100
*Rate limits*:
Burst: ‘75/s`
Steady: `700/m` Scopes: `lists:write` `profiles:write` `subscriptions:write`
273 274 275 276 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 273 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 Unsubscribe one or more profiles to email marketing, SMS marketing, or both. Learn more about [consent in this guide](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). To remove someone from a list without changing their subscription status, use [Remove Profile from List](developers.klaviyo.com/en/reference/delete_list_relationships). Maximum number of profile can be submitted for unsubscription: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `lists:write` `profiles:write` `subscriptions:write`
289 290 291 292 293 294 295 296 297 298 299 300 301 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 289 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'] || "2025-01-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'] = 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, ) 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](help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100
*Rate limits*:
Burst: ‘75/s`
Steady: `700/m` Scopes: `subscriptions:write`
355 356 357 358 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 355 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](help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `subscriptions:write`
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 371 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 # resource path local_var_path = '/api/profile-suppression-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'] || "2025-01-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'] = 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, ) 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.
*Rate limits*:
Burst: `75/s`
Steady: `700/m` Scopes: `profiles:write`
438 439 440 441 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 438 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.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `profiles:write`
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 452 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 # 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? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-01-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'] = 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, ) 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.
*Rate limits*:
Burst: `75/s`
Steady: `700/m` Scopes: `profiles:write`
521 522 523 524 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 521 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.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `profiles:write`
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 532 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 # 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? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-01-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'] = 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, ) 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](github.com/klaviyo/klaviyo-swift-sdk) and [Android](github.com/klaviyo/klaviyo-android-sdk)) to create push tokens from users’ devices.
*Rate limits*:
Burst: ‘75/s`
Steady: `700/m` Scopes: `profiles:write` `push-tokens:write`
597 598 599 600 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 597 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](github.com/klaviyo/klaviyo-swift-sdk) and [Android](github.com/klaviyo/klaviyo-android-sdk)) to create push tokens from users' devices.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `profiles:write` `push-tokens:write`
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 607 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'] || "2025-01-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'] = 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, ) 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 |
#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`
Steady: `150/m` Scopes: `lists:read` `profiles:read`
670 671 672 673 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 670 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`
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 689 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 = ["name", "created", "updated", "opt_in_process"] 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 = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "started_at"] 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'] || "2025-01-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'] = 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, ) 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`
Steady: `150/m` Scopes: `lists:read` `profiles:read`
769 770 771 772 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 769 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`
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 852 853 854 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 789 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 = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "started_at"] 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'] || "2025-01-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'] = 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, ) 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`
Steady: `700/m` Scopes: `subscriptions:read`
868 869 870 871 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 868 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: `700/m` Scopes: `subscriptions:read`
882 883 884 885 886 887 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 882 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 = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_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'] || "2025-01-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'] = 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, ) 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`
Steady: `700/m` Scopes: `subscriptions:read`
948 949 950 951 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 948 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: `700/m` Scopes: `subscriptions:read`
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 964 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 = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_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'] || "2025-01-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'] = 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, ) 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`
Steady: `700/m` Scopes: `subscriptions:read`
1031 1032 1033 1034 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1031 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: `700/m` Scopes: `subscriptions:read`
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1045 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 = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_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'] || "2025-01-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'] = 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, ) 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`
Steady: `700/m` Scopes: `subscriptions:read`
1111 1112 1113 1114 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1111 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: `700/m` Scopes: `subscriptions:read`
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1127 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 = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_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'] || "2025-01-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'] = 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, ) 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_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`
Steady: `150/m` Scopes: `profiles:read`
1196 1197 1198 1199 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1196 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`
1218 1219 1220 1221 1222 1223 1224 1225 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1218 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", "title", "detail", "source", "source.pointer", "original_payload"] 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'] || "2025-01-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'] = 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, ) 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`
Steady: `150/m` Scopes: `lists:read`
1298 1299 1300 1301 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1298 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`
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 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1318 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 = ["name", "created", "updated", "opt_in_process"] 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'] || "2025-01-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'] = 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, ) 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`
Steady: `150/m` Scopes: `lists:read`
1387 1388 1389 1390 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1387 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`
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 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1406 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'] || "2025-01-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'] = 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, ) 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`
Steady: `60/m` Scopes: `lists:read` `profiles:read`
1470 1471 1472 1473 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1470 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`
1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1483 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'] || "2025-01-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'] = 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, ) 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`
Steady: `60/m` Scopes: `lists:read` `profiles:read`
1542 1543 1544 1545 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1542 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`
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 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1556 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 = ["name", "created", "updated", "opt_in_process"] 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'] || "2025-01-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'] = 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, ) 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`
Steady: `700/m`
Rate limits when using the `include=list` parameter in your API request:
Burst: `1/s`
Steady: `15/m`
Rate limits when using the `include=segment` parameter in your API request:
Burst: `1/s`
Steady: `15/m`
To learn more about how the `include` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](developers.klaviyo.com/en/v2025-01-15/docs/rate_limits_and_error_handling) guide. Scopes: `profiles:read`
1624 1625 1626 1627 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1624 def get_profile(id, opts = {}) data, _status_code, _headers = get_profile_with_http_info(id, opts) data 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`
Steady: `150/m` Scopes: `profiles:read`
1721 1722 1723 1724 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1721 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`
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 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1742 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'] || "2025-01-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'] = 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, ) 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: `700/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](developers.klaviyo.com/en/v2025-01-15/docs/rate_limits_and_error_handling) guide. Scopes: `profiles:read`
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 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1639 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 = ["name", "created", "updated", "opt_in_process"] 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 = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "location.ip", "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.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "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", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] 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 = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] 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 = ["lists", "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[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[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'] || "2025-01-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'] = 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, ) 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`
Steady: `700/m`
Rate limits when using the `additional-fields=predictive_analytics` parameter in your API request:
Burst: `10/s`
Steady: `150/m`
To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](developers.klaviyo.com/en/v2025-01-15/docs/rate_limits_and_error_handling) guide. Scopes: `profiles:read`
1821 1822 1823 1824 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1821 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`
Steady: `150/m` Scopes: `profiles:read`
1917 1918 1919 1920 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1917 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`
1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 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 2007 2008 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1940 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 = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "location.ip", "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.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "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", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] 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'] || "2025-01-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'] = 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, ) 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: `700/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](developers.klaviyo.com/en/v2025-01-15/docs/rate_limits_and_error_handling) guide. Scopes: `profiles:read`
1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 1836 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 = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "location.ip", "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.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "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", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] 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, 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[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].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'] || "2025-01-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'] = 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, ) 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_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`
Steady: `60/m` Scopes: `profiles:read` `segments:read`
2024 2025 2026 2027 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2024 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`
2037 2038 2039 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 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2037 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'] || "2025-01-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'] = 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, ) 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`
Steady: `60/m` Scopes: `profiles:read` `segments:read`
2096 2097 2098 2099 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2096 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`
2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2110 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 = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] 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'] || "2025-01-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'] = 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, ) 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](help.klaviyo.com/hc/en-us/articles/115005073847#merge-2-profiles3).
*Rate limits*:
Burst: `10/s`
Steady: `150/m` Scopes: `profiles:write`
2173 2174 2175 2176 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2173 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 "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](help.klaviyo.com/hc/en-us/articles/115005073847#merge-2-profiles3).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` Scopes: `profiles:write`
2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2186 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 # resource path local_var_path = '/api/profile-merge' # 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'] || "2025-01-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'] = 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, ) 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.
*Rate limits*:
Burst: `75/s`
Steady: `700/m` Scopes: `profiles:write`
2251 2252 2253 2254 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2251 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.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` Scopes: `profiles:write`
2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 |
# File 'lib/klaviyo-api-sdk/api/profiles_api.rb', line 2263 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 # 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? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-01-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'] = 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, ) 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 |