Skip to main content
Contributor I
September 26, 2024
Solved

Create Segment API call question

  • September 26, 2024
  • 1 reply
  • 96 views

Is it possible to use create segment (https://developers.klaviyo.com/en/reference/create_segment) to create a segment with the API based on a custom property?   For example this sample profile has Age of xyz.  Can I create a segment with the API for all ages of XYZ?  And if so is it the PROFILEPROPERTYCONDITION I need to use?  

 

    This topic has been closed for replies.
    Best answer by chloe.strange

    Hi @kenw222

    Please create one segment using the GUI segment builder and then view the JSON that is generated. Please check the profile-property name in the generated JSON and then use this in subsequent calls to the create segment API. This document includes information on how to use the GUI and then how to access the JSON view: https://developers.klaviyo.com/en/reference/segments_api_overview. I hope this helps!

    ~Chloe

    1 reply

    chloe.strange
    Community Manager
    Community Manager
    October 19, 2024

    Hi @kenw222

    Please create one segment using the GUI segment builder and then view the JSON that is generated. Please check the profile-property name in the generated JSON and then use this in subsequent calls to the create segment API. This document includes information on how to use the GUI and then how to access the JSON view: https://developers.klaviyo.com/en/reference/segments_api_overview. I hope this helps!

    ~Chloe