💬 Shared WhatsApp Inbox on the new PlatformMore
1msg official logo

Create a WhatsApp group via API (groups endpoint)

This scenario uses the groups API with a create operation to provision a named WhatsApp group for team broadcasts.

Use case overview

This scenario uses the groups API with a create operation to provision a named WhatsApp group for team broadcasts. No 24-hour session window is required because the call is a channel management action.

Template example

Internal group created for sales broadcast — share the invite link with your team.

WhatsApp Business API for team broadcast — create whatsapp group

When to use it

Reach for this when sales or marketing needs a dedicated WhatsApp group for internal broadcast and campaign coordination, and creating groups by hand in the Business app does not scale across channels or automation. It fits developers wiring CRM or admin triggers, small teams standing up a named broadcast channel, and agencies provisioning client campaign groups without manual admin steps.

No manual Business app setup
groups create sets the group name and internal broadcast description on an admin or CRM trigger, so the broadcast channel exists before anyone creates it by hand in the Business app.
Managers join from a stored invite link
The create response returns group metadata including the invite URL, which your backend stores and shares with authorized team members, so onboarding does not depend on one admin forwarding a link from their phone.
Repeatable provisioning across channels
The same workflow calls groups create on each team-setup event, so integrators stand up named broadcast groups across 1MSG channels without repeating manual admin steps per account.
Setup outside the 24-hour window
Group creation is a channel management API call, not a session message, so provisioning does not require an open customer conversation or template approval for the setup step itself.

Workflow

  1. Trigger

    An admin or CRM event triggers team group provisioning.

    event · triggered

  2. Capture event

    groups create sets the group name and internal broadcast description.

    POST /groups

  3. Build & send

    The API returns group metadata including the invite link.

    POST /groups

  4. Delivered

    Your system shares the invite URL with authorised team members.

    delivered

WhatsApp Business API for team broadcast — create whatsapp group

Technical implementation

Prerequisites

  1. 1MSG API Key · How to get API Key
  2. WhatsApp Business account · How to Connect WABA
  3. Open 24-hour session window · How the 24-hour window works
  4. Customer opt-in · How to Manage Customers Consent

Code examples

#!/usr/bin/env bash
set -euo pipefail

# === Configuration (replace "___" placeholders) ===
API_BASE_URL="https://api.1msg.io"        # production 1MSG API base URL
CHANNEL_ID="___"                           # channel ID from 1MSG dashboard
API_TOKEN="___"                            # channel JWT token (Bearer)



URL="${API_BASE_URL%/}/${CHANNEL_ID}/groups"

read -r -d '' PAYLOAD <<JSON || true
{
  "groupName": "Sales team Q1",
  "description": "Internal broadcast"
}
JSON

RESPONSE="$(curl -s -w '\n%{http_code}' -X POST "$URL" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -d "$PAYLOAD")"

HTTP_CODE="$(printf '%s' "$RESPONSE" | tail -n1)"
BODY="$(printf '%s' "$RESPONSE" | sed '$d')"

case "$BODY" in
  *'"created":true'*) ok=1 ;;
  *) ok=0 ;;
esac

if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ] && [ "$ok" -eq 1 ]; then
  echo "$BODY"
else
  echo "$BODY" >&2
  exit 1
fi

Response and delivery status

HTTP 2xx and JSON "created": true mean the group exists. Save chatID — you send messages to the group with it.

200 OKResponse
{
  "created": true,
  "chatID": "[email protected]",
  "invite_link": "https://chat.whatsapp.com/<LINK_ID>"
}
  • created

    true when the group was created

  • chatID

    Send messages to the group with this id

  • invite_link

    Link participants use to join

Delivery statuses and webhooks →

Common errors

StatusAPI responseCauseFix
401token is requiredThe request has no token.Add your channel token as the token query parameter: https://api.1msg.io/{channelId}/{method}?token=…
429too many requests. please try laterThe channel is over its send rate.Queue messages on your side and retry with exponential backoff.
403access deniedThe token is wrong, or belongs to a different channel than the URL.Check that the token and the channelId in the URL belong to the same channel.

All error codes →

Common questions

Related

Build for WhatsApp in hours
without infrastructure hassle