Contact groups
Manage the contact groups your campaigns target. List them and keep memberships in sync from your own system.
List groups
GEThttps://api.mobilesasa.com/v1/groups/
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"
curl "https://api.mobilesasa.com/v1/groups/" \
-H "Authorization: Bearer $MOBILESASA_TOKEN"Response
{
"status": true,
"responseCode": "0200",
"groups": [
{ "uuid": "6f9d1c2e-…", "name": "Members. Nairobi", "total_contacts": 4812 },
{ "uuid": "a41b7f90-…", "name": "Staff", "total_contacts": 148 }
]
}Add a contact to a group
POSThttps://api.mobilesasa.com/v1/groups/{uuid}/add-contact
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | The contact's number. |
| firstName | string | No | Used by campaign personalisation placeholders. |
| lastName | string | No | Ditto. |
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"
curl -X POST https://api.mobilesasa.com/v1/groups/6f9d1c2e-…/add-contact \
-H "Authorization: Bearer $MOBILESASA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "0712345678",
"firstName": "Amina",
"lastName": "Odhiambo"
}'Remove a contact from a group
DELETEhttps://api.mobilesasa.com/v1/groups/{uuid}/remove-contact
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"
curl -X DELETE https://api.mobilesasa.com/v1/groups/6f9d1c2e-…/remove-contact \
-H "Authorization: Bearer $MOBILESASA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "0712345678"
}'Exporting a group
To get a group's members out — for a printer, a field team or an auditor — request an export rather than paging the list. It runs asynchronously and emails a download link when the file is ready.
POST/api/v1/exports
Request
{
"export_type": "group_contacts",
"filters": { "group_uuid": "9f2a1c44-8e21-4c0b-9c3d-2b7a4e5f6a01" }
}The CSV carries msisdn, first_name, last_name, email, network and added_at. Requires team:exports:request.
Typical integration
Sync group membership from your source of truth: when a member joins or leaves in your system, mirror it with add/remove calls. Campaigns sent from the portal (or by recurring reminders) then always target a current list, no CSV exports, no stale data.