Skip to main content
Contributor I
June 28, 2023
Solved

Is audience a list or segment?

  • June 28, 2023
  • 1 reply
  • 142 views

Hey all,

I’m using the get campaign API, and I’m reading the audiences include/exclude:

      "audiences": {
        "included": [
          "Y6nRLr"
        ],
        "excluded": [
          "UTd5ui"
        ]
      },

 

My problem is I don’t know if the ID is of a list or a segments, so for each ID I first have to try list API, and if it fails I move to segment API. 

Is there any smarter way?

    This topic has been closed for replies.
    Best answer by Brian Turcotte

    Hi @matanper!

     

    While there’s currently no way to achieve what you’re asking directly through the API, our product team is aware that it would be helpful for more detail to be included in the included/excluded audiences in the response. I will update the thread if there are any changes to this functionality in the future, but for now your current method is an appropriate workaround.

     

    Best,

    Brian

    1 reply

    Brian Turcotte
    Klaviyo Alum
    June 28, 2023

    Hi @matanper!

     

    While there’s currently no way to achieve what you’re asking directly through the API, our product team is aware that it would be helpful for more detail to be included in the included/excluded audiences in the response. I will update the thread if there are any changes to this functionality in the future, but for now your current method is an appropriate workaround.

     

    Best,

    Brian