A typescript client for the Klaviyo API
npm install klaviyo-api- SDK version: 21.0.0
- Revision: 2026-01-15
- If you want to suggest code changes check out our CONTRIBUTING.md document.
- To learn about migration from our 5.x.x version check out the MIGRATION.md file.
- Read version changes in CHANGELOG.md.
- API Reference
- API Guides
- Postman Workspace
This SDK is a thin wrapper around our API. See our API Reference for full documentation on API behavior.
This SDK exactly mirrors the organization and naming convention of the above language-agnostic resources, with a few namespace changes to make it fit better with Typescript
This SDK is organized into the following resources:
- AccountsApi
- CampaignsApi
- CatalogsApi
- CouponsApi
- CustomObjectsApi
- DataPrivacyApi
- EventsApi
- FlowsApi
- FormsApi
- ImagesApi
- ListsApi
- MetricsApi
- ProfilesApi
- ReportingApi
- ReviewsApi
- SegmentsApi
- TagsApi
- TemplatesApi
- TrackingSettingsApi
- WebFeedsApi
- WebhooksApi
You can install this library using npm.
npm install klaviyo-api@21.0.0
Alternatively, you can also run this using this repo as source code, simply download this repo then connect to your app putting the path in your package.json or via npm link
path: add this line to your apps package.json
``Json`
"klaviyo-api": "< path to downloaded source code >"
npm link:
run npm link in your local copy of this repo's directory
run npm link <"path to this repo"> first in your consuming app's directory
Sample file:
If you want to test out the repo but don't have a consuming app, you can run our sample typescript file, make whatever edits you want to sample.ts in the sample folder and use``
npm run sample --pk=
`JavaScript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'
const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
`
`JavaScript
import {
ApiKeySession,
ProfileCreateQuery,
ProfileEnum,
ProfilesApi,
} from 'klaviyo-api'
const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
let profile: ProfileCreateQuery = {
data: {
type: ProfileEnum.Profile,
attributes: {
email: "typescript_test_1@klaviyo-demo.com"
}
}
}
profilesApi.createProfile(profile).then(result => {
console.log(result)
}).catch(error => {
console.log(error)
});
`
> [!IMPORTANT]
> In this SDK, properties in request and response bodies use camelCase, rather than snake_case, which is used by the API.createProfile
> For example, in the payload, you would supply phoneNumber instead of phone_number.
Constructing an API object also has optional property RetryWithExponentialBackoff, which attempts retries on failed API calls with exponential backoff.
The default configs are:
- retryCodes: [429, 503, 504, 524]
- numRetries: 3
- maxInterval: 60
`Typescript`
const retryWithExponentialBackoff: RetryWithExponentialBackoff = new RetryWithExponentialBackoff({ retryCodes: [429, 503, 504, 524], numRetries: 3, maxInterval: 60})
const session = new ApiKeySession("< YOUR API KEY HERE >", retryWithExponentialBackoff)
There is also an optional Klaviyo import that has all the Apis and Auth, if you prefer that method for organization.`Typescript
import { Klaviyo } from 'klaviyo-api'
const profilesApi = new Klaviyo.ProfilesApi(new Klaviyo.Auth.ApiKeySession("< YOUR API KEY HERE >", retry))
``
Failed api calls throw an AxiosError.
The two most commonly useful error items are probably
- error.response.statuserror.response.statusText
-
Here is an example of logging those errors to the console
`Typescript`
profilesApi.createProfile(profile).then(result => {
console.log(result.body)
}).catch(error => {
console.log(error.response.status)
console.log(error.response.statusText)
});
The ImageApi exposes uploadImageFromFile()
`Typescript
import fs from 'fs'
import {ApiKeySession, ImageApi } from 'klaviyo-api'
const session = new ApiKeySession("< YOUR API KEY HERE >")
const imageApi = new ImagesApi(session)
imageApi.uploadImageFromFile(fs.createReadStream("./test_image.jpeg")).then(result => {
console.log(result.body)
}).catch(error => {
console.log(error)
}
`
If you only connect to one Klaviyo account you may find it useful to access preconfigured objects.
Set a global key, If you were using ConfigWrapper this also sets the GlobalApiKeySettings`Typescript
import { GlobalApiKeySettings } from 'klaviyo-api'
new GlobalApiKeySettings("< YOUR API KEY HERE >")
`
Now you can use the shortened names ProfilesApi can be referenced with Profiles`Typescript
import { Profiles, GlobalApiKeySettings } from 'klaviyo-api'
new GlobalApiKeySettings("< YOUR API KEY HERE >")
Profiles.getProfiles().then(result => {
console.log(result.body)
}).catch(error => {
console.log(error.response.status)
console.log(error.response.statusText)
});
`
For users creating integrations or managing multiple Klaviyo accounts, Klaviyo's OAuth authentication will make these tasks easier.
First, configure an integration. If you haven't set up an integration, learn about it in this guide
package can keep your access token up to date. If you have already developed a system for refreshing tokens or would like a more minimalist option, skip to OAuthBasicSession#### TokenStorage
For the OAuthApi to be storage agnostic, this interface must be implemented for the
OAuthApi to retrieve and save you access and refresh tokens.
Implement the retrieve and save functions outlined in the interface. If you need help getting started, check out the storageHelpers.ts in the Klaviyo Example Typescript IntegrationYour implementation needs to include two methods:
1.
save is called after creating a new access token via the authorization flow or after refreshing the access token.
Your code needs to update (and insert if you are going to be using createTokens()) the new access or refresh token information into storage
to keep track of which of your integration users' access information you are referencing, the customerIdentifier is a unique value to help with lookup later.
`typescript
save(customerIdentifier: string, tokens: CreatedTokens): Promise | void
`
2. retrieve leverages the customerIdentifier to look up the saved token information and returns it for the OAuthApi to use
`typescript
retrieve(customerIdentifier: string): Promise | RetrievedTokens
``typescript
import { TokenStorage } from 'klaviyo-api';
class implements TokenStorage
`#### OAuthApi
This class holds the information about your specific integration. It takes three inputs:
1.
clientId - This is the id of your integration. Retrieve it from your integration's settings page
2. clientSecret - This is the secret for your integration. The secret is generated upon the creation of your integration.
3. tokenStorage - This is an instance of your implementation of TokenStorage and is called automatically when creating and refreshing access tokens
`typescript
import { OAuthApi } from 'klaviyo-api';const oauthApi = new OAuthApi("", "", )
`####
OAuthSession
To make an API call, you need to create an OAuthSession instance. This session object is the OAuth equivalent of ApiKeySession and is used similarly.It takes two properties
1.
customerIdentifier - This is how the session is going to grab a user's authentication information and let your implementation of TokenStorage know where to save any update access token
2. oauthApi - This is the instance of OAuthApi created above. It will dictate how the session saves and retrieves the access tokens
3. retryWithExponentialBackoff - OPTIONAL - the RetryWithExponentialBackoff instance outlines your desired exponential backoff configs, outlined in Retry Options above`typescript
import { OAuthSession, ProfilesApi } from 'klaviyo-api';const session = new OAuthSession(customerIdentifier, oauthApi)
//Pass the session into the API you want to use
const profileApi = new ProfilesApi(session)
`####
OAuthBasicSession
If you don't want to deal with any of the helpers above or don't want klaviyo-api to refresh your tokens for you, this is the alternative.The
OAuthBasicSession takes up to two parameters
1. accessToken - The token is used in the API calls' authentication
3. retryWithExponentialBackoff - OPTIONAL - the RetryWithExponentialBackoff instance outlines your desired exponential backoff configs, outlined in Retry Options above`typescript
import { OAuthBasicSession } from 'klaviyo-api';const session = new OAuthBasicSession("")
//Pass the session into the API you want to use
const profileApi = new ProfilesApi(session)
`Remember to check for
401 errors. A 401 means that your token is probably expired.####
KlaviyoTokenErrorIf an error occurred during an API call, check the error type with
isKlaviyoTokenError. The name property will reflect which step the error occurred, reflecting whether it happened during creating, refreshing, saving, or retrieving the name tokens. The cause property will hold the error object of whatever specific error occurred.$3
Build The authorization flow in the same application as with the rest of your integrations business logic or separately.
There is no requirement that the authorization flow has to be backend and can be implemented entirely in a frontend application (in that case, you can ignore this section, as this repo shouldn't use this for frontend code)
To understand the authorization flow, there are two major resources to help:
1. OAuth authorization guide
2. Node Integration Example
If you implement your authorization flow on a node server, you can use these exposed helper functions.
#### OAuthApi
The OAuthApi class also exposes helpful Authorization flow utilities.
1.
generateAuthorizeUrl - This helps correctly format the Klaviyo /oauth/authorize URL the application needs to redirect to so a user can approve your integration.
1. state - This is the only way to identify which user just authorized your application (or failed to). state is passed back via query parameter to your redirectUrl.
2. scope - The permissions the created access tokens will have. The user will be displayed these scopes during the authorization flow. For these permissions to work, also add them to your app settings in Klaviyo here
3. codeChallenge - This is the value generated above by the generateCode function.
4. redirectUrl - This is the URL that Klaviyo will redirect the user to once Authorization is completed (even if it is denied or has an error).
Remember to whitelist this redirect URL in your integration's settings in Klaviyo.
`typescript
import { OAuthApi } from 'klaviyo-api' const oauthApi = new OAuthApi("", "", )
oauthApi.generateAuthorizeUrl(
state, // It's suggested to use your internal identifier for the Klaviyo account that is authorizing
scopes,
codeChallenge,
redirectUrl
)
`
2. createTokens - Uses Klaviyo /oauth/token/ endpoint to create access and refresh tokens
1. customerIdentifier - This ID is NOT sent to Klaviyo's API. If the /token API call this method wraps is successful, the created tokens will be passed into your save method along with this customerIdentifier in your implementation of TokenStorage.
2. codeVerifier - The verifier code must match the challenge code in the authorized URL redirect.
3. authorizationCode- A User approving your integration creates this temporary authorization code. Your specified redirect URL receives this under a code query parameter.
4. redirectUrl - The endpoint set in generateAuthorizeUrl. Whitelist the URL in your application settings.
`typescript
import { OAuthApi } from 'klaviyo-api' const oauthApi = new OAuthApi("", "", )
await oauthApi.createTokens(
customerIdentifier,
codeVerifier,
authorizationCode,
redirectUrl
)
`
3. OAuthCallbackQueryParams For typescript users, this object is an interface representing the possible query parameters sent to your redirect endpoint#### Proof Key of Code Exchange (PKCE)
All the PKCE helper functions live within the
Pkce namespace. Read about PKCE here`typescript
import { Pkce } from 'klaviyo-api'
`The
Pkce namespace holds two different helper utilities
1. generateCodes - This method will create the codeVerifier and codeChallenge needed later in the authorization flow.
`typescript
import { Pkce } from 'klaviyo-api' const pkceCodes = new Pkce.generateCodes()
// the two codes can be accessed by
const codeVerifier: string = pkceCodes.codeVerifier
const codeChallenge: string = pkceCodes.codeChallenge
`2.
CodeStorage - This is an OPTIONAL interface to help keep your code organized, to relate a customerIdentifier to their generated PKCE code
`typescript
import { Pkce } from 'klaviyo-api'
class implements Pkce.CodeStorage
`Optional Parameters and JSON:API features
Here we will go over
- Pagination
- Page size
- Additional Fields
- Filtering
- Sparse Fields
- Sorting
- Relationships
$3
As a reminder, some optional parameters are named slightly differently from how you would make the call without the SDK docs;
the reason for this is that some query parameter names have variables that make for bad JavaScript names.
For example:
page[cursor] becomes pageCursor. (In short: remove the non-allowed characters and append words with camelCase).$3
All the endpoints that return a list of results use cursor-based pagination.
Obtain the cursor value from the call you want to get the next page for, then pass it under the
pageCursor optional parameter. The page cursor looks like WzE2NDA5OTUyMDAsICIzYzRjeXdGTndadyIsIHRydWVd.API call:
`
https://a.klaviyo.com/api/profiles/?page[cursor]=WzE2NTcyMTM4NjQsICIzc042NjRyeHo0ciIsIHRydWVd
`SDK call:
`Typescript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const profileList = await profilesApi.getProfiles({pageCursor: 'WzE2NTcyMTM4NjQsICIzc042NjRyeHo0ciIsIHRydWVd'})
`You get the cursor for the
next page from body.link.next. This returns the entire url of the next call,
but the SDK will accept the entire link and use only the relevant cursor, so no need to do any parsing of the next link on your endHere is an example of getting the second next and passing in the page cursor:
`Typescript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
try {
const profilesListFirstPage = await profilesApi.getProfiles()
const nextPage = profilesListFirstPage.body.links.next
const profileListSecondPage = await profilesApi.getProfiles({pageCursor: nextPage})
console.log(profileListSecondPage.body)
} catch (e) {
console.log(e)
}
`There are more page cursors than just
next: first, last, next and prev. Check the API Reference for all the paging params for a given endpoint.$3
Some endpoints allow you to set the page size by using the
pageSize parameter.API call:
`
https://a.klaviyo.com/api/profiles/?page[size]=20
`SDK call:
`typescript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const profileList = await profilesApi.getProfiles({pageSize: 20})
`$3
Additional fields are used to populate parts of the response that would be
null otherwise.
For example, for the getProfile, endpoint you can pass in a request to get the predictive analytics of the profile. Using the additionalFields parameter does impact the rate limit of the endpoint in cases where the related resource is subject to a lower rate limit, so be sure to keep an eye on your usage.
API call:
`
https://a.klaviyo.com/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H/?additional-fields[profile]=predictive_analytics
`SDK call:
`javascript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const profileId = '01GDDKASAP8TKDDA2GRZDSVP4H'
const profile = await profilesApi.getProfile(profileId, {additionalFieldsProfile: ['predictive_analytics']})
// If your profile has enough information for predictive analytis it will populate
console.log(profile.body.data.attributes.predictiveAnalytics)
`#### Filtering
You can filter responses by passing a string into the optional parameter
filter. Note that when filtering by a property it will be snake_case instead of camelCase, ie. metric_idRead more about formatting your filter strings in our developer documentation
Here is an example of a filter string for results between two date times:
less-than(updated,2023-04-26T00:00:00Z),greater-than(updated,2023-04-19T00:00:00Z)Here is a code example to filter for profiles with the matching emails:
`
https://a.klaviyo.com/api/profiles/?filter=any(email,["henry.chan@klaviyo-demo.com","amanda.das@klaviyo-demo.com"]
`
SDK call:
`javascript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const filter = 'any(email,["henry.chan@klaviyo-demo.com","amanda.das@klaviyo-demo.com"])'
const profileList = await profilesApi.getProfiles({filter})
`To help create filters in the correct format, use the
FilterBuilder class`typescript
new FilterBuilder()
.equals("email", "sm@klaviyo-demo.com")
.build() // outputs equals(email,"sm@klaviyo-demo.com")
`Complex filters can be build by adding additional filters to the builder before calling
build()`typescript
const date = new Date(2023, 7, 15, 12, 30, 0);
new FilterBuilder()
.any("email", ["sarah.mason@klaviyo-demo.com", "sm@klaviyo-demo.com"])
.greaterThan("created", date)
.build();
// outputs any(email,["sarah.mason@klaviyo-demo.com","sm@klaviyo-demo.com"]),greater-than(created,2023-08-15T16:30:00.000Z)
`$3
If you only want a specific subset of data from a specific query you can use sparse fields to request only the specific properties.
The SDK expands the optional sparse fields into their own option, where you can pass a list of the desired items to include.
To get a list of event properties the API call you would use is:
`
https://a.klaviyo.com/api/events/?fields[event]=event_properties
`SDK call:
`javascript
import { ApiKeySession, EventsApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const eventsApi = new EventsApi(session)
const eventsList = await eventsApi.getEvents({fieldsEvent: ["event_properties"]})
`$3
Your can request the results of specific endpoints to be ordered by a given parameter. The direction of the sort can be reversed by adding a
- in front of the sort key.
For example datetime will be ascending while -datetime will be descending.If you are unsure about the available sort fields, refer to the API Reference page for the endpoint you are using.
For a comprehensive list that links to the documentation for each function check the Endpoints section below.
API Call to get events sorted by oldest to newest datetime:
`
https://a.klaviyo.com/api/events/?sort=-datetime
`
SDK call:`typescript
import { ApiKeySession, EventsApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const eventsApi = new EventsApi(session)
const events = await eventsApi.getEvents({sort: '-datetime'})
`$3
You can add additional information to your API response via additional fields and the includes parameter.
This allows you to get information about two or more objects from a single API call.
Using the includes parameter often changes the rate limit of the endpoint so be sure to take note.
API call to get profile information and the information about the lists the profile is in:
`
https://a.klaviyo.com/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H/?include=lists
`SDK call:
`Typescript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const profileId = '01GDDKASAP8TKDDA2GRZDSVP4H'
const profile = await profilesApi.getProfile(profileId,{include:["lists"]})
// Profile information is accessed the same way with
console.log(profile.body.data)
// Lists related to the profile with be accessible via the included array
console.log(profile.body.included)
`Note about sparse fields and relationships: you can also request only specific fields for the included object as well.
`Typescript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const profileId = '01GDDKASAP8TKDDA2GRZDSVP4H'
// Use the fieldsLists property to request only the list name
const profile = await profilesApi.getProfile(profileId, {fieldsList: ['name'], include: ["lists"]})
// Profile information is accessed the same way with
console.log(profile.body.data)
// Lists related to the profile with be accessible via the included array
console.log(profile.body.included)
`$3
The Klaviyo API has a series of endpoints to expose the relationships between different Klaviyo Items. You can read more about relationships in our documentation.
Here are some use cases and their examples:
API call to get the list membership for a profile with the given profile ID:
`
https://a.klaviyo.com/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H/relationships/lists/
`SDK call:
`Typescript
import { ApiKeySession, ProfilesApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const profilesApi = new ProfilesApi(session)
const profileId = '01GDDKASAP8TKDDA2GRZDSVP4H'
const profileRelationships = await profilesApi.getProfileRelationshipsLists(profileId)
`For another example:
Get all campaigns associated with the given
tag_id.API call:
`
https://a.klaviyo.com/api/tags/9c8db7a0-5ab5-4e3c-9a37-a3224fd14382/relationships/campaigns/
`SDK call:
`typescript
import { ApiKeySession, TagsApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const tagsApi = new TagsApi(session)
const tagId = '9c8db7a0-5ab5-4e3c-9a37-a3224fd14382'
const relatedCampagins = tagsApi.getTagRelationshipsCampaigns(tagId)
`
$3
You can use any combination of the features outlines above in conjunction with one another.
API call to get events associated with a specific metric, then return just the event properties sorted by oldest to newest datetime:
API call:
`
https://a.klaviyo.com/api/events/?fields[event]=event_properties&filter=equals(metric_id,"URDbLg")&sort=-datetime
`
SDK call:
`typescript
import { ApiKeySession, EventsApi } from 'klaviyo-api'const session = new ApiKeySession("< YOUR API KEY HERE >")
const eventsApi = new EventsApi(session)
const metricId = 'URDbLg'
const filter =
equal(metric_id,"${metricId}")
const events = await eventsApi.getEvents({fieldsEvent: ['event_properties'], sort: '-datetime', filter})
`Endpoints
AccountsApi
_______________________________`typescript
AccountsApi.getAccount(id: string, options)
`
_______________________________`typescript
AccountsApi.getAccounts(options)
`
_______________________________
CampaignsApi
_______________________________`typescript
CampaignsApi.assignTemplateToCampaignMessage(campaignMessageAssignTemplateQuery: CampaignMessageAssignTemplateQuery)
`
##### Method alias:
`typescript
CampaignsApi.createCampaignMessageAssignTemplate(campaignMessageAssignTemplateQuery: CampaignMessageAssignTemplateQuery)
`
_______________________________`typescript
CampaignsApi.cancelCampaignSend(id: string, campaignSendJobPartialUpdateQuery: CampaignSendJobPartialUpdateQuery)
`
##### Method alias:
`typescript
CampaignsApi.updateCampaignSendJob(id: string, campaignSendJobPartialUpdateQuery: CampaignSendJobPartialUpdateQuery)
`
_______________________________`typescript
CampaignsApi.createCampaign(campaignCreateQuery: CampaignCreateQuery)
`
_______________________________`typescript
CampaignsApi.createCampaignClone(campaignCloneQuery: CampaignCloneQuery)
`
##### Method alias:
`typescript
CampaignsApi.cloneCampaign(campaignCloneQuery: CampaignCloneQuery)
`
_______________________________`typescript
CampaignsApi.deleteCampaign(id: string)
`
_______________________________`typescript
CampaignsApi.getCampaign(id: string, options)
`
_______________________________`typescript
CampaignsApi.getCampaignForCampaignMessage(id: string, options)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessageCampaign(id: string, options)
`
_______________________________`typescript
CampaignsApi.getCampaignIdForCampaignMessage(id: string)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessageRelationshipsCampaign(id: string)
`
_______________________________`typescript
CampaignsApi.getCampaignMessage(id: string, options)
`
_______________________________`typescript
CampaignsApi.getCampaignRecipientEstimation(id: string, options)
`
_______________________________`typescript
CampaignsApi.getCampaignRecipientEstimationJob(id: string, options)
`
_______________________________`typescript
CampaignsApi.getCampaignSendJob(id: string, options)
`
_______________________________`typescript
CampaignsApi.getCampaigns(filter: string, options)
`
_______________________________`typescript
CampaignsApi.getImageForCampaignMessage(id: string, options)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessageImage(id: string, options)
`
_______________________________`typescript
CampaignsApi.getImageIdForCampaignMessage(id: string)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessageRelationshipsImage(id: string)
`
_______________________________`typescript
CampaignsApi.getMessageIdsForCampaign(id: string)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignRelationshipsCampaignMessages(id: string)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignRelationshipsMessages(id: string)
`
_______________________________`typescript
CampaignsApi.getMessagesForCampaign(id: string, options)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignCampaignMessages(id: string, options)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessages(id: string, options)
`
_______________________________`typescript
CampaignsApi.getTagIdsForCampaign(id: string)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignRelationshipsTags(id: string)
`
_______________________________`typescript
CampaignsApi.getTagsForCampaign(id: string, options)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignTags(id: string, options)
`
_______________________________`typescript
CampaignsApi.getTemplateForCampaignMessage(id: string, options)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessageTemplate(id: string, options)
`
_______________________________`typescript
CampaignsApi.getTemplateIdForCampaignMessage(id: string)
`
##### Method alias:
`typescript
CampaignsApi.getCampaignMessageRelationshipsTemplate(id: string)
`
_______________________________`typescript
CampaignsApi.refreshCampaignRecipientEstimation(campaignRecipientEstimationJobCreateQuery: CampaignRecipientEstimationJobCreateQuery)
`
##### Method alias:
`typescript
CampaignsApi.createCampaignRecipientEstimationJob(campaignRecipientEstimationJobCreateQuery: CampaignRecipientEstimationJobCreateQuery)
`
_______________________________`typescript
CampaignsApi.sendCampaign(campaignSendJobCreateQuery: CampaignSendJobCreateQuery)
`
##### Method alias:
`typescript
CampaignsApi.createCampaignSendJob(campaignSendJobCreateQuery: CampaignSendJobCreateQuery)
`
_______________________________`typescript
CampaignsApi.updateCampaign(id: string, campaignPartialUpdateQuery: CampaignPartialUpdateQuery)
`
_______________________________`typescript
CampaignsApi.updateCampaignMessage(id: string, campaignMessagePartialUpdateQuery: CampaignMessagePartialUpdateQuery)
`
_______________________________`typescript
CampaignsApi.updateImageForCampaignMessage(id: string, campaignMessageImageUpdateQuery: CampaignMessageImageUpdateQuery)
`
##### Method alias:
`typescript
CampaignsApi.updateCampaignMessageRelationshipsImage(id: string, campaignMessageImageUpdateQuery: CampaignMessageImageUpdateQuery)
`
_______________________________
CatalogsApi
_______________________________`typescript
CatalogsApi.addCategoriesToCatalogItem(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
##### Method alias:
`typescript
CatalogsApi.addCategoryToCatalogItem(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogItemRelationshipsCategory(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogItemRelationshipsCategories(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
_______________________________`typescript
CatalogsApi.addItemsToCatalogCategory(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogCategoryRelationshipsItem(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogCategoryRelationshipsItems(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
_______________________________`typescript
CatalogsApi.bulkCreateCatalogCategories(catalogCategoryCreateJobCreateQuery: CatalogCategoryCreateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnCreateCategoriesJob(catalogCategoryCreateJobCreateQuery: CatalogCategoryCreateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogCategoryBulkCreateJob(catalogCategoryCreateJobCreateQuery: CatalogCategoryCreateJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkCreateCatalogItems(catalogItemCreateJobCreateQuery: CatalogItemCreateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnCreateItemsJob(catalogItemCreateJobCreateQuery: CatalogItemCreateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogItemBulkCreateJob(catalogItemCreateJobCreateQuery: CatalogItemCreateJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkCreateCatalogVariants(catalogVariantCreateJobCreateQuery: CatalogVariantCreateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnCreateVariantsJob(catalogVariantCreateJobCreateQuery: CatalogVariantCreateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogVariantBulkCreateJob(catalogVariantCreateJobCreateQuery: CatalogVariantCreateJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkDeleteCatalogCategories(catalogCategoryDeleteJobCreateQuery: CatalogCategoryDeleteJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnDeleteCategoriesJob(catalogCategoryDeleteJobCreateQuery: CatalogCategoryDeleteJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogCategoryBulkDeleteJob(catalogCategoryDeleteJobCreateQuery: CatalogCategoryDeleteJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkDeleteCatalogItems(catalogItemDeleteJobCreateQuery: CatalogItemDeleteJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnDeleteItemsJob(catalogItemDeleteJobCreateQuery: CatalogItemDeleteJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogItemBulkDeleteJob(catalogItemDeleteJobCreateQuery: CatalogItemDeleteJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkDeleteCatalogVariants(catalogVariantDeleteJobCreateQuery: CatalogVariantDeleteJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnDeleteVariantsJob(catalogVariantDeleteJobCreateQuery: CatalogVariantDeleteJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogVariantBulkDeleteJob(catalogVariantDeleteJobCreateQuery: CatalogVariantDeleteJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkUpdateCatalogCategories(catalogCategoryUpdateJobCreateQuery: CatalogCategoryUpdateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnUpdateCategoriesJob(catalogCategoryUpdateJobCreateQuery: CatalogCategoryUpdateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogCategoryBulkUpdateJob(catalogCategoryUpdateJobCreateQuery: CatalogCategoryUpdateJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkUpdateCatalogItems(catalogItemUpdateJobCreateQuery: CatalogItemUpdateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnUpdateItemsJob(catalogItemUpdateJobCreateQuery: CatalogItemUpdateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogItemBulkUpdateJob(catalogItemUpdateJobCreateQuery: CatalogItemUpdateJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.bulkUpdateCatalogVariants(catalogVariantUpdateJobCreateQuery: CatalogVariantUpdateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.spawnUpdateVariantsJob(catalogVariantUpdateJobCreateQuery: CatalogVariantUpdateJobCreateQuery)
`
##### Method alias:
`typescript
CatalogsApi.createCatalogVariantBulkUpdateJob(catalogVariantUpdateJobCreateQuery: CatalogVariantUpdateJobCreateQuery)
`
_______________________________`typescript
CatalogsApi.createBackInStockSubscription(serverBISSubscriptionCreateQuery: ServerBISSubscriptionCreateQuery)
`
_______________________________`typescript
CatalogsApi.createCatalogCategory(catalogCategoryCreateQuery: CatalogCategoryCreateQuery)
`
_______________________________`typescript
CatalogsApi.createCatalogItem(catalogItemCreateQuery: CatalogItemCreateQuery)
`
_______________________________`typescript
CatalogsApi.createCatalogVariant(catalogVariantCreateQuery: CatalogVariantCreateQuery)
`
_______________________________`typescript
CatalogsApi.deleteCatalogCategory(id: string)
`
_______________________________`typescript
CatalogsApi.deleteCatalogItem(id: string)
`
_______________________________`typescript
CatalogsApi.deleteCatalogVariant(id: string)
`
_______________________________`typescript
CatalogsApi.getBulkCreateCatalogItemsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCreateItemsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemBulkCreateJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkCreateCatalogItemsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCreateItemsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemBulkCreateJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkCreateCategoriesJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCreateCategoriesJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryBulkCreateJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkCreateCategoriesJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCreateCategoriesJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryBulkCreateJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkCreateVariantsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCreateVariantsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogVariantBulkCreateJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkCreateVariantsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCreateVariantsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogVariantBulkCreateJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkDeleteCatalogItemsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getDeleteItemsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemBulkDeleteJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkDeleteCatalogItemsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getDeleteItemsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemBulkDeleteJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkDeleteCategoriesJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getDeleteCategoriesJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryBulkDeleteJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkDeleteCategoriesJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getDeleteCategoriesJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryBulkDeleteJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkDeleteVariantsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getDeleteVariantsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogVariantBulkDeleteJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkDeleteVariantsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getDeleteVariantsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogVariantBulkDeleteJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkUpdateCatalogItemsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getUpdateItemsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemBulkUpdateJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkUpdateCatalogItemsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getUpdateItemsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemBulkUpdateJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkUpdateCategoriesJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getUpdateCategoriesJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryBulkUpdateJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkUpdateCategoriesJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getUpdateCategoriesJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryBulkUpdateJobs(options)
`
_______________________________`typescript
CatalogsApi.getBulkUpdateVariantsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getUpdateVariantsJob(jobId: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogVariantBulkUpdateJob(jobId: string, options)
`
_______________________________`typescript
CatalogsApi.getBulkUpdateVariantsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getUpdateVariantsJobs(options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogVariantBulkUpdateJobs(options)
`
_______________________________`typescript
CatalogsApi.getCatalogCategories(options)
`
_______________________________`typescript
CatalogsApi.getCatalogCategory(id: string, options)
`
_______________________________`typescript
CatalogsApi.getCatalogItem(id: string, options)
`
_______________________________`typescript
CatalogsApi.getCatalogItems(options)
`
_______________________________`typescript
CatalogsApi.getCatalogVariant(id: string, options)
`
_______________________________`typescript
CatalogsApi.getCatalogVariants(options)
`
_______________________________`typescript
CatalogsApi.getCategoriesForCatalogItem(id: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemCategories(id: string, options)
`
_______________________________`typescript
CatalogsApi.getCategoryIdsForCatalogItem(id: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemRelationshipsCategories(id: string, options)
`
_______________________________`typescript
CatalogsApi.getItemIdsForCatalogCategory(id: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryRelationshipsItems(id: string, options)
`
_______________________________`typescript
CatalogsApi.getItemsForCatalogCategory(id: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogCategoryItems(id: string, options)
`
_______________________________`typescript
CatalogsApi.getVariantIdsForCatalogItem(id: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemRelationshipsVariants(id: string, options)
`
_______________________________`typescript
CatalogsApi.getVariantsForCatalogItem(id: string, options)
`
##### Method alias:
`typescript
CatalogsApi.getCatalogItemVariants(id: string, options)
`
_______________________________`typescript
CatalogsApi.removeCategoriesFromCatalogItem(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
##### Method alias:
`typescript
CatalogsApi.deleteCatalogItemRelationshipsCategories(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
_______________________________`typescript
CatalogsApi.removeItemsFromCatalogCategory(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
##### Method alias:
`typescript
CatalogsApi.deleteCatalogCategoryRelationshipsItems(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
_______________________________`typescript
CatalogsApi.updateCatalogCategory(id: string, catalogCategoryUpdateQuery: CatalogCategoryUpdateQuery)
`
_______________________________`typescript
CatalogsApi.updateCatalogItem(id: string, catalogItemUpdateQuery: CatalogItemUpdateQuery)
`
_______________________________`typescript
CatalogsApi.updateCatalogVariant(id: string, catalogVariantUpdateQuery: CatalogVariantUpdateQuery)
`
_______________________________`typescript
CatalogsApi.updateCategoriesForCatalogItem(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
##### Method alias:
`typescript
CatalogsApi.updateCatalogItemRelationshipsCategories(id: string, catalogItemCategoryOp: CatalogItemCategoryOp)
`
_______________________________`typescript
CatalogsApi.updateItemsForCatalogCategory(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
##### Method alias:
`typescript
CatalogsApi.updateCatalogCategoryRelationshipsItems(id: string, catalogCategoryItemOp: CatalogCategoryItemOp)
`
_______________________________
CouponsApi
_______________________________`typescript
CouponsApi.bulkCreateCouponCodes(couponCodeCreateJobCreateQuery: CouponCodeCreateJobCreateQuery)
`
##### Method alias:
`typescript
CouponsApi.spawnCouponCodeBulkCreateJob(couponCodeCreateJobCreateQuery: CouponCodeCreateJobCreateQuery)
`
##### Method alias:
`typescript
CouponsApi.createCouponCodeBulkCreateJob(couponCodeCreateJobCreateQuery: CouponCodeCreateJobCreateQuery)
`
_______________________________`typescript
CouponsApi.createCoupon(couponCreateQuery: CouponCreateQuery)
`
_______________________________`typescript
CouponsApi.createCouponCode(couponCodeCreateQuery: CouponCodeCreateQuery)
`
_______________________________`typescript
CouponsApi.deleteCoupon(id: string)
`
_______________________________`typescript
CouponsApi.deleteCouponCode(id: string)
`
_______________________________`typescript
CouponsApi.getBulkCreateCouponCodeJobs(options)
`
##### Method alias:
`typescript
CouponsApi.getCouponCodeBulkCreateJobs(options)
`
_______________________________`typescript
CouponsApi.getBulkCreateCouponCodesJob(jobId: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCouponCodeBulkCreateJob(jobId: string, options)
`
_______________________________`typescript
CouponsApi.getCoupon(id: string, options)
`
_______________________________`typescript
CouponsApi.getCouponCode(id: string, options)
`
_______________________________`typescript
CouponsApi.getCouponCodeIdsForCoupon(id: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCouponCodeRelationshipsCoupon(id: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCodeIdsForCoupon(id: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCouponRelationshipsCodes(id: string, options)
`
_______________________________`typescript
CouponsApi.getCouponCodes(filter: string, options)
`
_______________________________`typescript
CouponsApi.getCouponCodesForCoupon(id: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCouponCouponCodes(id: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCodesForCoupon(id: string, options)
`
_______________________________`typescript
CouponsApi.getCouponForCouponCode(id: string, options)
`
##### Method alias:
`typescript
CouponsApi.getCouponCodeCoupon(id: string, options)
`
_______________________________`typescript
CouponsApi.getCouponIdForCouponCode(id: string)
`
##### Method alias:
`typescript
CouponsApi.getCouponRelationshipsCouponCodes(id: string)
`
_______________________________`typescript
CouponsApi.getCoupons(options)
`
_______________________________`typescript
CouponsApi.updateCoupon(id: string, couponUpdateQuery: CouponUpdateQuery)
`
_______________________________`typescript
CouponsApi.updateCouponCode(id: string, couponCodeUpdateQuery: CouponCodeUpdateQuery)
`
_______________________________
CustomObjectsApi
_______________________________`typescript
CustomObjectsApi.bulkCreateDataSourceRecords(dataSourceRecordBulkCreateJobCreateQuery: DataSourceRecordBulkCreateJobCreateQuery)
`
##### Method alias:
`typescript
CustomObjectsApi.createDataSourceRecordBulkCreateJob(dataSourceRecordBulkCreateJobCreateQuery: DataSourceRecordBulkCreateJobCreateQuery)
`
_______________________________`typescript
CustomObjectsApi.createDataSource(dataSourceCreateQuery: DataSourceCreateQuery)
`
_______________________________`typescript
CustomObjectsApi.createDataSourceRecord(dataSourceRecordCreateJobCreateQuery: DataSourceRecordCreateJobCreateQuery)
`
##### Method alias:
`typescript
CustomObjectsApi.createDataSourceRecordCreateJob(dataSourceRecordCreateJobCreateQuery: DataSourceRecordCreateJobCreateQuery)
`
_______________________________`typescript
CustomObjectsApi.deleteDataSource(id: string)
`
_______________________________`typescript
CustomObjectsApi.getDataSource(id: string, options)
`
_______________________________`typescript
CustomObjectsApi.getDataSources(options)
`
_______________________________
DataPrivacyApi
_______________________________`typescript
DataPrivacyApi.requestProfileDeletion(dataPrivacyCreateDeletionJobQuery: DataPrivacyCreateDeletionJobQuery)
`
##### Method alias:
`typescript
DataPrivacyApi.createDataPrivacyDeletionJob(dataPrivacyCreateDeletionJobQuery: DataPrivacyCreateDeletionJobQuery)
`
_______________________________
EventsApi
_______________________________`typescript
EventsApi.bulkCreateEvents(eventsBulkCreateJob: EventsBulkCreateJob)
`
##### Method alias:
`typescript
EventsApi.createEventBulkCreateJob(eventsBulkCreateJob: EventsBulkCreateJob)
`
_______________________________`typescript
EventsApi.createEvent(eventCreateQueryV2: EventCreateQueryV2)
`
_______________________________`typescript
EventsApi.getEvent(id: string, options)
`
_______________________________`typescript
EventsApi.getEvents(options)
`
_______________________________`typescript
EventsApi.getMetricForEvent(id: string, options)
`
##### Method alias:
`typescript
EventsApi.getEventMetric(id: string, options)
`
_______________________________`typescript
EventsApi.getMetricIdForEvent(id: string)
`
##### Method alias:
`typescript
EventsApi.getEventRelationshipsMetric(id: string)
`
_______________________________`typescript
EventsApi.getProfileForEvent(id: string, options)
`
##### Method alias:
`typescript
EventsApi.getEventProfile(id: string, options)
`
_______________________________`typescript
EventsApi.getProfileIdForEvent(id: string)
`
##### Method alias:
`typescript
EventsApi.getEventRelationshipsProfile(id: string)
`
_______________________________
FlowsApi
_______________________________`typescript
FlowsApi.createFlow(flowCreateQuery: FlowCreateQuery, options)
`
_______________________________`typescript
FlowsApi.deleteFlow(id: string)
`
_______________________________`typescript
FlowsApi.getActionForFlowMessage(id: string, options)
`
##### Method alias:
`typescript
FlowsApi.getFlowMessageAction(id: string, options)
`
_______________________________`typescript
FlowsApi.getActionIdForFlowMessage(id: string)
`
##### Method alias:
`typescript
FlowsApi.getFlowMessageRelationshipsAction(id: string)
``[Get Action IDs for Flow](https://developers.klaviyo.com/en/v2026-01-15/reference/get_act