klaviyo/api

PHP SDK for Klaviyo's API.

12.0.1 2024-12-05 15:16 UTC

README

  • SDK version: 12.0.1
  • API Revision: 2024-10-15

Helpful Resources

Design & Approach

This SDK is a thin wrapper around our API. See our API Reference for full documentation on behavior.

This SDK mirrors the organization and naming convention of the above language-agnostic resources, with a few namespace changes to conform to PHP idioms (details in Appendix).

Organization

This SDK is organized into the following resources:

  • Accounts

  • Campaigns

  • Catalogs

  • Coupons

  • DataPrivacy

  • Events

  • Flows

  • Forms

  • Images

  • Lists

  • Metrics

  • Profiles

  • Reporting

  • Reviews

  • Segments

  • Tags

  • Templates

  • TrackingSettings

  • Webhooks

Installation

You can install this package using our Packagist package:

composer require klaviyo/api

Usage Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

use KlaviyoAPI\KlaviyoAPI;

$klaviyo = new KlaviyoAPI(
    'YOUR_API_KEY',
    $num_retries = 3,
    $guzzle_options = [],
    $user_agent_suffix = "/YOUR_APP_NAME");

$response = $klaviyo->Metrics->getMetrics();

Use Case Examples

How to use filtering, sorting, and spare fieldset JSON API features

Use Case: Get events associated with a specific metric, then return just the event properties sorted by oldest to newest datetime.

$klaviyo->Events->getEvents(
    $fields_event=['event_properties'], 
    $fields_metric=NULL, 
    $fields_profile=NULL, 
    $filter="equals(metric_id,\"UMTLbD\")", 
    $include=NULL, 
    $page_cursor=NULL, 
    $sort='-datetime'
);

NOTE: the filter param values need to be url-encoded

How to filter based on datetime

Use Case: Get profiles that have been updated between two datetimes.

$klaviyo->Profiles->getProfiles(
    $additional_fields_profile=NULL, 
    $fields_profile=NULL, 
    $filter='less-than(updated,2023-04-26T00:00:00Z),greater-than(updated,2023-04-19T00:00:00Z)', 
);

How to use pagination and the page[size] param

Use Case: Use cursor-based pagination to get the next 20 profile records.

$klaviyo->Profiles->getProfiles(
    $additional_fields_profile=NULL, 
    $fields_profile=NULL, 
    $filter=NULL,
    $page_cursor="https://a.klaviyo.com/api/profiles/?page%5Bcursor%5D=bmV4dDo6aWQ6OjAxRjNaWk5ITlRYMUtFVEhQMzJTUzRBN0ZY", 
    $page_size=20, 
);

NOTE: This page cursor value is exactly what is returned in the self/next/prev response values

How to add additional information to your API response via additional-fields and the includes parameter

Use Case: Get a specific profile, return an additional predictive analytics field, and also return the list objects associated with the profile.

$klaviyo->Profiles->getProfile(
    '01F3ZZNHPY4YZFVGNBH5THCNXE', 
    $additional_fields_profile=['predictive_analytics'], 
    $fields_list=NULL, 
    $fields_profile=NULL, 
    $fields_segment=NULL, 
    $include=['lists']
);

How to use our relationship endpoints to see related resources

Use Case: Get all list memberships for a profile with the given profile_id.

$klaviyo->Profiles->getProfileRelationshipsLists('01GDDKASAP8TKDDA2GRZDSVP4H');

How to see what Klaviyo objects are associated with a specific tag

Use Case: Get all campaigns associated with the given tag_id.

$klaviyo->Tags->getTagRelationshipsCampaigns('f4bc6670-1aa5-47df-827a-d30a7e543088');

Uploading Image From File

When using $klaviyo->Images->uploadImageFromFile($file, $name), $file can be either a file path string OR a SplFileObject.

as a file path

$filepath = '/path/to/image.png';
$klaviyo->Images->uploadImageFromFile($filepath);

as a SplFileObject

$filepath = '/path/to/image.png';
$file = new SplFileObject($filepath);
$klaviyo->Images->uploadImageFromFile($file);

Retry behavior

  • The SDK retries on resolvable errors, namely: rate limits (common) and server errors on Klaviyo's end (rare).
  • The keyword arguments in the example above define retry behavior
    • The time interval between retries is calculated using exponential backoff and the Retry-After header
    • If you wish to disable retries, set $num_retries = 0
    • the example is populated with the default values
  • non-resolvable errors and resolvable errors which have timed out throw an ApiException, detailed below.

Error Handling

This SDK throws an ApiException error when the server returns a non resolvable response, or a resolvable non-2XX response times out.

If you'd like to extend error handling beyond what the SDK supports natively, you can use the following methods to retrieve the corresponding attributes from the ApiException object:

  • getCode() : int
  • getMessage() : str
  • getResponseBody() : bytes
  • getResponseHeaders() : string[]

For example:

try { 
  $klaviyo.Metrics.getMetrics();
} catch (Exception $e) {
  if ($e->getCode() == SOME_INTEGER) {
    doSomething();
  }
}

Important Notes

  • The main difference between this SDK and the language-agnostic API Docs that the below endpoints link to is that this SDK automatically adds the revision header corresponding to the SDK version.
  • Organization: Resource groups and functions are listed in alphabetical order, first by Resource name, then by OpenAPI Summary. Operation summaries are those listed in the right side bar of the API Reference. These summaries link directly to the corresponding section of the API reference.
  • For example values / data types, as well as whether parameters are required/optional, please reference the corresponding API Reference link.
  • Some keyword args are required for the API call to succeed, the API docs above are the source of truth regarding which keyword args are required.
  • JSON payloads should be passed in as associative arrays
  • A strange quirk of PHP is that default/optional arguments must be passed in in order, and MUST be included and set as null, at least up to the last default value you wish to use.
    • For example, if a given function has the following optional parameters someFunction($a=1, $b=2, $c=3), and you wish to only set $b, you MUST pass in someFunction($a=null, $b=$YOUR_VALUE)
    • Otherwise, if you pass in something such as someFunction($b=$YOUR_VALUE), PHP will actually assign the $YOUR_VALUE to parameter $a, which is wrong.
  • $api_key is optional, as it is set at client-level. However, you can override the client key wherever by passing in $api_key as the LAST optional param. Reminder: DO NOT use private API keys client-side / onsite.
  • Paging: Where applicable, $page_cursor can be passed in either as a parsed string, or as the entire self.link response returned by paged API endpoints.

Comprehensive list of Operations & Parameters

Accounts

Get Account

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_account | string[]

$klaviyo->Accounts->getAccount($id, $fields_account=$fields_account);

Get Accounts

## Keyword Arguments

# $fields_account | string[]

$klaviyo->Accounts->getAccounts($fields_account=$fields_account);

Campaigns

Assign Template to Campaign Message

## Positional Arguments

# $body | associative array

$klaviyo->Campaigns->assignTemplateToCampaignMessage($body);
Method alias:
$klaviyo->Campaigns->createCampaignMessageAssignTemplate($body);

Cancel Campaign Send

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Campaigns->cancelCampaignSend($id, $body);
Method alias:
$klaviyo->Campaigns->updateCampaignSendJob($id, $body);

Create Campaign

## Positional Arguments

# $body | associative array

$klaviyo->Campaigns->createCampaign($body);

Create Campaign Clone

## Positional Arguments

# $body | associative array

$klaviyo->Campaigns->createCampaignClone($body);
Method alias:
$klaviyo->Campaigns->cloneCampaign($body);

Delete Campaign

## Positional Arguments

# $id | string

$klaviyo->Campaigns->deleteCampaign($id);

