Skip to main content
GET
/
v1
/
customers
/
{customerId}
/
segments
List Customer's Segments
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/customers/{customerId}/segments \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
  "object": "list",
  "data_ref": "data",
  "data": [
    {
      "id": "seg_DNAOhUtJffvX0f57ajLMFBYR",
      "name": "area code not 123",
      "object": "segment"
    },
    {
      "id": "seg_IPIYx96l92Op0Sy5MOaImhgw",
      "name": "not bob.smith@email.com",
      "object": "segment"
    },
    {
      "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2",
      "name": "Birthday After Dec 31",
      "object": "segment"
    },
    {
      "id": "seg_ZEbbT4mq1ePpM9PzR02lcww2",
      "name": "Start with S",
      "object": "segment"
    },
    {
      "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt",
      "name": "Loyalty Card",
      "object": "segment"
    }
  ],
  "total": 5
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

customerId
string
required

Unique identifier of a customer represented by an internal customer ID or customer source ID.

Example:

"cust_nk0N1uNQ1YnupAoJGOgvsODC"

Response

200 - application/json

The method returns segment(s) to which the given customer belongs to.

Response body schema for GET v1/customers/{customerId}/segments. List of customer's segments

object
string
default:list
required

The type of the object represented by JSON. This object stores information about customer segments.

data_ref
string
default:data
required

Identifies the name of the JSON property that contains the array of segment IDs.

data
Simple Segment · object[]
required

A dictionary that contains an array of segment IDs and names.

total
integer
required

Total number of segments the customer belongs to.

I