Segments

Segments are groups of contacts used for targeting broadcasts and workflow triggers. A contact can belong to multiple segments.

Create a segment

POST
/v1/segments

Create a new segment.

Request body

ParameterTypeDescription
namerequiredstringDisplay name for the segment.
cURL
curl -X POST https://api.txtly.com.au/v1/segments \
  -H "Authorization: Bearer tx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "VIP Customers"}'
Response — 201 Created
{
  "id": "seg_abc123",
  "name": "VIP Customers",
  "contact_count": 0,
  "created_at": "2026-03-21T00:00:00Z"
}

List segments

GET
/v1/segments

List all segments for the current team.

Get a segment

GET
/v1/segments/{id}

Retrieve a segment by ID, including the current contact count.

Update a segment

PATCH
/v1/segments/{id}

Update the segment name.

Delete a segment

DELETE
/v1/segments/{id}

Delete a segment. Contacts in the segment are not deleted.