Get Campaign

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign_message | string[]
# $fields_campaign | string[]
# $fields_tag | string[]
# $include | string[]

$klaviyo->Campaigns->getCampaign($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_tag=$fields_tag, $include=$include);

Get Campaign for Campaign Message

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign | string[]

$klaviyo->Campaigns->getCampaignForCampaignMessage($id, $fields_campaign=$fields_campaign);
Method alias:
$klaviyo->Campaigns->getCampaignMessageCampaign($id, $fields_campaign=$fields_campaign);

Get Campaign ID for Campaign Message

## Positional Arguments

# $id | string

$klaviyo->Campaigns->getCampaignIdForCampaignMessage($id);
Method alias:
$klaviyo->Campaigns->getCampaignMessageRelationshipsCampaign($id);

Get Campaign Message

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign_message | string[]
# $fields_campaign | string[]
# $fields_template | string[]
# $include | string[]

$klaviyo->Campaigns->getCampaignMessage($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include);

Get Campaign Recipient Estimation

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign_recipient_estimation | string[]

$klaviyo->Campaigns->getCampaignRecipientEstimation($id, $fields_campaign_recipient_estimation=$fields_campaign_recipient_estimation);

Get Campaign Recipient Estimation Job

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign_recipient_estimation_job | string[]

$klaviyo->Campaigns->getCampaignRecipientEstimationJob($id, $fields_campaign_recipient_estimation_job=$fields_campaign_recipient_estimation_job);

Get Campaign Send Job

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign_send_job | string[]

$klaviyo->Campaigns->getCampaignSendJob($id, $fields_campaign_send_job=$fields_campaign_send_job);

Get Campaign Tags

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag | string[]

$klaviyo->Campaigns->getCampaignTags($id, $fields_tag=$fields_tag);

Get Campaigns

## Positional Arguments

# $filter | string

## Keyword Arguments

# $fields_campaign_message | string[]
# $fields_campaign | string[]
# $fields_tag | string[]
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Campaigns->getCampaigns($filter, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_tag=$fields_tag, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Message IDs for Campaign

## Positional Arguments

# $id | string

$klaviyo->Campaigns->getMessageIdsForCampaign($id);
Method alias:
$klaviyo->Campaigns->getCampaignRelationshipsCampaignMessages($id);

Get Messages for Campaign

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_campaign_message | string[]
# $fields_campaign | string[]
# $fields_template | string[]
# $include | string[]

$klaviyo->Campaigns->getMessagesForCampaign($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include);
Method alias:
$klaviyo->Campaigns->getCampaignCampaignMessages($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include);

Get Tag IDs for Campaign

## Positional Arguments

# $id | string

$klaviyo->Campaigns->getTagIdsForCampaign($id);
Method alias:
$klaviyo->Campaigns->getCampaignRelationshipsTags($id);

Get Template for Campaign Message

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_template | string[]

$klaviyo->Campaigns->getTemplateForCampaignMessage($id, $fields_template=$fields_template);
Method alias:
$klaviyo->Campaigns->getCampaignMessageTemplate($id, $fields_template=$fields_template);

Get Template ID for Campaign Message

## Positional Arguments

# $id | string

$klaviyo->Campaigns->getTemplateIdForCampaignMessage($id);
Method alias:
$klaviyo->Campaigns->getCampaignMessageRelationshipsTemplate($id);

Refresh Campaign Recipient Estimation

## Positional Arguments

# $body | associative array

$klaviyo->Campaigns->refreshCampaignRecipientEstimation($body);
Method alias:
$klaviyo->Campaigns->createCampaignRecipientEstimationJob($body);

Send Campaign

## Positional Arguments

# $body | associative array

$klaviyo->Campaigns->sendCampaign($body);
Method alias:
$klaviyo->Campaigns->createCampaignSendJob($body);

Update Campaign

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Campaigns->updateCampaign($id, $body);

Update Campaign Message

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Campaigns->updateCampaignMessage($id, $body);

Catalogs

Add Category to Catalog Item

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->addCategoryToCatalogItem($id, $body);
Method alias:
$klaviyo->Catalogs->createCatalogItemRelationshipsCategories($id, $body);
Method alias:
$klaviyo->Catalogs->createCatalogItemRelationshipsCategory($id, $body);

Add Items to Catalog Category

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->addItemsToCatalogCategory($id, $body);
Method alias:
$klaviyo->Catalogs->createCatalogCategoryRelationshipsItems($id, $body);
Method alias:
$klaviyo->Catalogs->createCatalogCategoryRelationshipsItem($id, $body);

Bulk Create Catalog Categories

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkCreateCatalogCategories($body);
Method alias:
$klaviyo->Catalogs->spawnCreateCategoriesJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogCategoryBulkCreateJob($body);

Bulk Create Catalog Items

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkCreateCatalogItems($body);
Method alias:
$klaviyo->Catalogs->spawnCreateItemsJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogItemBulkCreateJob($body);

Bulk Create Catalog Variants

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkCreateCatalogVariants($body);
Method alias:
$klaviyo->Catalogs->spawnCreateVariantsJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogVariantBulkCreateJob($body);

Bulk Delete Catalog Categories

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkDeleteCatalogCategories($body);
Method alias:
$klaviyo->Catalogs->spawnDeleteCategoriesJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogCategoryBulkDeleteJob($body);

Bulk Delete Catalog Items

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkDeleteCatalogItems($body);
Method alias:
$klaviyo->Catalogs->spawnDeleteItemsJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogItemBulkDeleteJob($body);

Bulk Delete Catalog Variants

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkDeleteCatalogVariants($body);
Method alias:
$klaviyo->Catalogs->spawnDeleteVariantsJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogVariantBulkDeleteJob($body);

Bulk Update Catalog Categories

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkUpdateCatalogCategories($body);
Method alias:
$klaviyo->Catalogs->spawnUpdateCategoriesJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogCategoryBulkUpdateJob($body);

Bulk Update Catalog Items

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkUpdateCatalogItems($body);
Method alias:
$klaviyo->Catalogs->spawnUpdateItemsJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogItemBulkUpdateJob($body);

Bulk Update Catalog Variants

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->bulkUpdateCatalogVariants($body);
Method alias:
$klaviyo->Catalogs->spawnUpdateVariantsJob($body);
Method alias:
$klaviyo->Catalogs->createCatalogVariantBulkUpdateJob($body);

Create Back In Stock Subscription

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->createBackInStockSubscription($body);

Create Catalog Category

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->createCatalogCategory($body);

Create Catalog Item

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->createCatalogItem($body);

Create Catalog Variant

## Positional Arguments

# $body | associative array

$klaviyo->Catalogs->createCatalogVariant($body);

Delete Catalog Category

## Positional Arguments

# $id | string

$klaviyo->Catalogs->deleteCatalogCategory($id);

Delete Catalog Item

## Positional Arguments

# $id | string

$klaviyo->Catalogs->deleteCatalogItem($id);

Delete Catalog Variant

## Positional Arguments

# $id | string

$klaviyo->Catalogs->deleteCatalogVariant($id);

Get Bulk Create Catalog Items Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_item_bulk_create_job | string[]
# $fields_catalog_item | string[]
# $include | string[]

$klaviyo->Catalogs->getBulkCreateCatalogItemsJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include);
Method alias:
$klaviyo->Catalogs->getCreateItemsJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include);
Method alias:
$klaviyo->Catalogs->getCatalogItemBulkCreateJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include);

Get Bulk Create Catalog Items Jobs

## Keyword Arguments

