Passer au contenu principal
POST
/
whatsapp
/
groups
/
members
Gérer les membres
curl --request POST \
  --url https://api.wachap.com/v1/whatsapp/groups/members \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "groupJid": "<string>",
  "action": "add",
  "participants": [
    "<string>"
  ]
}
'

Endpoints

Option 1: GroupJid dans le body

POST https://api.wachap.com/v1/whatsapp/groups/members

Option 2: GroupJid dans l’URL (rétrocompatibilité)

POST https://api.wachap.com/v1/whatsapp/groups/:groupJid/members

Headers

ParamètreTypeRequisDescription
AuthorizationstringOuiBearer token avec votre Secret Key (format: Bearer sk_...)

Body Parameters (Option 1)

ParamètreTypeRequisDescription
accountIdstringOuiL’identifiant du compte WhatsApp
groupJidstringOuiL’identifiant du groupe (format: [email protected])
actionstringOuiAction à effectuer: add
participantsarrayOuiListe des numéros de téléphone au format international

Body Parameters (Option 2)

ParamètreTypeRequisDescription
accountIdstringOuiL’identifiant du compte WhatsApp
actionstringOuiAction à effectuer: add
participantsarrayOuiListe des numéros de téléphone au format international

Exemple de requête

Option 1: GroupJid dans le body

curl -X POST https://api.wachap.com/v1/whatsapp/groups/members \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer VOTRE_CLE_SECRETE" \
  -d '{
    "accountId": "account_xxx",
    "groupJid": "[email protected]",
    "action": "add",
    "participants": ["+33612345678", "+22962861571"]
  }'

Option 2: GroupJid dans l’URL

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

Exemple de réponse

{
  "success": true,
  "message": "Participants ajoutés avec succès",
  "action": "add",
  "groupJid": "[email protected]",
  "participants": [
    "[email protected]",
    "[email protected]"
  ]
}

Notes

  • Vous devez être administrateur du groupe pour ajouter des participants
  • Les numéros doivent être au format international (+33612345678)
  • Les participants reçoivent une notification d’ajout

Codes d’erreur

CodeDescription
400MISSING_ACCOUNT_ID - accountId manquant
400MISSING_GROUP_JID - groupJid manquant
400MISSING_ACTION - action manquante
400MISSING_PARTICIPANTS - participants manquant ou vide
401INVALID_SECRET_KEY - Clé secrète invalide
403NOT_ADMIN - Vous n’êtes pas administrateur du groupe
404ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé
404GROUP_NOT_FOUND - Groupe 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
groupJid
string
action
enum<string>

Action à effectuer

Options disponibles:
add,
remove,
promote,
demote
participants
string[]

Liste des numéros de téléphone (format international)

Réponse

200

OK