You will learn
Get a foundational understanding of API calls and how the Klaviyo APIs can benefit your business. In this guide, you will learn about REST APIs, HTTP methods, and developer tools to prepare you for testing Klaviyo's APIs. Your first API calls can be accomplished in as little as 10 minutes from start to finish. If you are already familiar with API calls and are ready to test our APIs, follow our guide on how to use our Postman collections.
What is a REST API?
REST API is a set of acronyms that stand for Representational State Transfer and Application Programming Interface. These terms can be more simply understood as structured requests that allow a piece of software to talk to another and pass information between them. When you make an API call, you are submitting a request to a server where information is stored, which then returns a response containing your requested data in JSON, or JavaScript Object Notation, format.
More simply, REST APIs allow you to request data stored in Klaviyo and have that data returned to you in a format that is readable by you and by computers.
A standard API call happens in seconds. Behind the scenes, your call will:
- Send a structured request for data over the internet to the API. Requests are sent via HTTP, a basic network request type that the internet is largely built around.
- The API will receive the request, process it, and obtain the requested information from Klaviyo's databases.
- The API then responds to the client application using JSON structured format.
- You will receive the JSON response from your client application.
Although this knowledge is helpful to understand how data transfer works, it isn't necessary to start making API calls and getting value out of what Klaviyo APIs have to offer. Everything you need to know to get started with your first API calls will be covered in the following sections.
HTTP methodsHTTP methods
HTTP Methods are the “verbs” by which your requests are sent. There are two HTTP methods we will address in this guide: GET and POST.
GET
A GET request can be most easily understood as a “read” request. GET requests retrieve information from the API endpoint and return it to you in a JSON-formatted response. These requests only allow you to read data, making them the safest type of request because your data cannot be modified or overwritten with this method.
POST
A POST request can be simply understood as a “write” request. POST allows you to create or add new resources. For example, a POST request to the List API can be used to create a new list in your account, while a GET request can be used to retrieve all available lists. Note that, when posting data, responses will vary depending on when Klaviyo can complete your request.
Necessary toolsNecessary tools
APIs offer plenty of flexibility to your workflows and don't require you to use a specific client application or language library to achieve the desired results. Because API calls are made using HTTP requests, nearly every programming language has the ability to send this type of request natively or through a widely available language library. Additionally, depending on your machine and operating system, you can use native applications like Apple’s Terminal or Windows Command Line to make client-side API calls. However, these applications require prior knowledge of command line interfaces.
We use a free web and desktop application called Postman. Postman has a variety of features that makes it easier to set up and send an API request by inputting the endpoint, parameters, and authentication into a helpful user interface.
Test Klaviyo's APIsTest Klaviyo's APIs
Klaviyo's APIs are useful for sending data from other platforms or servers to Klaviyo accounts or querying information within a Klaviyo account. Now that you have an understanding of how APIs work, you can get started testing our APIs for your business's use cases. For a full list of Klaviyo's available APIs, check out our API reference documentation. Follow our guide on how to use our Postman collections to make your first Klaviyo API call.
Additional resourcesAdditional resources
Developer portal resourcesDeveloper portal resources
Klaviyo's developer portal contains API guides and reference documentation to help you make the most out of our APIs. Check out the resources below to get started:
- Klaviyo API reference documentation
- Getting started with the Javascript API
- Setting up API-based transactional events
Klaviyo developer courses
Klaviyo developer courses
Klaviyo Academy provides developer courses to help you get started building with Klaviyo APIs. Check out the courses below:
- Klaviyo developer certificate
- Define common API terms
- Build foundational API knowledge
- Map your data into Klaviyo