# $fields_catalog_item_bulk_create_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getBulkCreateCatalogItemsJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCreateItemsJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogItemBulkCreateJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);

Get Bulk Delete Catalog Items Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_item_bulk_delete_job | string[]

$klaviyo->Catalogs->getBulkDeleteCatalogItemsJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job);
Method alias:
$klaviyo->Catalogs->getDeleteItemsJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job);
Method alias:
$klaviyo->Catalogs->getCatalogItemBulkDeleteJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job);

Get Bulk Delete Catalog Items Jobs

## Keyword Arguments

# $fields_catalog_item_bulk_delete_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getBulkDeleteCatalogItemsJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getDeleteItemsJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogItemBulkDeleteJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);

Get Bulk Update Catalog Items Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_item_bulk_update_job | string[]
# $fields_catalog_item | string[]
# $include | string[]

$klaviyo->Catalogs->getBulkUpdateCatalogItemsJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include);
Method alias:
$klaviyo->Catalogs->getUpdateItemsJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include);
Method alias:
$klaviyo->Catalogs->getCatalogItemBulkUpdateJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include);

Get Bulk Update Catalog Items Jobs

## Keyword Arguments

# $fields_catalog_item_bulk_update_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getBulkUpdateCatalogItemsJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getUpdateItemsJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogItemBulkUpdateJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);

Get Catalog Categories

## Keyword Arguments

# $fields_catalog_category | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Catalogs->getCatalogCategories($fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Catalog Category

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_catalog_category | string[]

$klaviyo->Catalogs->getCatalogCategory($id, $fields_catalog_category=$fields_catalog_category);

Get Catalog Item

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_catalog_item | string[]
# $fields_catalog_variant | string[]
# $include | string[]

$klaviyo->Catalogs->getCatalogItem($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $include=$include);

Get Catalog Items

## Keyword Arguments

# $fields_catalog_item | string[]
# $fields_catalog_variant | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Catalogs->getCatalogItems($fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Catalog Variant

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_catalog_variant | string[]

$klaviyo->Catalogs->getCatalogVariant($id, $fields_catalog_variant=$fields_catalog_variant);

Get Catalog Variants

## Keyword Arguments

