Segments
Segments are saved groups of clients or contacts, built from filters such as tags, channel or "receive updates on". Use a segment as the audience of a broadcast.
API region
api.whautomate.comList segments
GET
/v1/segmentsLists segments.
Headers
x-api-keystringrequiredYour Whautomate API key.
Query parameters
locationIdstringLocation (workspace) id. Get ids from GET /v1/locations.
limitintegerResults per page (default 10, max 100).
pageintegerPage number, from 1 (default 1).
searchTextstringText to search for.
Response 200
idstringnamestringrequiredtypestring (enum)requiredOne of:
client, contact.criteriaobjectlocationobjectrequiredcreatedAtstringWhen the record was created (ISO 8601, UTC).
updatedAtstringWhen the record was last changed (ISO 8601, UTC).
Request
curl -X GET "https://api.whautomate.com/v1/segments?locationId=Le6dWjQF9K&limit=3" \
-H "x-api-key: YOUR_API_KEY"
Response 200
[
{
"id": "KCeE8yNNiO",
"name": "All Clients",
"type": "client",
"criteria": {
"primaryLocations": [],
"tags": [],
"exclusionTags": []
},
"location": {
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
},
"createdAt": "2026-10-29T11:42:14.963Z",
"updatedAt": "2026-10-29T11:42:14.963Z"
},
{
"id": "YFrgny30zN",
"name": "All Male Clients",
"type": "client",
"criteria": {
"primaryLocations": [],
"gender": "Male",
"tags": [],
"exclusionTags": []
},
"location": {
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
},
"createdAt": "2026-10-29T11:42:15.011Z",
"updatedAt": "2026-10-29T11:42:15.011Z"
}
]
Create a segment
POST
/v1/segmentsCreates a client or contact segment.
Headers
x-api-keystringrequiredYour Whautomate API key.
Body
idstringnamestringrequiredtypestring (enum)requiredOne of:
client, contact.criteriaobjectlocationobjectrequiredResponse 200
idstringnamestringrequiredtypestring (enum)requiredOne of:
client, contact.criteriaobjectlocationobjectrequiredcreatedAtstringWhen the record was created (ISO 8601, UTC).
updatedAtstringWhen the record was last changed (ISO 8601, UTC).
Request
curl -X POST "https://api.whautomate.com/v1/segments" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Massage lovers",
"type": "client",
"location": {
"id": "Le6dWjQF9K"
},
"criteria": {
"tags": [
"Massage"
],
"exclusionTags": [
"Corporate"
],
"numberOfDaysLastActivity": 90
}
}'
Response 200
{
"id": "gn7T7DreYQ",
"name": "Massage lovers",
"type": "client",
"criteria": {
"primaryLocations": [],
"tags": [
"Massage"
],
"exclusionTags": [
"Corporate"
],
"numberOfDaysLastActivity": 90
},
"location": {
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
},
"createdAt": "2026-10-29T12:40:21.185Z",
"updatedAt": "2026-10-29T12:40:21.185Z"
}
Get a segment
GET
/v1/segments/{segmentId}Gets one segment by id.
Headers
x-api-keystringrequiredYour Whautomate API key.
Path parameters
segmentIdstringrequiredResponse 200
idstringRecord id. Use it in the path of the other endpoints.
namestringtypestringcriteriaobjectlocationobjectcreatedAtstringWhen the record was created (ISO 8601, UTC).
updatedAtstringWhen the record was last changed (ISO 8601, UTC).
Request
curl -X GET "https://api.whautomate.com/v1/segments/gn7T7DreYQ" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"id": "gn7T7DreYQ",
"name": "Massage lovers",
"type": "client",
"criteria": {
"primaryLocations": [],
"tags": [
"Massage"
],
"exclusionTags": [
"Corporate"
],
"numberOfDaysLastActivity": 90
},
"location": {
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
},
"createdAt": "2026-10-29T12:40:21.185Z",
"updatedAt": "2026-10-29T12:40:21.185Z"
}
Delete a segment
DEL
/v1/segments/{segmentId}Deletes a segment.
Headers
x-api-keystringrequiredYour Whautomate API key.
Path parameters
segmentIdstringrequiredResponse 200
successbooleanRequest
curl -X DELETE "https://api.whautomate.com/v1/segments/gn7T7DreYQ" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"success": true
}