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 region
api.whautomate.comGET /v1/segments
GET
/v1/segmentsHeaders
x-api-keystringrequiredYour Whautomate API key.
Query parameters
locationIdstringlimitstringpagestringsearchTextstringResponse 200
idstringnamestringrequiredtypestring (enum)requiredOne of:
client, contact.criteriaobjectlocationobjectrequiredRequest
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/segmentsHeaders
x-api-keystringrequiredYour Whautomate API key.
Body
idstringnamestringrequiredtypestring (enum)requiredOne of:
client, contact.criteriaobjectlocationobjectrequiredResponse 200
idstringnamestringrequiredtypestring (enum)requiredOne of:
client, contact.criteriaobjectlocationobjectrequiredRequest
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-keystringrequiredYour Whautomate API key.
Path parameters
segmentIdstringrequiredRequest
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-keystringrequiredYour Whautomate API key.
Path parameters
segmentIdstringrequiredResponse 200
successbooleanRequest
curl -X DELETE "https://api.whautomate.com/v1/segments/{segmentId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"success": true
}