klaviyo

Klaviyo is a unified customer platform that gives your online brand direct ownership of your consumer data and interactions, empowering you to turn transactions with customers into productive long-term relationships.

Authorization

Basic Auth

Authenticate Track & Identify requests using your 6-character Public API key / Site ID. This can be found in your Account Settings > API Keys tab. This ID must be set as the token key in the base64-encoded payload of your request. For more details, see Track & Identify. To make a web API call from a client such as a mobile application, you must supply an access token on the call. The token acts like an electronic key that lets you access the API.

Klaviyo issues the following types of access tokens:

Key

Description

Key

Description

Integration

The merchant determines which Klaviyo resources the integration has access to.

Admin

The merchant determines which Klaviyo resources an admin user has access to.

Customer

Klaviyo grants access to resources with the anonymous or self permission. Merchants cannot edit these settings.

 

curl --request POST \ --url 'https://a.klaviyo.com/api/track' \ --header 'Accept: text/html' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data 'data={"token": "PUBLIC_KEY"}'

 

The Restful APIs use private API keys. Your private API key is passed using the query parameter api_key with each request.

curl --request POST \ --url 'https://a.klaviyo.com/api/v2/lists?api_key=PRIVATE_KEY' \ --header 'Accept: application/json' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data list_name=ListName

To authenticate Klaviyo through Basic Auth you need to provide the username and password.

Key

Description

Example

Key

Description

Example

Username

It’s a sequence of characters that identifies a user in Klaviyo.

John_Smith

Password

Passwords provide the first line of defense against unauthorized access your Klaviyo account.

****************

For more information please visit Klaviyo Documentation

OAuth 2.0 

Klaviyo provides a separate token service for administrators and customers. When you request a token from one of these services, the service returns a unique access token in exchange for the username and password for a Klaviyo account.

The Klaviyo web API framework allows guest users to access resources that are configured with the permission level of anonymous. Guest users are users who the framework cannot authenticate through existing authentication mechanisms. As a guest user, you do not need to, but you can, specify a token in a web API call for a resource with anonymous permission. Restricting access to anonymous web APIs contains a list of APIs that do not require a token.

The following table lists endpoints and services that can be used to get an authentication token. Admin accounts must be authenticated with a two factor authentication provider. Some providers may require multiple calls.

For most web API calls, you supply this token in the Authorization request header with the Bearer HTTP authorization scheme to prove your identity. By default, an admin token is valid for 4 hours, while a customer token is valid for 1 hour. You can change these values from Admin by selecting Stores > Settings > Configuration > Services > OAuth > Access Token Expiration.

The response contains these fields:

  • oauth_token. The token to be used when requesting an access token.

  • oauth_token_secret. A secret value that establishes ownership of the token.

You must include these request parameters in the Authorization request header in the call:

  • oauth_consumer_key. The customer key value provided after the registration of the application.

  • oauth_nonce. A random value, uniquely generated by the application.

  • oauth_signature_method. The name of the signature method used to sign the request. Valid values are: HMAC-SHA1, RSA-SHA1, and PLAINTEXT.

  • oauth_signature. A generated value (signature).

  • oauth_timestamp. A positive integer, expressed in the number of seconds.

  • oauth_token. The oauth_token, or access token, value obtained in Get an access token.

 

For more information please visit Klaviyo Documentation

Klaviyo Connections

Klaviyo Basic Connection

 

Input 

Key 

Description

Example 

Select application

application

Select Klaviyo application

 Klaviyo

Connection type

connection type

Select the type of connection.

REST

Rest connection type

Rest Connection Type

Select the Basic connection type

Basic

Connection name

name

Provide a name for the connection.

Klaviyo

Connection description

description

Provide a description for the connection.

 

Host name

host 

Provide a string value for the URL of the user's Klaviyo account.

 

Username

username

Provide a valid username for the given Klaviyo account.

exampleUser 

Password

password 

Provide a password to authenticate all requests with. Cloud users need to generate an API token for this value. 

exampleSecurePassword 

Header field

header

Provide the path of the endpoint for authentication.

Authorization

Header prefix header

header prefix

Select the header prefix -
Basic, Bearer, Token, None

 

 

Klaviyo Oauth 2.0 Connection

 

Input 

Key 

Description

Example

Select application

application

Select Klaviyo application

 

Connection type

connection type

Select the type of connection.

 REST

REST connection type

rest connection type

Select the type of REST connection.

 OAuth2.0

Connection name

name

Provide a name for the connection.

 Klaviyo connection

Connection description

description

Provide a description for the connection.

 

Host name

host 

Provide a string value for the URL of the user's Klaviyo account.

 

Grant type

grant type

Provide the grant type - authorization code, password, client credentials.

 

Actions

Add Member to a List

Add Member to a List| key: addMembertoList

 

Key

Description

Example

Key

Description

Example

List Id

Provide the members list id. It’s an unique id that is associated with a particular member list.

Q12BIHGB23400

Email

Provide the email id for the specific member.

Sample@gmail.com

First Name

Add the first name of the members for creating the list.

John

Last Name

Add the last name of the members for creating the list.

Smith

Title

Provide a suitable title for creating the member list.

Sample of members

Organization

Choose or provide the organization name for the members.

Sapper

Phone Number

Add the phone no of the member.

+15417543010


Get List and Segment Members

Get List and Segment Members | key: getListsegmentMembers

 

Key

Description

Example

Key

Description

Example

List or Segment Id

Add the list or segment id for the Klaviyo member. It is a unique id associated with a particular member.

QGhoQW


Get Profile By ID

Get Profile By ID | key: getProfilebyID

 

Key

Description

Example

Key

Description

Example

Person Id

Add the id of the person. This id can be a unique number associated with an individual. You can retrieves all the data attributes for a person, based on the Klaviyo Person ID.

QW018GH12