groups:write| Parameter | Type | Description |
|---|---|---|
id | integer | Required. The group ID to add contacts to |
| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
contact_ids | array | Yes | min:1, each must be integer and exist in contacts table | Array of contact IDs to add |
group_id JSON array is updated to include this group IDcontacts_added)| Field | Type | Description |
|---|---|---|
group_id | integer | The group ID |
contacts_added | integer | Number of contacts newly added (excludes already-in-group) |
| Status | Code | Description |
|---|---|---|
| 404 | NOT_FOUND | Group not found |
| 422 | VALIDATION_ERROR | Validation failed (missing contact_ids, invalid IDs, contacts not belonging to tenant) |
| 500 | INTERNAL_ERROR | Failed to add contacts to group |
| Field | Message |
|---|---|
contact_ids | Contact IDs are required / Contact IDs must be an array |
contact_ids.* | One or more contact IDs do not exist |
curl --location --request POST '/groups/1/contacts' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"contact_ids": [
123,
124,
125
]
}'{}