Groups

Organise contacts into targetable segments. Campaigns are sent to one or more groups.

A group is a named segment of contacts. Create groups, then add or remove members by phone number. All endpoints require the groups scope.

List groups

GET/api/v1/groups
curl -X GET "https://timisha-solutions-api.salamu.co.ke/api/v1/groups" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Create a group

POST/api/v1/groups
Parameters
namereq
string

Group name (unique per team)

description
string

Optional description

curl -X POST "https://timisha-solutions-api.salamu.co.ke/api/v1/groups" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "VIP Customers",
  "description": "High-value segment"
}'

Get a group

GET/api/v1/groups/{uuid}
curl -X GET "https://timisha-solutions-api.salamu.co.ke/api/v1/groups/grp-uuid" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Update a group

PUT/api/v1/groups/{uuid}

Same fields as create.

curl -X PUT "https://timisha-solutions-api.salamu.co.ke/api/v1/groups/grp-uuid" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "VIP Customers",
  "description": "Top 100 accounts"
}'

Delete a group

DELETE/api/v1/groups/{uuid}
curl -X DELETE "https://timisha-solutions-api.salamu.co.ke/api/v1/groups/grp-uuid" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Manage group members

List, add, and remove the contacts that belong to a group.

List members

GET/api/v1/groups/{uuid}/contacts
curl -X GET "https://timisha-solutions-api.salamu.co.ke/api/v1/groups/grp-uuid/contacts" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Add a member

POST/api/v1/groups/{uuid}/contacts
Parameters
phonereq
string

Phone number of the contact to add, in E.164 format

curl -X POST "https://timisha-solutions-api.salamu.co.ke/api/v1/groups/grp-uuid/contacts" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+254712345678"
}'

Remove a member

DELETE/api/v1/groups/{uuid}/contacts/{contactUUID}
curl -X DELETE "https://timisha-solutions-api.salamu.co.ke/api/v1/groups/grp-uuid/contacts/contact-uuid" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
200: OK
{
  "success": true,
  "data": {
    "uuid": "grp-uuid",
    "name": "VIP Customers",
    "contact_count": 128
  }
}

Sending to a group

Groups become the audience of a campaign. Add opt-outs to the Blacklist so they are skipped automatically on every send.