Skip to main content

    Build foundational API knowledge

    Course overview
    Lesson
    3 min read

    Use Postman to make API calls

    Learn how to use Klaviyo's API collection in Postman. The content in this lesson will allow you to complete the exercises and follow along throughout this course.

    Build quickly and easily with Postman

    Postman is a free external software used by developers to create and test APIs. Klaviyo has developed an API collection for Postman, which makes it fast and easy to select the correct Klaviyo API endpoint and set up your API calls. This lesson will walk you through how to fork and use Klaviyo’s Postman collections.

    Forking the collection refers to making a copy of the collection in your own account. You can make changes to your fork (your copy) without affecting anyone else using the collection.

    Throughout this course, we will provide exercises to try which require you to use Postman to make API calls directly to your Klaviyo test account. Before you continue, head to Postman and sign up for a free account. Then, you can choose to either download Postman to your computer or use it in your browser.

    Can’t find where to download? Navigate to Postman Downloads and click on your OS.

    Fork Klaviyo's API Collection in Postman

    Follow along with the video below to fork Klaviyo's API collection and set up authorization. Open up your test account's API key tab to prepare to paste your API keys into Postman. You can also refer to this guide for a step-by-step walkthrough on forking Klaviyo's collection.

    Understand the parts of an API call in Postman

    Flip through the dropdowns below to see the anatomy of Postman's user interface.

    Type of request
    making a GET request in Postman

    This section specifies the type of HTTP request. The options are GET, POST, PATCH, PUT, DELETE, HEAD, and OPTIONS. Klaviyo’s API endpoints use GET, POST, PATCH, and DELETE methods. The type of request for each Klaviyo API endpoint can be found in the endpoint’s documentation.

    URL
    making a Get Event request in Postman

    This section specifies the request URL or endpoint. If any query and/or path parameters are included, these form part of the URL. In this example, we are calling the GetEvent endpoint, which requires the event ID as a path parameter. This is appended to the end of the URL.

    Note: Anything in double curly brackets, such as {{baseUrl}}, refers to environment variables, which will be described shortly.

    Headers
    __wf_reserved_inherit

    The Headers tab contains all Header information. When using Klaviyo’s server-side API calls, this will always include the Authorization and revision headers, as shown in the screenshot above.

    Body
    body of Create Profile API call in Postman

    The Body tab includes the body of the API call, which is required for most POST requests. This example POST request to the Create Profile endpoint will create a new profile for the email address michaela.klaviyo@gmail.com, including a first name and a custom profile property specifying that Michaela's favorite color is green.

    Response
    response to Get Lists API call

    After making your API call, the bottom of the Postman window shows the response to the API call. This includes the response body, headers, and status. This example request called the Get Lists endpoint and returned a 200 OK status. This means that the call went through successfully. The body of the response contains information about all of the lists in this Klaviyo account.

    Use Postman to make API calls