Segments

The Clients & Contact Segments CRUD API empowers users to manage and organise their Client and contact segments seamlessly. This API offers comprehensive functionalities for creating, reading,

GEThttps://<YOUR HOST>/v1/segments
Query parameters
Header parameters
Response

200 response

Body
idstring
name*string
type*enum
clientcontact
criteriaobject
location*object
Request
const response = await fetch('https://<YOUR HOST>/v1/segments', {
    method: 'GET',
    headers: {
      "x-api-key": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "text",
    "name": "text",
    "type": "client",
    "criteria": {
      "tags": [
        "text"
      ],
      "exclusionTags": [
        "text"
      ],
      "gender": "Male",
      "numberOfDaysLastActivity": 0,
      "ageFrom": 0,
      "ageTo": 0,
      "contactStage": "Subscriber",
      "primaryLocations": [
        {
          "id": "text",
          "title": "text"
        }
      ]
    },
    "location": {
      "id": "text"
    }
  }
]

POSThttps://<YOUR HOST>/v1/segments
Header parameters
Body
idstring
name*string
type*enum
clientcontact
criteriaobject
location*object
Response

200 response

Body
idstring
name*string
type*enum
clientcontact
criteriaobject
location*object
Request
const response = await fetch('https://<YOUR HOST>/v1/segments', {
    method: 'POST',
    headers: {
      "x-api-key": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "location": {
        "id": "text"
      },
      "name": "text",
      "type": "client"
    }),
});
const data = await response.json();
Response
{
  "id": "text",
  "name": "text",
  "type": "client",
  "criteria": {
    "tags": [
      "text"
    ],
    "exclusionTags": [
      "text"
    ],
    "gender": "Male",
    "numberOfDaysLastActivity": 0,
    "ageFrom": 0,
    "ageTo": 0,
    "contactStage": "Subscriber",
    "primaryLocations": [
      {
        "id": "text",
        "title": "text"
      }
    ]
  },
  "location": {
    "id": "text"
  }
}

GEThttps://<YOUR HOST>/v1/segments/{segmentId}
Path parameters
segmentId*string
Header parameters
Response

200 response

Body
Empty Schema
Request
const response = await fetch('https://<YOUR HOST>/v1/segments/{segmentId}', {
    method: 'GET',
    headers: {
      "x-api-key": "text"
    },
});
const data = await response.json();

DELETEhttps://<YOUR HOST>/v1/segments/{segmentId}
Path parameters
segmentId*string
Header parameters
Response

200 response

Body
successboolean
Request
const response = await fetch('https://<YOUR HOST>/v1/segments/{segmentId}', {
    method: 'DELETE',
    headers: {
      "x-api-key": "text"
    },
});
const data = await response.json();
Response
{
  "success": false
}

Last updated