Passer au contenu principal
POST
/
whatsapp
/
groups
Créer un groupe
curl --request POST \
  --url https://api.wachap.com/v1/whatsapp/groups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "groupName": "<string>",
  "participants": [
    "<string>"
  ]
}
'

Créer un groupe

Créez un nouveau groupe WhatsApp et ajoutez-y immédiatement des participants.

Endpoint

/v1/whatsapp/groups

Headers

Authorization
string
requis
Bearer token avec votre Secret Key (format: Bearer sk_...)

Body Parameters

accountId
string
requis
L’identifiant du compte WhatsApp
groupName
string
requis
Le nom du groupe à créer
participants
array
requis
Liste des numéros de téléphone des participants (format international)

Exemples de requêtes

curl -X POST https://api.wachap.com/v1/whatsapp/groups \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer VOTRE_CLE_SECRETE" \
  -d '{
    "accountId": "account_xxx",
    "groupName": "Mon Nouveau Groupe",
    "participants": ["+33612345678", "+22962861571"]
  }'

Exemple de réponse

{
  "success": true,
  "message": "Groupe créé avec succès",
  "group": {
    "jid": "[email protected]",
    "name": "Mon Nouveau Groupe",
    "owner": "[email protected]",
    "creation": 1702000000,
    "participants": [
      "[email protected]",
      "[email protected]"
    ]
  }
}

Notes importantes

  • Les participants doivent être des numéros au format international.
  • Vous serez automatiquement ajouté comme administrateur du groupe.
  • Minimum 1 participant requis (en plus de vous).

Codes d’erreur

CodeDescription
400MISSING_ACCOUNT_ID, MISSING_GROUP_NAME, MISSING_PARTICIPANTS
401INVALID_SECRET_KEY - Clé secrète invalide
404ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corps

application/json
accountId
string
groupName
string
participants
string[]

Réponse

200

OK