Skip to main content

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 regionapi.whautomate.com

List segments​

GET /v1/segments

Lists segments.

Headers
x-api-keystringrequired
Your Whautomate API key.
Query parameters
locationIdstring
Location (workspace) id. Get ids from GET /v1/locations.
limitinteger
Results per page (default 10, max 100).
pageinteger
Page number, from 1 (default 1).
searchTextstring
Text to search for.
Response 200
idstring
namestringrequired
typestring (enum)required
One of: client, contact.
criteriaobject
locationobjectrequired
createdAtstring
When the record was created (ISO 8601, UTC).
updatedAtstring
When 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/segments

Creates a client or contact segment.

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
createdAtstring
When the record was created (ISO 8601, UTC).
updatedAtstring
When 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-keystringrequired
Your Whautomate API key.
Path parameters
segmentIdstringrequired
Response 200
idstring
Record id. Use it in the path of the other endpoints.
namestring
typestring
criteriaobject
locationobject
createdAtstring
When the record was created (ISO 8601, UTC).
updatedAtstring
When 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-keystringrequired
Your Whautomate API key.
Path parameters
segmentIdstringrequired
Response 200
successboolean
Request
curl -X DELETE "https://api.whautomate.com/v1/segments/gn7T7DreYQ" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"success": true
}