/**
* Klaviyo API
* The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
*
* Contact: developers@klaviyo.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { AxiosResponse } from "axios";
import { EventCreateQueryV2 } from '../model/eventCreateQueryV2';
import { EventsBulkCreateJob } from '../model/eventsBulkCreateJob';
import { GetEventMetricRelationshipResponse } from '../model/getEventMetricRelationshipResponse';
import { GetEventProfileRelationshipResponse } from '../model/getEventProfileRelationshipResponse';
import { GetEventResponseCollectionCompoundDocument } from '../model/getEventResponseCollectionCompoundDocument';
import { GetEventResponseCompoundDocument } from '../model/getEventResponseCompoundDocument';
import { GetMetricResponse } from '../model/getMetricResponse';
import { GetProfileResponse } from '../model/getProfileResponse';
import { Session } from './apis';
export declare class EventsApi {
session: Session;
protected _basePath: string;
protected _defaultHeaders: any;
protected _useQuerystring: boolean;
constructor(session: Session);
set useQuerystring(value: boolean);
set basePath(basePath: string);
set defaultHeaders(defaultHeaders: any);
get defaultHeaders(): any;
get basePath(): string;
/**
* Create a batch of events for one or more profiles. Note that this endpoint allows you to create new profiles or update existing profile properties. At a minimum, profile and metric objects should include at least one profile identifier (e.g., `id`, `email`, or `phone_number`) and the metric `name`, respectively. Accepts up to 1,000 events per request. The maximum allowed payload size is 5MB. A single string cannot exceed 100KB.
*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `events:write`
* @summary Bulk Create Events
* @param eventsBulkCreateJob
*/
bulkCreateEvents(eventsBulkCreateJob: EventsBulkCreateJob): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* Create a new event to track a profile\'s activity. Note that this endpoint allows you to create a new profile or update an existing profile\'s properties. At a minimum, profile and metric objects should include at least one profile identifier (e.g., `id`, `email`, or `phone_number`) and the metric `name`, respectively. Successful response indicates that the event was validated and submitted for processing, but does not guarantee that processing is complete.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:write`
* @summary Create Event
* @param eventCreateQueryV2
*/
createEvent(eventCreateQueryV2: EventCreateQueryV2): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* Get an event with the given event ID.
*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `events:read`
* @summary Get Event
* @param id ID of the event
* @param fieldsEvent For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsMetric For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsProfile For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
*/
getEvent(id: string, options?: {
fieldsEvent?: Array<'datetime' | 'event_properties' | 'timestamp' | 'uuid'>;
fieldsMetric?: Array<'created' | 'integration' | 'name' | 'updated'>;
fieldsProfile?: Array<'created' | 'email' | 'external_id' | 'first_name' | 'image' | 'last_event_date' | 'last_name' | 'locale' | 'location' | 'location.address1' | 'location.address2' | 'location.city' | 'location.country' | 'location.ip' | 'location.latitude' | 'location.longitude' | 'location.region' | 'location.timezone' | 'location.zip' | 'organization' | 'phone_number' | 'properties' | 'title' | 'updated'>;
include?: Array<'attributions' | 'metric' | 'profile'>;
}): Promise<{
response: AxiosResponse;
body: GetEventResponseCompoundDocument;
}>;
/**
* Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` [Custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview) are not supported in the `metric_id` filter. Returns a maximum of 200 events per page.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read`
* @summary Get Events
* @param fieldsEvent For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsMetric For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsProfile For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param filter For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`* @param include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships* @param pageCursor For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination* @param pageSize Default: 200. Min: 1. Max: 1000.* @param sort For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sorting
*/
getEvents(options?: {
fieldsEvent?: Array<'datetime' | 'event_properties' | 'timestamp' | 'uuid'>;
fieldsMetric?: Array<'created' | 'integration' | 'name' | 'updated'>;
fieldsProfile?: Array<'created' | 'email' | 'external_id' | 'first_name' | 'image' | 'last_event_date' | 'last_name' | 'locale' | 'location' | 'location.address1' | 'location.address2' | 'location.city' | 'location.country' | 'location.ip' | 'location.latitude' | 'location.longitude' | 'location.region' | 'location.timezone' | 'location.zip' | 'organization' | 'phone_number' | 'properties' | 'title' | 'updated'>;
filter?: string;
include?: Array<'attributions' | 'metric' | 'profile'>;
pageCursor?: string;
pageSize?: number;
sort?: 'datetime' | '-datetime' | 'timestamp' | '-timestamp';
}): Promise<{
response: AxiosResponse;
body: GetEventResponseCollectionCompoundDocument;
}>;
/**
* Get the metric for an event with the given event ID.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `metrics:read`
* @summary Get Metric for Event
* @param id ID of the event
* @param fieldsMetric For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
*/
getMetricForEvent(id: string, options?: {
fieldsMetric?: Array<'created' | 'integration' | 'name' | 'updated'>;
}): Promise<{
response: AxiosResponse;
body: GetMetricResponse;
}>;
/**
* Get a list of related Metrics for an Event
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `metrics:read`
* @summary Get Metric ID for Event
* @param id ID of the event
*/
getMetricIdForEvent(id: string): Promise<{
response: AxiosResponse;
body: GetEventMetricRelationshipResponse;
}>;
/**
* Get the profile associated with an event with the given event ID.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `profiles:read`
* @summary Get Profile for Event
* @param id ID of the event
* @param additionalFieldsProfile Request additional fields not included by default in the response. Supported values: \'subscriptions\', \'predictive_analytics\'* @param fieldsProfile For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
*/
getProfileForEvent(id: string, options?: {
additionalFieldsProfile?: Array<'subscriptions' | 'predictive_analytics'>;
fieldsProfile?: Array<'created' | 'email' | 'external_id' | 'first_name' | 'image' | 'last_event_date' | 'last_name' | 'locale' | 'location' | 'location.address1' | 'location.address2' | 'location.city' | 'location.country' | 'location.ip' | 'location.latitude' | 'location.longitude' | 'location.region' | 'location.timezone' | 'location.zip' | 'organization' | 'phone_number' | 'predictive_analytics' | 'predictive_analytics.average_days_between_orders' | 'predictive_analytics.average_order_value' | 'predictive_analytics.churn_probability' | 'predictive_analytics.expected_date_of_next_order' | 'predictive_analytics.historic_clv' | 'predictive_analytics.historic_number_of_orders' | 'predictive_analytics.predicted_clv' | 'predictive_analytics.predicted_number_of_orders' | 'predictive_analytics.ranked_channel_affinity' | 'predictive_analytics.total_clv' | 'properties' | 'subscriptions' | 'subscriptions.email' | 'subscriptions.email.marketing' | 'subscriptions.email.marketing.can_receive_email_marketing' | 'subscriptions.email.marketing.consent' | 'subscriptions.email.marketing.consent_timestamp' | 'subscriptions.email.marketing.custom_method_detail' | 'subscriptions.email.marketing.double_optin' | 'subscriptions.email.marketing.last_updated' | 'subscriptions.email.marketing.list_suppressions' | 'subscriptions.email.marketing.method' | 'subscriptions.email.marketing.method_detail' | 'subscriptions.email.marketing.suppression' | 'subscriptions.mobile_push' | 'subscriptions.mobile_push.marketing' | 'subscriptions.mobile_push.marketing.can_receive_push_marketing' | 'subscriptions.mobile_push.marketing.consent' | 'subscriptions.mobile_push.marketing.consent_timestamp' | 'subscriptions.sms' | 'subscriptions.sms.marketing' | 'subscriptions.sms.marketing.can_receive_sms_marketing' | 'subscriptions.sms.marketing.consent' | 'subscriptions.sms.marketing.consent_timestamp' | 'subscriptions.sms.marketing.last_updated' | 'subscriptions.sms.marketing.method' | 'subscriptions.sms.marketing.method_detail' | 'subscriptions.sms.transactional' | 'subscriptions.sms.transactional.can_receive_sms_transactional' | 'subscriptions.sms.transactional.consent' | 'subscriptions.sms.transactional.consent_timestamp' | 'subscriptions.sms.transactional.last_updated' | 'subscriptions.sms.transactional.method' | 'subscriptions.sms.transactional.method_detail' | 'subscriptions.whatsapp' | 'subscriptions.whatsapp.conversational' | 'subscriptions.whatsapp.conversational.can_receive' | 'subscriptions.whatsapp.conversational.consent' | 'subscriptions.whatsapp.conversational.consent_timestamp' | 'subscriptions.whatsapp.conversational.created_timestamp' | 'subscriptions.whatsapp.conversational.last_updated' | 'subscriptions.whatsapp.conversational.metadata' | 'subscriptions.whatsapp.conversational.phone_number' | 'subscriptions.whatsapp.conversational.valid_until' | 'subscriptions.whatsapp.marketing' | 'subscriptions.whatsapp.marketing.can_receive' | 'subscriptions.whatsapp.marketing.consent' | 'subscriptions.whatsapp.marketing.consent_timestamp' | 'subscriptions.whatsapp.marketing.created_timestamp' | 'subscriptions.whatsapp.marketing.last_updated' | 'subscriptions.whatsapp.marketing.metadata' | 'subscriptions.whatsapp.marketing.phone_number' | 'subscriptions.whatsapp.marketing.valid_until' | 'subscriptions.whatsapp.transactional' | 'subscriptions.whatsapp.transactional.can_receive' | 'subscriptions.whatsapp.transactional.consent' | 'subscriptions.whatsapp.transactional.consent_timestamp' | 'subscriptions.whatsapp.transactional.created_timestamp' | 'subscriptions.whatsapp.transactional.last_updated' | 'subscriptions.whatsapp.transactional.metadata' | 'subscriptions.whatsapp.transactional.phone_number' | 'subscriptions.whatsapp.transactional.valid_until' | 'title' | 'updated'>;
}): Promise<{
response: AxiosResponse;
body: GetProfileResponse;
}>;
/**
* Get profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `profiles:read`
* @summary Get Profile ID for Event
* @param id ID of the event
*/
getProfileIdForEvent(id: string): Promise<{
response: AxiosResponse;
body: GetEventProfileRelationshipResponse;
}>;
}
export interface EventsApi {
/**
* Alias of {@link EventsApi.bulkCreateEvents}
*
* @deprecated Use {@link EventsApi.bulkCreateEvents} instead
*/
createEventBulkCreateJob: typeof EventsApi.prototype.bulkCreateEvents;
}
export interface EventsApi {
/**
* Alias of {@link EventsApi.getMetricForEvent}
*
* @deprecated Use {@link EventsApi.getMetricForEvent} instead
*/
getEventMetric: typeof EventsApi.prototype.getMetricForEvent;
}
export interface EventsApi {
/**
* Alias of {@link EventsApi.getMetricIdForEvent}
*
* @deprecated Use {@link EventsApi.getMetricIdForEvent} instead
*/
getEventRelationshipsMetric: typeof EventsApi.prototype.getMetricIdForEvent;
}
export interface EventsApi {
/**
* Alias of {@link EventsApi.getProfileForEvent}
*
* @deprecated Use {@link EventsApi.getProfileForEvent} instead
*/
getEventProfile: typeof EventsApi.prototype.getProfileForEvent;
}
export interface EventsApi {
/**
* Alias of {@link EventsApi.getProfileIdForEvent}
*
* @deprecated Use {@link EventsApi.getProfileIdForEvent} instead
*/
getEventRelationshipsProfile: typeof EventsApi.prototype.getProfileIdForEvent;
}