Send messages
Send to a WhatsApp group
Same endpoint as individual sends, but swap the to field with toGroup (digits only). The sender must already be a member of the group.
Endpoint
POST
/v1/messages/sendEach request must include either to OR toGroup, not both.
The toGroup format
The toGroup field is a digits-only string (optionally with one hyphen for legacy format). Shiftwa wraps it into a full JID (<digits>@g.us) at the gateway side.
{ "toGroup": "120363041234567890", "text": "Maintenance 22:00 WIB" }Finding the group ID
Easiest: in the dashboard Composer, pick 'Group' as the target, then sync the sender's joined groups. Detected groups are saved and selectable with one click.
- Composer → pick sender → tick 'Allow Shiftwa to read joined groups once'.
- Click 'Sync groups'. Wait ~5–60s depending on how many groups exist.
- Groups appear in the saved-groups dropdown. Copy the JID or use it directly in the composer.
Send-to-group examples
curl -X POST https://api.shiftwa.dev/v1/messages/send \
-H "X-API-Key: $SHIFTWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"toGroup": "120363041234567890",
"text": "Reminder: standup 09:00 WIB."
}'curl -X POST https://api.shiftwa.dev/v1/messages/send \
-H "X-API-Key: $SHIFTWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"toGroup": "120363041234567890",
"media": {
"storageKey": "users/.../media/.../q3-report.pdf",
"caption": "Q3 report — final."
}
}'Gotchas
- The sender must already be a group member. Shiftwa won't auto-join. If it isn't, the send fails downstream and shows status='failed' in the message log.
- Announce-only groups: only admins can post. If your sender isn't an admin, WhatsApp rejects the message.
- targetKind in the response is group for group sends and individual otherwise — handy for analytics.