Skip to main content

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,

API regionapi.whautomate.com

GET /v1/segments​

GET /v1/segments
Headers
x-api-keystringrequired
Your Whautomate API key.
Query parameters
locationIdstring
limitstring
pagestring
searchTextstring
Response 200
idstring
namestringrequired
typestring (enum)required
One of: client, contact.
criteriaobject
locationobjectrequired
Request
curl -X GET "https://api.whautomate.com/v1/segments" \
-H "x-api-key: YOUR_API_KEY"
Response 200
[
{
"id": "string",
"name": "string",
"type": "client",
"criteria": {
"tags": [
"string"
],
"exclusionTags": [
"string"
],
"gender": "Male",
"numberOfDaysLastActivity": 0,
"ageFrom": 0,
"ageTo": 0,
"contactStage": "Subscriber",
"primaryLocations": [
{
"id": "string",
"title": "string"
}
]
},
"location": {
"id": "string"
}
}
]

POST /v1/segments​

POST /v1/segments
Headers
x-api-keystringrequired
Your Whautomate API key.
Body
idstring
namestringrequired
typestring (enum)required
One of: client, contact.
criteriaobject
locationobjectrequired
Response 200
idstring
namestringrequired
typestring (enum)required
One of: client, contact.
criteriaobject
locationobjectrequired
Request
curl -X POST "https://api.whautomate.com/v1/segments" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "string",
"name": "string",
"type": "client",
"criteria": {
"tags": [
"string"
],
"exclusionTags": [
"string"
],
"gender": "Male",
"numberOfDaysLastActivity": 0,
"ageFrom": 0,
"ageTo": 0,
"contactStage": "Subscriber",
"primaryLocations": [
{
"id": "string",
"title": "string"
}
]
},
"location": {
"id": "string"
}
}'
Response 200
{
"id": "string",
"name": "string",
"type": "client",
"criteria": {
"tags": [
"string"
],
"exclusionTags": [
"string"
],
"gender": "Male",
"numberOfDaysLastActivity": 0,
"ageFrom": 0,
"ageTo": 0,
"contactStage": "Subscriber",
"primaryLocations": [
{
"id": "string",
"title": "string"
}
]
},
"location": {
"id": "string"
}
}

GET /v1/segments/{segmentId}​

GET /v1/segments/{segmentId}
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
segmentIdstringrequired
Request
curl -X GET "https://api.whautomate.com/v1/segments/{segmentId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{}

DELETE /v1/segments/{segmentId}​

DEL /v1/segments/{segmentId}
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
segmentIdstringrequired
Response 200
successboolean
Request
curl -X DELETE "https://api.whautomate.com/v1/segments/{segmentId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"success": true
}