Zum Hauptinhalt springen

Gruppen

Verwalten Sie WhatsApp-Gruppen ueber die Wappfy API. Sie koennen Gruppen erstellen, Teilnehmer verwalten, Einladungslinks handhaben und vieles mehr. Alle Gruppen-Endpunkte beziehen sich auf eine bestimmte Instanz:
/api/instances/{instanceId}/groups/...

Gruppe erstellen

Erstellen Sie eine neue WhatsApp-Gruppe mit ersten Teilnehmern.
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Project Alpha",
    "participants": [
      "[email protected]",
      "[email protected]"
    ]
  }'
Antwort:
{
  "data": {
    "group_id": "[email protected]",
    "name": "Project Alpha",
    "participants": [
      {
        "id": "[email protected]",
        "is_admin": false
      },
      {
        "id": "[email protected]",
        "is_admin": false
      }
    ]
  }
}

Gruppen auflisten

Rufen Sie alle Gruppen ab, in denen die Instanz Mitglied ist.
curl https://api.wappfy.io/api/instances/inst_abc123/groups \
  -H "X-Api-Key: YOUR_API_KEY"
Antwort:
{
  "data": [
    {
      "group_id": "[email protected]",
      "name": "Project Alpha",
      "participant_count": 5
    },
    {
      "group_id": "[email protected]",
      "name": "Support Team",
      "participant_count": 12
    }
  ]
}

Gruppeninformationen abrufen

Rufen Sie detaillierte Informationen zu einer bestimmten Gruppe ab.
curl https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected] \
  -H "X-Api-Key: YOUR_API_KEY"
Antwort:
{
  "data": {
    "group_id": "[email protected]",
    "name": "Project Alpha",
    "description": "Team workspace for Project Alpha",
    "owner": "[email protected]",
    "created_at": "2026-01-15T10:00:00Z",
    "participants": [
      {
        "id": "[email protected]",
        "is_admin": true,
        "is_super_admin": true
      },
      {
        "id": "[email protected]",
        "is_admin": false,
        "is_super_admin": false
      }
    ]
  }
}

Gruppe aktualisieren

Aktualisieren Sie den Gruppennamen oder die Beschreibung. Sie muessen Gruppenadmin sein, um diese Aktion durchzufuehren.
curl -X PATCH https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected] \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Project Alpha v2",
    "description": "Updated workspace for Project Alpha"
  }'
Nur Gruppenadmins koennen den Gruppennamen und die Beschreibung aktualisieren. Wenn die Instanz kein Admin ist, wird ein 403-Fehler zurueckgegeben.

Gruppe verlassen

Entfernen Sie die Instanz aus einer Gruppe.
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected]/leave \
  -H "X-Api-Key: YOUR_API_KEY"
Nach dem Verlassen einer Gruppe benoetigen Sie einen Einladungslink oder einen anderen Admin, der Sie wieder hinzufuegt.

Teilnehmer

Teilnehmer auflisten

Rufen Sie alle Teilnehmer einer Gruppe ab.
curl https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected]/participants \
  -H "X-Api-Key: YOUR_API_KEY"
Antwort:
{
  "data": [
    {
      "id": "[email protected]",
      "is_admin": true,
      "is_super_admin": true
    },
    {
      "id": "[email protected]",
      "is_admin": false,
      "is_super_admin": false
    },
    {
      "id": "[email protected]",
      "is_admin": true,
      "is_super_admin": false
    }
  ]
}

Teilnehmer hinzufuegen

Fuegen Sie einen oder mehrere Teilnehmer zu einer Gruppe hinzu. Sie muessen Gruppenadmin sein.
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected]/participants \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "participants": [
      "[email protected]",
      "[email protected]"
    ]
  }'

Teilnehmer entfernen

Entfernen Sie einen oder mehrere Teilnehmer aus einer Gruppe. Sie muessen Gruppenadmin sein.
curl -X DELETE https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected]/participants \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "participants": [
      "[email protected]"
    ]
  }'

Einladungscodes

Einladungscode abrufen

Erstellen oder rufen Sie den Einladungslink der Gruppe ab. Sie muessen Gruppenadmin sein.
curl https://api.wappfy.io/api/instances/inst_abc123/groups/[email protected]/invite-code \
  -H "X-Api-Key: YOUR_API_KEY"
Antwort:
{
  "data": {
    "invite_code": "https://chat.whatsapp.com/AbCdEfGhIjKlMn"
  }
}

Per Einladungscode beitreten

Treten Sie einer Gruppe ueber einen Einladungscode bei.
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/join \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "invite_code": "AbCdEfGhIjKlMn"
  }'
Uebergeben Sie nur den Code-Teil, nicht die vollstaendige URL. Fuer https://chat.whatsapp.com/AbCdEfGhIjKlMn uebergeben Sie AbCdEfGhIjKlMn.

Nachrichten an Gruppen senden

Um eine Nachricht an eine Gruppe zu senden, verwenden Sie den Standard-Endpunkt zum Nachrichten senden mit der Chat-ID der Gruppe:
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "[email protected]",
    "type": "text",
    "text": "Hello team!"
  }'
Gruppenchat-IDs enden immer mit @g.us.

Endpunkt-Referenz

MethodeEndpunktBeschreibung
POST/api/instances/{id}/groupsNeue Gruppe erstellen
GET/api/instances/{id}/groupsAlle Gruppen auflisten
GET/api/instances/{id}/groups/{groupId}Gruppeninformationen abrufen
PATCH/api/instances/{id}/groups/{groupId}Gruppenname/Beschreibung aktualisieren
POST/api/instances/{id}/groups/{groupId}/leaveGruppe verlassen
GET/api/instances/{id}/groups/{groupId}/participantsTeilnehmer auflisten
POST/api/instances/{id}/groups/{groupId}/participantsTeilnehmer hinzufuegen
DELETE/api/instances/{id}/groups/{groupId}/participantsTeilnehmer entfernen
GET/api/instances/{id}/groups/{groupId}/invite-codeEinladungscode abrufen
POST/api/instances/{id}/groups/joinPer Einladungscode beitreten

Fehlerbehandlung

StatuscodeBeschreibung
403Sie sind kein Admin dieser Gruppe.
404Gruppe nicht gefunden oder Instanz ist kein Mitglied.
409Teilnehmer ist bereits in der Gruppe (beim Hinzufuegen) oder nicht in der Gruppe (beim Entfernen).
422Ungueltiges Teilnehmerformat. Verwenden Sie {phone}@s.whatsapp.net.