# $fields_catalog_variant | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Catalogs->getCatalogVariants($fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Categories for Catalog Item

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_catalog_category | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Catalogs->getCategoriesForCatalogItem($id, $fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);
Method alias:
$klaviyo->Catalogs->getCatalogItemCategories($id, $fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Category IDs for Catalog Item

## Positional Arguments

# $id | string

## Keyword Arguments

# $page_cursor | string

$klaviyo->Catalogs->getCategoryIdsForCatalogItem($id, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogItemRelationshipsCategories($id, $page_cursor=$page_cursor);

Get Create Categories Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_category_bulk_create_job | string[]
# $fields_catalog_category | string[]
# $include | string[]

$klaviyo->Catalogs->getCreateCategoriesJob($job_id, $fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $fields_catalog_category=$fields_catalog_category, $include=$include);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryBulkCreateJob($job_id, $fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $fields_catalog_category=$fields_catalog_category, $include=$include);

Get Create Categories Jobs

## Keyword Arguments

# $fields_catalog_category_bulk_create_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getCreateCategoriesJobs($fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryBulkCreateJobs($fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);

Get Create Variants Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_variant_bulk_create_job | string[]
# $fields_catalog_variant | string[]
# $include | string[]

$klaviyo->Catalogs->getCreateVariantsJob($job_id, $fields_catalog_variant_bulk_create_job=$fields_catalog_variant_bulk_create_job, $fields_catalog_variant=$fields_catalog_variant, $include=$include);
Method alias:
$klaviyo->Catalogs->getCatalogVariantBulkCreateJob($job_id, $fields_catalog_variant_bulk_create_job=$fields_catalog_variant_bulk_create_job, $fields_catalog_variant=$fields_catalog_variant, $include=$include);

Get Create Variants Jobs

## Keyword Arguments

# $fields_catalog_variant_bulk_create_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getCreateVariantsJobs($fields_catalog_variant_bulk_create_job=$fields_catalog_variant_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogVariantBulkCreateJobs($fields_catalog_variant_bulk_create_job=$fields_catalog_variant_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);

Get Delete Categories Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_category_bulk_delete_job | string[]

$klaviyo->Catalogs->getDeleteCategoriesJob($job_id, $fields_catalog_category_bulk_delete_job=$fields_catalog_category_bulk_delete_job);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryBulkDeleteJob($job_id, $fields_catalog_category_bulk_delete_job=$fields_catalog_category_bulk_delete_job);

Get Delete Categories Jobs

## Keyword Arguments

# $fields_catalog_category_bulk_delete_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getDeleteCategoriesJobs($fields_catalog_category_bulk_delete_job=$fields_catalog_category_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryBulkDeleteJobs($fields_catalog_category_bulk_delete_job=$fields_catalog_category_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);

Get Delete Variants Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_variant_bulk_delete_job | string[]

$klaviyo->Catalogs->getDeleteVariantsJob($job_id, $fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job);
Method alias:
$klaviyo->Catalogs->getCatalogVariantBulkDeleteJob($job_id, $fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job);

Get Delete Variants Jobs

## Keyword Arguments

# $fields_catalog_variant_bulk_delete_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getDeleteVariantsJobs($fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogVariantBulkDeleteJobs($fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor);

Get Item IDs for Catalog Category

## Positional Arguments

# $id | string

## Keyword Arguments

# $page_cursor | string

$klaviyo->Catalogs->getItemIdsForCatalogCategory($id, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryRelationshipsItems($id, $page_cursor=$page_cursor);

Get Items for Catalog Category

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_catalog_item | string[]
# $fields_catalog_variant | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Catalogs->getItemsForCatalogCategory($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryItems($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Update Categories Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_category_bulk_update_job | string[]
# $fields_catalog_category | string[]
# $include | string[]

$klaviyo->Catalogs->getUpdateCategoriesJob($job_id, $fields_catalog_category_bulk_update_job=$fields_catalog_category_bulk_update_job, $fields_catalog_category=$fields_catalog_category, $include=$include);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryBulkUpdateJob($job_id, $fields_catalog_category_bulk_update_job=$fields_catalog_category_bulk_update_job, $fields_catalog_category=$fields_catalog_category, $include=$include);

Get Update Categories Jobs

## Keyword Arguments

# $fields_catalog_category_bulk_update_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getUpdateCategoriesJobs($fields_catalog_category_bulk_update_job=$fields_catalog_category_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogCategoryBulkUpdateJobs($fields_catalog_category_bulk_update_job=$fields_catalog_category_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);

Get Update Variants Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_catalog_variant_bulk_update_job | string[]
# $fields_catalog_variant | string[]
# $include | string[]

$klaviyo->Catalogs->getUpdateVariantsJob($job_id, $fields_catalog_variant_bulk_update_job=$fields_catalog_variant_bulk_update_job, $fields_catalog_variant=$fields_catalog_variant, $include=$include);
Method alias:
$klaviyo->Catalogs->getCatalogVariantBulkUpdateJob($job_id, $fields_catalog_variant_bulk_update_job=$fields_catalog_variant_bulk_update_job, $fields_catalog_variant=$fields_catalog_variant, $include=$include);

Get Update Variants Jobs

## Keyword Arguments

# $fields_catalog_variant_bulk_update_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Catalogs->getUpdateVariantsJobs($fields_catalog_variant_bulk_update_job=$fields_catalog_variant_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Catalogs->getCatalogVariantBulkUpdateJobs($fields_catalog_variant_bulk_update_job=$fields_catalog_variant_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor);

Get Variants for Catalog Item

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_catalog_variant | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Catalogs->getVariantsForCatalogItem($id, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);
Method alias:
$klaviyo->Catalogs->getCatalogItemVariants($id, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Remove Categories from Catalog Item

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->removeCategoriesFromCatalogItem($id, $body);
Method alias:
$klaviyo->Catalogs->deleteCatalogItemRelationshipsCategories($id, $body);

Remove Items from Catalog Category

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->removeItemsFromCatalogCategory($id, $body);
Method alias:
$klaviyo->Catalogs->deleteCatalogCategoryRelationshipsItems($id, $body);

Update Catalog Category

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->updateCatalogCategory($id, $body);

Update Catalog Item

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->updateCatalogItem($id, $body);

Update Catalog Variant

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->updateCatalogVariant($id, $body);

Update Categories for Catalog Item

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->updateCategoriesForCatalogItem($id, $body);
Method alias:
$klaviyo->Catalogs->updateCatalogItemRelationshipsCategories($id, $body);

Update Items for Catalog Category

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Catalogs->updateItemsForCatalogCategory($id, $body);
Method alias:
$klaviyo->Catalogs->updateCatalogCategoryRelationshipsItems($id, $body);

Coupons

Bulk Create Coupon Codes

## Positional Arguments

# $body | associative array

$klaviyo->Coupons->bulkCreateCouponCodes($body);
Method alias:
$klaviyo->Coupons->spawnCouponCodeBulkCreateJob($body);
Method alias:
$klaviyo->Coupons->createCouponCodeBulkCreateJob($body);

Create Coupon

## Positional Arguments

# $body | associative array

$klaviyo->Coupons->createCoupon($body);

Create Coupon Code

## Positional Arguments

# $body | associative array

$klaviyo->Coupons->createCouponCode($body);

Delete Coupon

## Positional Arguments

# $id | string

$klaviyo->Coupons->deleteCoupon($id);

Delete Coupon Code

## Positional Arguments

# $id | string

$klaviyo->Coupons->deleteCouponCode($id);

Get Bulk Create Coupon Code Jobs

## Keyword Arguments

# $fields_coupon_code_bulk_create_job | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Coupons->getBulkCreateCouponCodeJobs($fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Coupons->getCouponCodeBulkCreateJobs($fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor);

Get Bulk Create Coupon Codes Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_coupon_code_bulk_create_job | string[]
# $fields_coupon_code | string[]
# $include | string[]

$klaviyo->Coupons->getBulkCreateCouponCodesJob($job_id, $fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $fields_coupon_code=$fields_coupon_code, $include=$include);
Method alias:
$klaviyo->Coupons->getCouponCodeBulkCreateJob($job_id, $fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $fields_coupon_code=$fields_coupon_code, $include=$include);

Get Code IDs for Coupon

## Positional Arguments

# $id | string

## Keyword Arguments

# $page_cursor | string

$klaviyo->Coupons->getCodeIdsForCoupon($id, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Coupons->getCouponCodeRelationshipsCoupon($id, $page_cursor=$page_cursor);

Get Coupon

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_coupon | string[]

$klaviyo->Coupons->getCoupon($id, $fields_coupon=$fields_coupon);

Get Coupon Code

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_coupon_code | string[]
# $fields_coupon | string[]
# $include | string[]

$klaviyo->Coupons->getCouponCode($id, $fields_coupon_code=$fields_coupon_code, $fields_coupon=$fields_coupon, $include=$include);

Get Coupon Codes

## Keyword Arguments

# $fields_coupon_code | string[]
# $fields_coupon | string[]
# $filter | string
# $include | string[]
# $page_cursor | string

$klaviyo->Coupons->getCouponCodes($fields_coupon_code=$fields_coupon_code, $fields_coupon=$fields_coupon, $filter=$filter, $include=$include, $page_cursor=$page_cursor);

Get Coupon Codes For Coupon

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_coupon_code | string[]
# $filter | string
# $page_cursor | string

$klaviyo->Coupons->getCouponCodesForCoupon($id, $fields_coupon_code=$fields_coupon_code, $filter=$filter, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Coupons->getCouponCouponCodes($id, $fields_coupon_code=$fields_coupon_code, $filter=$filter, $page_cursor=$page_cursor);

Get Coupon For Coupon Code

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_coupon | string[]

$klaviyo->Coupons->getCouponForCouponCode($id, $fields_coupon=$fields_coupon);
Method alias:
$klaviyo->Coupons->getCouponCodeCoupon($id, $fields_coupon=$fields_coupon);

Get Coupon ID for Coupon Code

## Positional Arguments

# $id | string

$klaviyo->Coupons->getCouponIdForCouponCode($id);
Method alias:
$klaviyo->Coupons->getCouponRelationshipsCouponCodes($id);

Get Coupons

## Keyword Arguments

# $fields_coupon | string[]
# $page_cursor | string

$klaviyo->Coupons->getCoupons($fields_coupon=$fields_coupon, $page_cursor=$page_cursor);

Update Coupon

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Coupons->updateCoupon($id, $body);

Update Coupon Code

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Coupons->updateCouponCode($id, $body);

DataPrivacy

Request Profile Deletion

## Positional Arguments

# $body | associative array

$klaviyo->DataPrivacy->requestProfileDeletion($body);
Method alias:
$klaviyo->DataPrivacy->createDataPrivacyDeletionJob($body);

Events

Bulk Create Events

## Positional Arguments

# $body | associative array

$klaviyo->Events->bulkCreateEvents($body);
Method alias:
$klaviyo->Events->createEventBulkCreateJob($body);

Create Event

## Positional Arguments

# $body | associative array

$klaviyo->Events->createEvent($body);

Get Event

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_event | string[]
# $fields_metric | string[]
# $fields_profile | string[]
# $include | string[]

$klaviyo->Events->getEvent($id, $fields_event=$fields_event, $fields_metric=$fields_metric, $fields_profile=$fields_profile, $include=$include);

Get Event Metric

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_metric | string[]

$klaviyo->Events->getEventMetric($id, $fields_metric=$fields_metric);

Get Event Profile

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_profile | string[]
# $fields_profile | string[]

$klaviyo->Events->getEventProfile($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile);

Get Events

## Keyword Arguments

# $fields_event | string[]
# $fields_metric | string[]
# $fields_profile | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Events->getEvents($fields_event=$fields_event, $fields_metric=$fields_metric, $fields_profile=$fields_profile, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Metric ID for Event

## Positional Arguments

# $id | string

$klaviyo->Events->getMetricIdForEvent($id);
Method alias:
$klaviyo->Events->getEventRelationshipsMetric($id);

Get Profile ID for Event

## Positional Arguments

# $id | string

$klaviyo->Events->getProfileIdForEvent($id);
Method alias:
$klaviyo->Events->getEventRelationshipsProfile($id);

Flows

Delete Flow

## Positional Arguments

# $id | string

$klaviyo->Flows->deleteFlow($id);

Get Action ID for Flow Message

## Positional Arguments

# $id | string

$klaviyo->Flows->getActionIdForFlowMessage($id);
Method alias:
$klaviyo->Flows->getFlowMessageRelationshipsAction($id);

Get Action IDs for Flow

## Positional Arguments

# $id | string

## Keyword Arguments

# $filter | string
# $page_size | int
# $sort | string

$klaviyo->Flows->getActionIdsForFlow($id, $filter=$filter, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Flows->getFlowRelationshipsFlowActions($id, $filter=$filter, $page_size=$page_size, $sort=$sort);

Get Actions for Flow

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow_action | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Flows->getActionsForFlow($id, $fields_flow_action=$fields_flow_action, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Flows->getFlowFlowActions($id, $fields_flow_action=$fields_flow_action, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Flow

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow_action | string[]
# $fields_flow | string[]
# $fields_tag | string[]
# $include | string[]

$klaviyo->Flows->getFlow($id, $fields_flow_action=$fields_flow_action, $fields_flow=$fields_flow, $fields_tag=$fields_tag, $include=$include);

Get Flow Action

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow_action | string[]
# $fields_flow_message | string[]
# $fields_flow | string[]
# $include | string[]

$klaviyo->Flows->getFlowAction($id, $fields_flow_action=$fields_flow_action, $fields_flow_message=$fields_flow_message, $fields_flow=$fields_flow, $include=$include);

Get Flow For Flow Action

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow | string[]

$klaviyo->Flows->getFlowActionFlow($id, $fields_flow=$fields_flow);

Get Flow ID for Flow Action

## Positional Arguments

# $id | string

$klaviyo->Flows->getFlowIdForFlowAction($id);
Method alias:
$klaviyo->Flows->getFlowActionRelationshipsFlow($id);

Get Flow Message

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow_action | string[]
# $fields_flow_message | string[]
# $fields_template | string[]
# $include | string[]

$klaviyo->Flows->getFlowMessage($id, $fields_flow_action=$fields_flow_action, $fields_flow_message=$fields_flow_message, $fields_template=$fields_template, $include=$include);

Get Flow Action For Message

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow_action | string[]

$klaviyo->Flows->getFlowMessageAction($id, $fields_flow_action=$fields_flow_action);

Get Flow Tags

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag | string[]

$klaviyo->Flows->getFlowTags($id, $fields_tag=$fields_tag);

Get Flows

## Keyword Arguments

# $fields_flow_action | string[]
# $fields_flow | string[]
# $fields_tag | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Flows->getFlows($fields_flow_action=$fields_flow_action, $fields_flow=$fields_flow, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Message IDs for Flow Action

## Positional Arguments

# $id | string

## Keyword Arguments

# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Flows->getMessageIdsForFlowAction($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Flows->getFlowActionRelationshipsMessages($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Messages for Flow Action

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow_message | string[]
# $filter | string
# $page_size | int
# $sort | string

$klaviyo->Flows->getMessagesForFlowAction($id, $fields_flow_message=$fields_flow_message, $filter=$filter, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Flows->getFlowActionMessages($id, $fields_flow_message=$fields_flow_message, $filter=$filter, $page_size=$page_size, $sort=$sort);

Get Tag IDs for Flow

## Positional Arguments

# $id | string

$klaviyo->Flows->getTagIdsForFlow($id);
Method alias:
$klaviyo->Flows->getFlowRelationshipsTags($id);

Get Template for Flow Message

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_template | string[]

$klaviyo->Flows->getTemplateForFlowMessage($id, $fields_template=$fields_template);
Method alias:
$klaviyo->Flows->getFlowMessageTemplate($id, $fields_template=$fields_template);

Get Template ID for Flow Message

## Positional Arguments

# $id | string

$klaviyo->Flows->getTemplateIdForFlowMessage($id);
Method alias:
$klaviyo->Flows->getFlowMessageRelationshipsTemplate($id);

Update Flow Status

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Flows->updateFlow($id, $body);

Forms

Get Form

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_form_version | string[]
# $fields_form | string[]
# $include | string[]

$klaviyo->Forms->getForm($id, $fields_form_version=$fields_form_version, $fields_form=$fields_form, $include=$include);

Get Form for Form Version

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_form | string[]

$klaviyo->Forms->getFormForFormVersion($id, $fields_form=$fields_form);
Method alias:
$klaviyo->Forms->getFormVersionForm($id, $fields_form=$fields_form);

Get Form ID for Form Version

## Positional Arguments

# $id | string

$klaviyo->Forms->getFormIdForFormVersion($id);
Method alias:
$klaviyo->Forms->getFormVersionRelationshipsForm($id);

Get Form Version

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_form_version | string[]

$klaviyo->Forms->getFormVersion($id, $fields_form_version=$fields_form_version);

Get Forms

## Keyword Arguments

# $fields_form | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Forms->getForms($fields_form=$fields_form, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Version IDs for Form

## Positional Arguments

# $id | string

$klaviyo->Forms->getVersionIdsForForm($id);
Method alias:
$klaviyo->Forms->getFormRelationshipsFormVersions($id);

Get Versions for Form

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_form_version | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Forms->getVersionsForForm($id, $fields_form_version=$fields_form_version, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Forms->getFormFormVersions($id, $fields_form_version=$fields_form_version, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Images

Get Image

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_image | string[]

$klaviyo->Images->getImage($id, $fields_image=$fields_image);

Get Images

## Keyword Arguments

# $fields_image | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Images->getImages($fields_image=$fields_image, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Update Image

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Images->updateImage($id, $body);

Upload Image From File

## Positional Arguments

# $file | \SplFileObject

## Keyword Arguments

# $name | string
# $hidden | bool

$klaviyo->Images->uploadImageFromFile($file, $name=$name, $hidden=$hidden);
Method alias:
$klaviyo->Images->createImageUpload($file, $name=$name, $hidden=$hidden);

Upload Image From URL

## Positional Arguments

# $body | associative array

$klaviyo->Images->uploadImageFromUrl($body);
Method alias:
$klaviyo->Images->createImage($body);

Lists

Create List

## Positional Arguments

# $body | associative array

$klaviyo->Lists->createList($body);

Add Profile To List

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Lists->createListRelationships($id, $body);
Method alias:
$klaviyo->Lists->createListRelationshipsProfile($id, $body);

Delete List

## Positional Arguments

# $id | string

$klaviyo->Lists->deleteList($id);

Remove Profile From List

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Lists->deleteListRelationships($id, $body);
Method alias:
$klaviyo->Lists->deleteListRelationshipsProfiles($id, $body);

Get List

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_list | string[]
# $fields_flow | string[]
# $fields_list | string[]
# $fields_tag | string[]
# $include | string[]

$klaviyo->Lists->getList($id, $additional_fields_list=$additional_fields_list, $fields_flow=$fields_flow, $fields_list=$fields_list, $fields_tag=$fields_tag, $include=$include);

Get List Flow Triggers

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow | string[]

$klaviyo->Lists->getListFlowTriggers($id, $fields_flow=$fields_flow);

Get List Profiles

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_profile | string[]
# $fields_profile | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Lists->getListProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get List Relationships Flow Triggers

## Positional Arguments

# $id | string

$klaviyo->Lists->getListRelationshipsFlowTriggers($id);

Get List Tags

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag | string[]

$klaviyo->Lists->getListTags($id, $fields_tag=$fields_tag);

Get Lists

## Keyword Arguments

# $fields_flow | string[]
# $fields_list | string[]
# $fields_tag | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Lists->getLists($fields_flow=$fields_flow, $fields_list=$fields_list, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Profile IDs for List

## Positional Arguments

# $id | string

## Keyword Arguments

# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Lists->getProfileIdsForList($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Lists->getListRelationshipsProfiles($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Tag IDs for List

## Positional Arguments

# $id | string

$klaviyo->Lists->getTagIdsForList($id);
Method alias:
$klaviyo->Lists->getListRelationshipsTags($id);

Update List

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Lists->updateList($id, $body);

Metrics

Get Metric

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow | string[]
# $fields_metric | string[]
# $include | string[]

$klaviyo->Metrics->getMetric($id, $fields_flow=$fields_flow, $fields_metric=$fields_metric, $include=$include);

Get Metric Flow Triggers

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow | string[]

$klaviyo->Metrics->getMetricFlowTriggers($id, $fields_flow=$fields_flow);

Get Metric for Metric Property

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_metric | string[]

$klaviyo->Metrics->getMetricForMetricProperty($id, $fields_metric=$fields_metric);
Method alias:
$klaviyo->Metrics->getMetricPropertyMetric($id, $fields_metric=$fields_metric);

Get Metric ID for Metric Property

## Positional Arguments

# $id | string

$klaviyo->Metrics->getMetricIdForMetricProperty($id);
Method alias:
$klaviyo->Metrics->getMetricPropertyRelationshipsMetric($id);

Get Metric Property

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_metric_property | string[]
# $fields_metric_property | string[]
# $fields_metric | string[]
# $include | string[]

$klaviyo->Metrics->getMetricProperty($id, $additional_fields_metric_property=$additional_fields_metric_property, $fields_metric_property=$fields_metric_property, $fields_metric=$fields_metric, $include=$include);

Get Metric Relationships Flow Triggers

## Positional Arguments

# $id | string

$klaviyo->Metrics->getMetricRelationshipsFlowTriggers($id);

Get Metrics

## Keyword Arguments

# $fields_flow | string[]
# $fields_metric | string[]
# $filter | string
# $include | string[]
# $page_cursor | string

$klaviyo->Metrics->getMetrics($fields_flow=$fields_flow, $fields_metric=$fields_metric, $filter=$filter, $include=$include, $page_cursor=$page_cursor);

Get Properties for Metric

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_metric_property | string[]
# $fields_metric_property | string[]

$klaviyo->Metrics->getPropertiesForMetric($id, $additional_fields_metric_property=$additional_fields_metric_property, $fields_metric_property=$fields_metric_property);
Method alias:
$klaviyo->Metrics->getMetricMetricProperties($id, $additional_fields_metric_property=$additional_fields_metric_property, $fields_metric_property=$fields_metric_property);

Get Property IDs for Metric

## Positional Arguments

# $id | string

$klaviyo->Metrics->getPropertyIdsForMetric($id);
Method alias:
$klaviyo->Metrics->getMetricRelationshipsMetricProperties($id);

Query Metric Aggregates

## Positional Arguments

# $body | associative array

$klaviyo->Metrics->queryMetricAggregates($body);
Method alias:
$klaviyo->Metrics->createMetricAggregate($body);

Profiles

Bulk Subscribe Profiles

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->bulkSubscribeProfiles($body);
Method alias:
$klaviyo->Profiles->subscribeProfiles($body);
Method alias:
$klaviyo->Profiles->createProfileSubscriptionBulkCreateJob($body);

Bulk Suppress Profiles

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->bulkSuppressProfiles($body);
Method alias:
$klaviyo->Profiles->suppressProfiles($body);
Method alias:
$klaviyo->Profiles->createProfileSuppressionBulkCreateJob($body);

Bulk Unsubscribe Profiles

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->bulkUnsubscribeProfiles($body);
Method alias:
$klaviyo->Profiles->unsubscribeProfiles($body);
Method alias:
$klaviyo->Profiles->createProfileSubscriptionBulkDeleteJob($body);

Bulk Unsuppress Profiles

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->bulkUnsuppressProfiles($body);
Method alias:
$klaviyo->Profiles->unsuppressProfiles($body);
Method alias:
$klaviyo->Profiles->createProfileSuppressionBulkDeleteJob($body);

Create or Update Profile

## Positional Arguments

# $body | associative array

## Keyword Arguments

# $additional_fields_profile | string[]

$klaviyo->Profiles->createOrUpdateProfile($body, $additional_fields_profile=$additional_fields_profile);
Method alias:
$klaviyo->Profiles->createProfileImport($body, $additional_fields_profile=$additional_fields_profile);

Create Profile

## Positional Arguments

# $body | associative array

## Keyword Arguments

# $additional_fields_profile | string[]

$klaviyo->Profiles->createProfile($body, $additional_fields_profile=$additional_fields_profile);

Create or Update Push Token

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->createPushToken($body);

Get Bulk Import Profiles Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_list | string[]
# $fields_profile_bulk_import_job | string[]
# $include | string[]

$klaviyo->Profiles->getBulkImportProfilesJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include);

Get Bulk Import Profiles Jobs

## Keyword Arguments

# $fields_profile_bulk_import_job | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Profiles->getBulkImportProfilesJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Bulk Suppress Profiles Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_profile_suppression_bulk_create_job | string[]

$klaviyo->Profiles->getBulkSuppressProfilesJob($job_id, $fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job);
Method alias:
$klaviyo->Profiles->getProfileSuppressionBulkCreateJob($job_id, $fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job);

Get Bulk Suppress Profiles Jobs

## Keyword Arguments

# $fields_profile_suppression_bulk_create_job | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Profiles->getBulkSuppressProfilesJobs($fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);
Method alias:
$klaviyo->Profiles->getProfileSuppressionBulkCreateJobs($fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Bulk Unsuppress Profiles Job

## Positional Arguments

# $job_id | string

## Keyword Arguments

# $fields_profile_suppression_bulk_delete_job | string[]

$klaviyo->Profiles->getBulkUnsuppressProfilesJob($job_id, $fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job);
Method alias:
$klaviyo->Profiles->getProfileSuppressionBulkDeleteJob($job_id, $fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job);

Get Bulk Unsuppress Profiles Jobs

## Keyword Arguments

# $fields_profile_suppression_bulk_delete_job | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Profiles->getBulkUnsuppressProfilesJobs($fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);
Method alias:
$klaviyo->Profiles->getProfileSuppressionBulkDeleteJobs($fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Errors for Bulk Import Profiles Job

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_import_error | string[]
# $page_cursor | string
# $page_size | int

$klaviyo->Profiles->getErrorsForBulkImportProfilesJob($id, $fields_import_error=$fields_import_error, $page_cursor=$page_cursor, $page_size=$page_size);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJobImportErrors($id, $fields_import_error=$fields_import_error, $page_cursor=$page_cursor, $page_size=$page_size);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJobImportErrors($id, $fields_import_error=$fields_import_error, $page_cursor=$page_cursor, $page_size=$page_size);

Get List for Bulk Import Profiles Job

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_list | string[]

$klaviyo->Profiles->getListForBulkImportProfilesJob($id, $fields_list=$fields_list);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJobLists($id, $fields_list=$fields_list);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJobLists($id, $fields_list=$fields_list);

Get List IDs for Bulk Import Profiles Job

## Positional Arguments

# $id | string

$klaviyo->Profiles->getListIdsForBulkImportProfilesJob($id);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJobRelationshipsLists($id);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJobRelationshipsLists($id);

Get List IDs for Profile

## Positional Arguments

# $id | string

$klaviyo->Profiles->getListIdsForProfile($id);
Method alias:
$klaviyo->Profiles->getProfileRelationshipsLists($id);

Get Lists for Profile

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_list | string[]

$klaviyo->Profiles->getListsForProfile($id, $fields_list=$fields_list);
Method alias:
$klaviyo->Profiles->getProfileLists($id, $fields_list=$fields_list);

Get Profile

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_profile | string[]
# $fields_list | string[]
# $fields_profile | string[]
# $fields_segment | string[]
# $include | string[]

$klaviyo->Profiles->getProfile($id, $additional_fields_profile=$additional_fields_profile, $fields_list=$fields_list, $fields_profile=$fields_profile, $fields_segment=$fields_segment, $include=$include);

Get Profile IDs for Bulk Import Profiles Job

## Positional Arguments

# $id | string

## Keyword Arguments

# $page_cursor | string
# $page_size | int

$klaviyo->Profiles->getProfileIdsForBulkImportProfilesJob($id, $page_cursor=$page_cursor, $page_size=$page_size);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJobRelationshipsProfiles($id, $page_cursor=$page_cursor, $page_size=$page_size);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJobRelationshipsProfiles($id, $page_cursor=$page_cursor, $page_size=$page_size);

Get Profiles

## Keyword Arguments

# $additional_fields_profile | string[]
# $fields_profile | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Profiles->getProfiles($additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Profiles for Bulk Import Profiles Job

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_profile | string[]
# $fields_profile | string[]
# $page_cursor | string
# $page_size | int

$klaviyo->Profiles->getProfilesForBulkImportProfilesJob($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $page_cursor=$page_cursor, $page_size=$page_size);
Method alias:
$klaviyo->Profiles->getBulkProfileImportJobProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $page_cursor=$page_cursor, $page_size=$page_size);
Method alias:
$klaviyo->Profiles->getProfileBulkImportJobProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $page_cursor=$page_cursor, $page_size=$page_size);

Get Segment IDs for Profile

## Positional Arguments

# $id | string

$klaviyo->Profiles->getSegmentIdsForProfile($id);
Method alias:
$klaviyo->Profiles->getProfileRelationshipsSegments($id);

Get Segments for Profile

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_segment | string[]

$klaviyo->Profiles->getSegmentsForProfile($id, $fields_segment=$fields_segment);
Method alias:
$klaviyo->Profiles->getProfileSegments($id, $fields_segment=$fields_segment);

Merge Profiles

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->mergeProfiles($body);
Method alias:
$klaviyo->Profiles->createProfileMerge($body);

Spawn Bulk Profile Import Job

## Positional Arguments

# $body | associative array

$klaviyo->Profiles->spawnBulkProfileImportJob($body);
Method alias:
$klaviyo->Profiles->bulkImportProfiles($body);
Method alias:
$klaviyo->Profiles->createProfileBulkImportJob($body);

Update Profile

## Positional Arguments

# $id | string
# $body | associative array

## Keyword Arguments

# $additional_fields_profile | string[]

$klaviyo->Profiles->updateProfile($id, $body, $additional_fields_profile=$additional_fields_profile);

Reporting

Query Campaign Values

## Positional Arguments

# $body | associative array

## Keyword Arguments

# $page_cursor | string

$klaviyo->Reporting->queryCampaignValues($body, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Reporting->createCampaignValueReport($body, $page_cursor=$page_cursor);

Query Flow Series

## Positional Arguments

# $body | associative array

## Keyword Arguments

# $page_cursor | string

$klaviyo->Reporting->queryFlowSeries($body, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Reporting->createFlowSeryReport($body, $page_cursor=$page_cursor);

Query Flow Values

## Positional Arguments

# $body | associative array

## Keyword Arguments

# $page_cursor | string

$klaviyo->Reporting->queryFlowValues($body, $page_cursor=$page_cursor);
Method alias:
$klaviyo->Reporting->createFlowValueReport($body, $page_cursor=$page_cursor);

Query Form Series

## Positional Arguments

# $body | associative array

$klaviyo->Reporting->queryFormSeries($body);
Method alias:
$klaviyo->Reporting->createFormSeryReport($body);

Query Form Values

## Positional Arguments

# $body | associative array

$klaviyo->Reporting->queryFormValues($body);
Method alias:
$klaviyo->Reporting->createFormValueReport($body);

Query Segment Series

## Positional Arguments

# $body | associative array

$klaviyo->Reporting->querySegmentSeries($body);
Method alias:
$klaviyo->Reporting->createSegmentSeryReport($body);

Query Segment Values

## Positional Arguments

# $body | associative array

$klaviyo->Reporting->querySegmentValues($body);
Method alias:
$klaviyo->Reporting->createSegmentValueReport($body);

Reviews

Get Review

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_event | string[]
# $fields_review | string[]
# $include | string[]

$klaviyo->Reviews->getReview($id, $fields_event=$fields_event, $fields_review=$fields_review, $include=$include);

Get Reviews

## Keyword Arguments

# $fields_event | string[]
# $fields_review | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Reviews->getReviews($fields_event=$fields_event, $fields_review=$fields_review, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Segments

Create Segment

## Positional Arguments

# $body | associative array

$klaviyo->Segments->createSegment($body);

Delete Segment

## Positional Arguments

# $id | string

$klaviyo->Segments->deleteSegment($id);

Get Profile IDs for Segment

## Positional Arguments

# $id | string

## Keyword Arguments

# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Segments->getProfileIdsForSegment($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Segments->getSegmentRelationshipsProfiles($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Profiles for Segment

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_profile | string[]
# $fields_profile | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Segments->getProfilesForSegment($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Segments->getSegmentProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Segment

## Positional Arguments

# $id | string

## Keyword Arguments

# $additional_fields_segment | string[]
# $fields_flow | string[]
# $fields_segment | string[]
# $fields_tag | string[]
# $include | string[]

$klaviyo->Segments->getSegment($id, $additional_fields_segment=$additional_fields_segment, $fields_flow=$fields_flow, $fields_segment=$fields_segment, $fields_tag=$fields_tag, $include=$include);

Get Segment Flow Triggers

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_flow | string[]

$klaviyo->Segments->getSegmentFlowTriggers($id, $fields_flow=$fields_flow);

Get Segment Relationships Flow Triggers

## Positional Arguments

# $id | string

$klaviyo->Segments->getSegmentRelationshipsFlowTriggers($id);

Get Segments

## Keyword Arguments

# $fields_flow | string[]
# $fields_segment | string[]
# $fields_tag | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Segments->getSegments($fields_flow=$fields_flow, $fields_segment=$fields_segment, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Tag IDs for Segment

## Positional Arguments

# $id | string

$klaviyo->Segments->getTagIdsForSegment($id);
Method alias:
$klaviyo->Segments->getSegmentRelationshipsTags($id);

Get Tags for Segment

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag | string[]

$klaviyo->Segments->getTagsForSegment($id, $fields_tag=$fields_tag);
Method alias:
$klaviyo->Segments->getSegmentTags($id, $fields_tag=$fields_tag);

Update Segment

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Segments->updateSegment($id, $body);

Tags

Create Tag

## Positional Arguments

# $body | associative array

$klaviyo->Tags->createTag($body);

Create Tag Group

## Positional Arguments

# $body | associative array

$klaviyo->Tags->createTagGroup($body);

Delete Tag

## Positional Arguments

# $id | string

$klaviyo->Tags->deleteTag($id);

Delete Tag Group

## Positional Arguments

# $id | string

$klaviyo->Tags->deleteTagGroup($id);

Get Campaign IDs for Tag

## Positional Arguments

# $id | string

$klaviyo->Tags->getCampaignIdsForTag($id);
Method alias:
$klaviyo->Tags->getTagRelationshipsCampaigns($id);

Get Flow IDs for Tag

## Positional Arguments

# $id | string

$klaviyo->Tags->getFlowIdsForTag($id);
Method alias:
$klaviyo->Tags->getTagRelationshipsFlows($id);

Get List IDs for Tag

## Positional Arguments

# $id | string

$klaviyo->Tags->getListIdsForTag($id);
Method alias:
$klaviyo->Tags->getTagRelationshipsLists($id);

Get Segment IDs for Tag

## Positional Arguments

# $id | string

$klaviyo->Tags->getSegmentIdsForTag($id);
Method alias:
$klaviyo->Tags->getTagRelationshipsSegments($id);

Get Tag

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag_group | string[]
# $fields_tag | string[]
# $include | string[]

$klaviyo->Tags->getTag($id, $fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $include=$include);

Get Tag Group

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag_group | string[]

$klaviyo->Tags->getTagGroup($id, $fields_tag_group=$fields_tag_group);

Get Tag Group for Tag

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag_group | string[]

$klaviyo->Tags->getTagGroupForTag($id, $fields_tag_group=$fields_tag_group);
Method alias:
$klaviyo->Tags->getTagTagGroup($id, $fields_tag_group=$fields_tag_group);

Get Tag Group ID for Tag

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagGroupIdForTag($id);
Method alias:
$klaviyo->Tags->getTagRelationshipsTagGroup($id);

Get Tag Groups

## Keyword Arguments

# $fields_tag_group | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Tags->getTagGroups($fields_tag_group=$fields_tag_group, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Tag IDs for Tag Group

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagIdsForTagGroup($id);
Method alias:
$klaviyo->Tags->getTagGroupRelationshipsTags($id);

Get Tags

## Keyword Arguments

# $fields_tag_group | string[]
# $fields_tag | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Tags->getTags($fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Get Tags for Tag Group

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag | string[]

$klaviyo->Tags->getTagsForTagGroup($id, $fields_tag=$fields_tag);
Method alias:
$klaviyo->Tags->getTagGroupTags($id, $fields_tag=$fields_tag);

Remove Tag from Campaigns

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->removeTagFromCampaigns($id, $body);
Method alias:
$klaviyo->Tags->deleteTagRelationshipsCampaigns($id, $body);

Remove Tag from Flows

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->removeTagFromFlows($id, $body);
Method alias:
$klaviyo->Tags->deleteTagRelationshipsFlows($id, $body);

Remove Tag from Lists

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->removeTagFromLists($id, $body);
Method alias:
$klaviyo->Tags->deleteTagRelationshipsLists($id, $body);

Remove Tag from Segments

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->removeTagFromSegments($id, $body);
Method alias:
$klaviyo->Tags->deleteTagRelationshipsSegments($id, $body);

Tag Campaigns

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->tagCampaigns($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsCampaigns($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsCampaign($id, $body);

Tag Flows

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->tagFlows($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsFlows($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsFlow($id, $body);

Tag Lists

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->tagLists($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsLists($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsList($id, $body);

Tag Segments

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->tagSegments($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsSegments($id, $body);
Method alias:
$klaviyo->Tags->createTagRelationshipsSegment($id, $body);

Update Tag

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->updateTag($id, $body);

Update Tag Group

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->updateTagGroup($id, $body);

Templates

Clone Template

## Positional Arguments

# $body | associative array

$klaviyo->Templates->cloneTemplate($body);
Method alias:
$klaviyo->Templates->createTemplateClone($body);

Create Template

## Positional Arguments

# $body | associative array

$klaviyo->Templates->createTemplate($body);

Create Universal Content

## Positional Arguments

# $body | associative array

$klaviyo->Templates->createUniversalContent($body);
Method alias:
$klaviyo->Templates->createTemplateUniversalContent($body);

Delete Template

## Positional Arguments

# $id | string

$klaviyo->Templates->deleteTemplate($id);

Delete Universal Content

## Positional Arguments

# $id | string

$klaviyo->Templates->deleteUniversalContent($id);
Method alias:
$klaviyo->Templates->deleteTemplateUniversalContent($id);

Get All Universal Content

## Keyword Arguments

# $fields_template_universal_content | string[]
# $filter | string
# $page_cursor | string
# $page_size | int
# $sort | string

$klaviyo->Templates->getAllUniversalContent($fields_template_universal_content=$fields_template_universal_content, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);
Method alias:
$klaviyo->Templates->getTemplateUniversalContent($fields_template_universal_content=$fields_template_universal_content, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort);

Get Template

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_template | string[]

$klaviyo->Templates->getTemplate($id, $fields_template=$fields_template);

Get Templates

## Keyword Arguments

# $fields_template | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Templates->getTemplates($fields_template=$fields_template, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Universal Content

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_template_universal_content | string[]

$klaviyo->Templates->getUniversalContent($id, $fields_template_universal_content=$fields_template_universal_content);

Render Template

## Positional Arguments

# $body | associative array

$klaviyo->Templates->renderTemplate($body);
Method alias:
$klaviyo->Templates->createTemplateRender($body);

Update Template

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Templates->updateTemplate($id, $body);

Update Universal Content

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Templates->updateUniversalContent($id, $body);
Method alias:
$klaviyo->Templates->updateTemplateUniversalContent($id, $body);

TrackingSettings

Get Tracking Setting

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tracking_setting | string[]

$klaviyo->TrackingSettings->getTrackingSetting($id, $fields_tracking_setting=$fields_tracking_setting);

Get Tracking Settings

## Keyword Arguments

# $fields_tracking_setting | string[]
# $page_cursor | string
# $page_size | int

$klaviyo->TrackingSettings->getTrackingSettings($fields_tracking_setting=$fields_tracking_setting, $page_cursor=$page_cursor, $page_size=$page_size);

Update Tracking Setting

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->TrackingSettings->updateTrackingSetting($id, $body);

Webhooks

Create Webhook

## Positional Arguments

# $body | associative array

$klaviyo->Webhooks->createWebhook($body);

Delete Webhook

## Positional Arguments

# $id | string

$klaviyo->Webhooks->deleteWebhook($id);

Get Webhook

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_webhook | string[]
# $include | string[]

$klaviyo->Webhooks->getWebhook($id, $fields_webhook=$fields_webhook, $include=$include);

Get Webhook Topic

## Positional Arguments

# $id | string

$klaviyo->Webhooks->getWebhookTopic($id);

Get Webhook Topics

$klaviyo->Webhooks->getWebhookTopics();

Get Webhooks

## Keyword Arguments

# $fields_webhook | string[]
# $include | string[]

$klaviyo->Webhooks->getWebhooks($fields_webhook=$fields_webhook, $include=$include);

Update Webhook

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Webhooks->updateWebhook($id, $body);

Appendix

Global Keyword args

NOTES:

  • These are arguments that you can apply to any endpoint call, and which are unique to the SDK.
  • They come LAST, AFTER ALL the endpoint-specific keyword args listed above, in the same order they are listed below.
  • They are subject to the same quirks as any other PHP keyword args, in that to be included, they need to be preceeded by all keyword args listed before them. This includes all endpoint-specific keyword args for a given endpoint, along with any preceeding global keyword args listed below, if applicable. This holds even if those other keyword args are not being used; in that case, set those to null, but again, they must be included.

We currently support the following global keyword args:

  • $apiKey : use this to override the client-level api_key, which you define upon client instantiation.

Namespace

In the interest of making the SDK conform to PHP idioms, we made the following namespace changes relative to the language agnostic resources up top (API Docs, Guides, etc).

  • Underscores are stripped from function names (operation IDs)
  • Function names use camelCase (e.g. getMetrics)
  • Resource names use PascalCase (e.g. Metrics)
  • Parameter names remain unchanged

Parameters & Arguments

We stick to the following convention for parameters/arguments

  1. All parameters are passed as function args.
  2. All optional params, as well as all Body and Form Data params (including required ones), are passed as keyword args.
  3. All query and path params that are tagged as required in the docs are passed as positional args.
  4. $api_key is optional, as it is set at client level. However, you can override the client key wherever by passing in $api_key as the LAST optional param. Reminder: don't do this client-side.