Groups
Groups let you segment your contacts so you can send campaigns to a specific audience without manually listing every number.
Create a group
Section titled “Create a group”curl https://send.virgincareer.lk/api/v1/contacts/groups \ -H "Authorization: Bearer sk_your_key" \ -H "Content-Type: application/json" \ -d '{"name": "VIP Customers", "description": "High value customers"}'List groups
Section titled “List groups”curl https://send.virgincareer.lk/api/v1/contacts/groups/all \ -H "Authorization: Bearer sk_your_key"Add a contact to a group
Section titled “Add a contact to a group”Pass the groupId when creating or updating a contact:
curl https://send.virgincareer.lk/api/v1/contacts \ -H "Authorization: Bearer sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "phone": "+94771234567", "firstName": "Kasun", "groupId": "your-group-id" }'Send a campaign to a group
Section titled “Send a campaign to a group”When creating a campaign, pass the groupId instead of a recipients list:
curl https://send.virgincareer.lk/api/v1/campaigns \ -H "Authorization: Bearer sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "VIP Promo", "message": "Exclusive offer for our VIP customers!", "type": "instant", "groupId": "your-group-id" }'Delete a group
Section titled “Delete a group”Deleting a group does not delete the contacts inside it — they are simply unassigned.
curl -X DELETE \ https://send.virgincareer.lk/api/v1/contacts/groups/your-group-id \ -H "Authorization: Bearer sk_your_key"