Contact groups API
List, create, rename and delete the contact groups you use to organize contacts and target campaigns.
Groups sort your contacts into lists, such as "VIP customers" or "Weekend regulars", that you can send campaigns to. A contact can be in several groups. To put contacts in a group, send its uuid in the group field when you create or upsert a contact.
The group object#
{
"uuid": "9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d",
"name": "VIP customers",
"created_at": "2026-10-03T14:20:11.000000Z",
"updated_at": "2026-10-03T14:20:11.000000Z"
}Group dates are ISO 8601 in UTC. Other fields in the response are internal.
List groups#
https://app.zapgen.ae/api/contact-groupsReturns your groups, paginated.
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number, from 1. |
per_page | integer | No | Groups per page, 1–100. Default 10. |
curl "https://app.zapgen.ae/api/contact-groups?per_page=100" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"const res = await fetch('https://app.zapgen.ae/api/contact-groups?per_page=100', {
headers: { Authorization: 'Bearer YOUR_API_KEY', Accept: 'application/json' }
});
const { data: groups } = await res.json();$ch = curl_init('https://app.zapgen.ae/api/contact-groups?per_page=100');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Accept: application/json'],
]);
$groups = json_decode(curl_exec($ch), true)['data'];import requests
res = requests.get(
"https://app.zapgen.ae/api/contact-groups",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
params={"per_page": 100},
)
groups = res.json()["data"]{
"data": [
{
"uuid": "9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d",
"name": "VIP customers",
"created_at": "2026-10-03T14:20:11.000000Z",
"updated_at": "2026-10-03T14:20:11.000000Z"
}
],
"links": { "first": "…", "last": "…", "prev": null, "next": null },
"meta": { "current_page": 1, "last_page": 1, "per_page": 100, "total": 1 }
}The list has no fixed order. If you have more groups than fit on one page, ask for per_page=100 so they arrive in one go.
Create a group#
https://app.zapgen.ae/api/contact-groups| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The group name. Must be different from your other groups' names. |
curl -X POST https://app.zapgen.ae/api/contact-groups \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "name": "Weekend regulars" }'const res = await fetch('https://app.zapgen.ae/api/contact-groups', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json'
},
body: JSON.stringify({ name: 'Weekend regulars' })
});
const { id } = await res.json();$ch = curl_init('https://app.zapgen.ae/api/contact-groups');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['name' => 'Weekend regulars']),
]);
$groupUuid = json_decode(curl_exec($ch), true)['id'];import requests
res = requests.post(
"https://app.zapgen.ae/api/contact-groups",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
json={"name": "Weekend regulars"},
)
group_uuid = res.json()["id"]{
"statusCode": 200,
"id": "9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d",
"message": "Request processed successfully"
}id is the new group's uuid. A name you already use gives a 400 with "name": ["The name has already been taken."].
Rename a group#
https://app.zapgen.ae/api/contact-groups/{uuid}| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The new name. Must be different from your other groups' names. |
curl -X PUT https://app.zapgen.ae/api/contact-groups/9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "name": "VIP customers 2026" }'const uuid = '9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d';
await fetch(`https://app.zapgen.ae/api/contact-groups/${uuid}`, {
method: 'PUT',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json'
},
body: JSON.stringify({ name: 'VIP customers 2026' })
});$uuid = '9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d';
$ch = curl_init("https://app.zapgen.ae/api/contact-groups/$uuid");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['name' => 'VIP customers 2026']),
]);
$result = json_decode(curl_exec($ch), true);import requests
uuid = "9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d"
requests.put(
f"https://app.zapgen.ae/api/contact-groups/{uuid}",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
json={"name": "VIP customers 2026"},
)The response is the same as for creating a group. An unknown uuid returns 404 with Contact group not found.
Delete a group#
https://app.zapgen.ae/api/contact-groups/{uuid}Deletes the group. Its contacts aren't deleted: they're only taken out of the group.
curl -X DELETE https://app.zapgen.ae/api/contact-groups/9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"const uuid = '9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d';
await fetch(`https://app.zapgen.ae/api/contact-groups/${uuid}`, {
method: 'DELETE',
headers: { Authorization: 'Bearer YOUR_API_KEY', Accept: 'application/json' }
});$uuid = '9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d';
$ch = curl_init("https://app.zapgen.ae/api/contact-groups/$uuid");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Accept: application/json'],
]);
$result = json_decode(curl_exec($ch), true);import requests
uuid = "9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d"
requests.delete(
f"https://app.zapgen.ae/api/contact-groups/{uuid}",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
){
"statusCode": 200,
"id": "9a3c1e7b-5d2f-4b8a-9c6e-1f0d2b3a4c5d",
"message": "Request processed successfully"
}An unknown or already deleted uuid returns 404 with Contact group not found.
Errors#
| Status | When |
|---|---|
400 | name is missing or already used by another group. |
401 | The API key is missing or wrong. |
403 | Your subscription has ended. Creating and renaming stops; listing and deleting still work. |
404 | No group with that uuid in your organization. |
Group changes send group.created, group.updated and group.deleted webhooks.