> ## 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 une étiquette

> Modifiez le nom ou la couleur d’une étiquette WhatsApp

### Endpoint

<ParamField method="PATCH" path="/v1/whatsapp/labels/:labelId" />

### Paramètres

<ParamField path="labelId" type="string" required>
  Identifiant de l’étiquette à modifier.
</ParamField>

<ParamField body="accountId" type="string" required>
  Identifiant du compte WhatsApp.
</ParamField>

<ParamField body="name" type="string">
  Nouveau nom. Le nom existant est conservé si ce champ est omis.
</ParamField>

<ParamField body="color" type="integer">
  Nouvelle couleur. La couleur existante est conservée si ce champ est omis.
</ParamField>

### Exemple

```bash theme={null}
curl -X PATCH https://api.wachap.com/v1/whatsapp/labels/label_vip \
  -H "Authorization: Bearer token" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "account_123",
    "name": "Clients VIP",
    "color": 2
  }'
```

Une étiquette inexistante ou déjà supprimée retourne `404 LABEL_NOT_FOUND`.


## OpenAPI

````yaml PATCH /whatsapp/labels/{labelId}
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/labels/{labelId}:
    patch:
      tags:
        - Étiquettes WhatsApp
      summary: Modifier une étiquette WhatsApp
      operationId: updateWhatsAppLabel
      parameters:
        - name: labelId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - accountId
              properties:
                accountId:
                  type: string
                name:
                  type: string
                color:
                  type: integer
      responses:
        '200':
          description: Étiquette mise à jour
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  label:
                    $ref: '#/components/schemas/WhatsAppLabel'
        '404':
          description: LABEL_NOT_FOUND
components:
  schemas:
    WhatsAppLabel:
      type: object
      properties:
        id:
          type: string
        userId:
          type: string
        accountId:
          type: string
        labelId:
          type: string
        name:
          type: string
        color:
          type: integer
        deleted:
          type: boolean
        createdAt:
          type: string
        updatedAt:
          type: string
        syncedAt:
          type: string
        fromSync:
          type: boolean
        source:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````