> ## Documentation Index
> Fetch the complete documentation index at: https://dev.wachap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modifier la description

> Modifiez la description d'un groupe WhatsApp.

## Endpoint

```http theme={null}
POST https://api.wachap.com/v1/whatsapp/groups/update/description
```

## Headers

| Paramètre     | Type   | Requis | Description                                                  |
| :------------ | :----- | :----- | :----------------------------------------------------------- |
| Authorization | string | Oui    | Bearer token avec votre Secret Key (format: `Bearer sk_...`) |

## Body Parameters

| Paramètre   | Type   | Requis | Description                                                 |
| :---------- | :----- | :----- | :---------------------------------------------------------- |
| accountId   | string | Oui    | L'identifiant du compte WhatsApp                            |
| groupJid    | string | Oui    | L'identifiant du groupe (format: `120363123456789012@g.us`) |
| description | string | Oui    | La nouvelle description du groupe (max 512 caractères)      |

## Exemple de requête

```bash theme={null}
curl -X POST https://api.wachap.com/v1/whatsapp/groups/update/description \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer token" \
  -d '{
    "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
    "groupJid": "120363123456789012@g.us",
    "description": "Nouvelle description du groupe"
  }'
```

## Exemple de réponse

```json theme={null}
{
  "success": true,
  "message": "Description du groupe modifiée avec succès",
  "groupJid": "120363123456789012@g.us",
  "newDescription": "Nouvelle description du groupe"
}
```

## Notes

* Vous devez être administrateur du groupe pour modifier la description
* La description ne peut pas dépasser 512 caractères

## Codes d'erreur

| Code | Description                                                    |
| :--- | :------------------------------------------------------------- |
| 400  | `MISSING_ACCOUNT_ID` - accountId manquant                      |
| 400  | `MISSING_GROUP_JID` - groupJid manquant                        |
| 400  | `DESCRIPTION_TOO_LONG` - La description dépasse 512 caractères |
| 401  | `INVALID_SECRET_KEY` - Clé secrète invalide                    |
| 403  | `NOT_ADMIN` - Vous n'êtes pas administrateur du groupe         |
| 404  | `ACCOUNT_NOT_FOUND` - Compte WhatsApp non trouvé               |


## OpenAPI

````yaml POST /whatsapp/groups/update/description
openapi: 3.0.3
info:
  title: WaChap API
  version: 2.0.0
servers:
  - url: https://api.wachap.com/v1
    description: WaChap API server
security:
  - BearerAuth: []
tags:
  - name: Instances
    description: Créer et gérer des instances WhatsApp
  - name: Webhook
    description: Configuration des webhooks de réception
  - name: Messages
    description: Envoyer des messages WhatsApp
  - name: Comptes
    description: Gérer vos comptes WhatsApp connectés
  - name: SMS
    description: Service SMS de WaChap (V4) via FCM
  - name: Étiquettes WhatsApp
    description: Créer et associer des étiquettes aux conversations WhatsApp
paths:
  /whatsapp/groups/update/description:
    post:
      tags:
        - Groupes WhatsApp
      summary: Modifier la description
      description: Mettre à jour la description du groupe.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountId:
                  type: string
                groupJid:
                  type: string
                description:
                  type: string
                  description: Nouvelle description (max 512 char)
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  newDescription:
                    type: string
      x-codeSamples:
        - lang: curl
          label: BASH
          source: >
            curl -X POST
            "https://api.wachap.com/v1/whatsapp/groups/update/description" \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer token" \
              -d '{
                "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
                "groupJid": "120363123456789012@g.us",
                "description": "New Description"
              }'
        - lang: javascript
          label: JavaScript
          source: >
            const res = await
            fetch("https://api.wachap.com/v1/whatsapp/groups/update/description",
            {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json',
                'Authorization': 'Bearer token'
              },
              body: JSON.stringify({
                accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
                groupJid: "120363123456789012@g.us",
                description: "New Description"
              })
            });

            const data = await res.json();

            console.log(data);
        - lang: python
          label: Python
          source: |
            import requests
            url = "https://api.wachap.com/v1/whatsapp/groups/update/description"
            headers = {
                "Content-Type": "application/json",
                "Authorization": "Bearer token"
            }
            data = {
                "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
                "groupJid": "120363123456789012@g.us",
                "description": "New Description"
            }
            response = requests.post(url, json=data, headers=headers)
            print(response.json())
        - lang: php
          label: PHP
          source: >
            <?php

            $url =
            'https://api.wachap.com/v1/whatsapp/groups/update/description';

            $data = [
                'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
                'groupJid' => '120363123456789012@g.us',
                'description' => 'New Description'
            ];

            $ch = curl_init($url);

            curl_setopt($ch, CURLOPT_POST, 1);

            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Content-Type: application/json',
                'Authorization: Bearer token'
            ]);

            $response = curl_exec($ch);

            curl_close($ch);

            echo $response;

            ?>
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````