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

# Agent - Send WhatsApp Template

Envía un mensaje de WhatsApp usando un template pre-aprobado por Meta. Requiere que el agente (o su organización) tenga una integración de WhatsApp configurada.

### Ejemplo

```bash theme={null}
curl -X POST https://app.braviloai.com/api/v2/agents/${agentId}/send-template \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "5491122334455",
"templateName": "hello_world",
"languageCode": "es",
"components": [
"type": "body",
"parameters": [{"type": "text", "text": "Juan"}]
]
}'
```


## OpenAPI

````yaml POST /v2/agents/{agentId}/send-template
openapi: 3.0.1
info:
  title: Bravilo AI.ai - API OpenAPI specifications
  description: ''
  termsOfService: http://braviloai.com/terms
  contact:
    email: support@braviloai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://app.braviloai.com/api
security:
  - bearerAuth: []
tags:
  - name: agents
  - name: datastores
  - name: datasources
paths:
  /v2/agents/{agentId}/send-template:
    post:
      tags:
        - agents
      summary: Envía un mensaje de WhatsApp template vía API v2
      parameters:
        - in: path
          name: agentId
          schema:
            type: string
          required: true
          description: ID del agente
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phoneNumber:
                  type: string
                  description: Número de destino con código de país
                templateName:
                  type: string
                  description: Nombre exacto del template aprobado en Meta
                languageCode:
                  type: string
                  default: es
                  description: Código de idioma del template
                components:
                  type: array
                  items:
                    type: object
                  description: Componentes del template (header, body, buttons)
              required:
                - phoneNumber
                - templateName
      responses:
        '200':
          description: Template enviado exitosamente
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  conversationId:
                    type: string
        '400':
          description: No hay integración de WhatsApp configurada
        '404':
          description: Agente no encontrado
        '500':
          description: Error al enviar el template a Meta
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````