Skip to main content

List Contact Groups

Retrieve a paginated list of contact groups in your account.

GET /api/v1/groups/

Query parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number
limitnumberNo20Groups per page (max 100)
searchstringNoSearch by group name or description

Example request

curl -X GET "https://server.waplify.io/api/v1/groups/?page=1&limit=20" \
-H "Authorization: Bearer wapl_your_api_key"

Example response

{
"status": "success",
"groups": [
{
"id": "507f1f77bcf86cd799439050",
"name": "VIP Customers",
"description": "High-value customers",
"tags": ["vip"],
"contact_count": 42,
"created_at": "2024-06-15T10:00:00Z"
}
],
"total": 1,
"page": 1,
"limit": 20
}

Create Contact Group

Create a new contact group. Group names must be unique within your account.

POST /api/v1/groups/

Request body

FieldTypeRequiredDescription
namestringYesGroup name (must be unique)
descriptionstringNoGroup description
tagsarrayNoList of tags
contact_idsarrayNoContact IDs to add to the group immediately
waba_phone_idstringNoWhatsApp Business Account phone ID

Example request

curl -X POST https://server.waplify.io/api/v1/groups/ \
-H "Authorization: Bearer wapl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP Customers",
"description": "High-value customers",
"tags": ["vip"],
"contact_ids": ["507f1f77bcf86cd799439012", "507f1f77bcf86cd799439013"]
}'

Success response (201 Created)

{
"status": "success",
"message": "Contact group created successfully",
"group": {
"id": "507f1f77bcf86cd799439050",
"name": "VIP Customers",
"description": "High-value customers",
"tags": ["vip"],
"contact_count": 2,
"created_at": "2024-06-15T10:00:00Z"
}
}