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

# Envoie un texte, un modèle ou un média par WhatsApp



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/whatsapp/messages
openapi: 3.1.0
info:
  title: API DexNotify
  version: '1'
  description: >-
    SMS, e-mail, WhatsApp, notifications push, contacts et campagnes, par une
    seule API. Authentification par clé API dans l’en-tête `x-api-key`.
servers:
  - url: https://api.dexnotify.com
    description: Production et staging
security:
  - api-key: []
tags:
  - name: SMS
  - name: E-mail
  - name: WhatsApp
  - name: Contacts
  - name: Listes de contacts
  - name: Campagnes
  - name: Modèles e-mail
  - name: Automatisations
  - name: Notifications push
  - name: Campagnes push
  - name: Journal des messages
  - name: In-app
  - name: Live Activities
  - name: Utilisateurs et appareils
  - name: Segments
  - name: Modèles push
  - name: Événements
  - name: Statistiques
paths:
  /api/v1/whatsapp/messages:
    post:
      tags:
        - WhatsApp
      summary: Envoie un texte, un modèle ou un média par WhatsApp
      operationId: WhatsAppMessagesController_send_v1
      parameters:
        - name: idempotency-key
          in: header
          description: >-
            Rejoué avec la même clé, l’envoi rend le message déjà accepté, sans
            en créer un second.
          required: false
          schema:
            type: string
            minLength: 8
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      const: text
                    accountId:
                      type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    to:
                      type: string
                    body:
                      type: string
                      minLength: 1
                      maxLength: 4096
                  required:
                    - kind
                    - accountId
                    - to
                    - body
                - type: object
                  properties:
                    kind:
                      type: string
                      const: template
                    accountId:
                      type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    to:
                      type: string
                    name:
                      type: string
                      minLength: 1
                      maxLength: 512
                      pattern: ^[a-z0-9_]+$
                    language:
                      type: string
                      minLength: 2
                      maxLength: 16
                      pattern: ^[a-zA-Z]{2,3}(_[a-zA-Z]{2,4})?$
                    variables:
                      default: []
                      maxItems: 20
                      type: array
                      items:
                        type: string
                        maxLength: 1024
                  required:
                    - kind
                    - accountId
                    - to
                    - name
                    - language
                - type: object
                  properties:
                    kind:
                      type: string
                      const: media
                    accountId:
                      type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    to:
                      type: string
                    media:
                      type: string
                      enum:
                        - image
                        - video
                        - audio
                        - document
                    url:
                      type: string
                      maxLength: 2048
                      format: uri
                    fileName:
                      type: string
                      minLength: 1
                      maxLength: 255
                    body:
                      type: string
                      maxLength: 1024
                  required:
                    - kind
                    - accountId
                    - to
                    - media
                    - url
      responses:
        '201':
          description: L’envoi accepté, en file
        '400':
          description: Modèle non approuvé, ou variables incomplètes
        '404':
          description: Compte WhatsApp introuvable
        '422':
          description: 'Fenêtre de 24 h fermée : seul un modèle peut partir'
        '503':
          description: Compte déconnecté, ou canal non ouvert en production
      security:
        - api-key: []
components:
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Clé API du projet, créée dans le dashboard (Développeurs › Clés API et
        SDK). Une clé `dxn_prod_` vise la production, une clé `dxn_stag_` le
        staging.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.