> ## Documentation Index
> Fetch the complete documentation index at: https://developer.omni.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Enviar texto con botones

> Envía mensajes de texto con botones de respuesta rápida

export const ChannelSupport = ({whatsapp = 'yes', web = 'yes', instagram = 'yes', messenger = 'yes', telegram = 'yes', lang = 'pt'}) => {
  const L = ({
    pt: {
      title: 'Disponibilidade por canal',
      win: 'No WhatsApp Oficial exige a janela de 24 horas aberta. Nos outros canais não há janela.',
      names: ['WhatsApp Oficial', 'WhatsApp Web', 'Instagram', 'Messenger', 'Telegram']
    },
    en: {
      title: 'Availability per channel',
      win: 'On WhatsApp Official it requires the 24-hour window to be open. The other channels have no window.',
      names: ['WhatsApp Official', 'WhatsApp Web', 'Instagram', 'Messenger', 'Telegram']
    },
    es: {
      title: 'Disponibilidad por canal',
      win: 'En WhatsApp Oficial exige que la ventana de 24 horas esté abierta. Los demás canales no tienen ventana.',
      names: ['WhatsApp Oficial', 'WhatsApp Web', 'Instagram', 'Messenger', 'Telegram']
    }
  })[lang];
  const mark = v => v === 'yes' ? '✅' : v === 'partial' ? '⚠️' : '❌';
  const vals = [whatsapp, web, instagram, messenger, telegram];
  return <div>
      <p><strong>{L.title}</strong></p>
      <table>
        <thead>
          <tr>{L.names.map(n => <th key={n} style={{
    textAlign: 'center'
  }}>{n}</th>)}</tr>
        </thead>
        <tbody>
          <tr>{vals.map((v, i) => <td key={i} style={{
    textAlign: 'center'
  }}>{mark(v)}</td>)}</tr>
        </tbody>
      </table>
      {whatsapp === 'yes' && <p>{L.win}</p>}
    </div>;
};

## Conceptos

Envía un mensaje de texto con botones de respuesta rápida. El campo `content.type` debe ser `INTERACTIVE_BUTTON`. El destinatario puede elegir entre las opciones que se le presentan.

Opcionalmente puedes incluir una **imagen** o un **vídeo** junto con el mensaje usando los campos `thumbnail` y `mimeType` dentro de `body`.

<ChannelSupport lang="es" />

<Note>
  Detalles de la regla de WhatsApp Oficial en [ventana de conversación](/es/conversation-window). Consulta la [matriz de capacidades](/es/channels/overview) para todos los canales.
</Note>


## OpenAPI

````yaml es/messages/openapi-interactive-button.json POST /v1/channels/{channelId}/messages
openapi: 3.1.0
info:
  title: Omni Z-API - Enviar texto con botones
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/messages:
    post:
      tags:
        - Mensajes
      summary: Enviar texto con botones
      description: Envía un mensaje de texto con botones de respuesta rápida.
      operationId: sendInteractiveButtonMessage
      parameters:
        - name: channelId
          in: path
          required: true
          description: ID del canal
          schema:
            type: string
            example: SU_CHANNEL_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendInteractiveButtonRequest'
            examples:
              text:
                summary: Texto con botones
                value:
                  recipient:
                    identifier: '5511999999999'
                  content:
                    type: INTERACTIVE_BUTTON
                    body:
                      message: ¿Cómo valoras nuestra atención?
                    attachments:
                      - id: '1'
                        title: Excelente
                      - id: '2'
                        title: Bueno
                      - id: '3'
                        title: Regular
              withImage:
                summary: Con imagen
                value:
                  recipient:
                    identifier: '5511999999999'
                  content:
                    type: INTERACTIVE_BUTTON
                    body:
                      message: ¡Mira nuestra oferta!
                      thumbnail: https://ejemplo.com/imagen.jpg
                      mimeType: image/jpeg
                    attachments:
                      - id: '1'
                        title: Me interesa
                      - id: '2'
                        title: No, gracias
              withVideo:
                summary: Con vídeo
                value:
                  recipient:
                    identifier: '5511999999999'
                  content:
                    type: INTERACTIVE_BUTTON
                    body:
                      message: Míralo y elige
                      thumbnail: https://ejemplo.com/video.mp4
                      mimeType: video/mp4
                    attachments:
                      - id: '1'
                        title: Opción A
                      - id: '2'
                        title: Opción B
      responses:
        '200':
          $ref: '#/components/responses/MessageSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    SendInteractiveButtonRequest:
      type: object
      required:
        - recipient
        - content
      properties:
        recipient:
          type: object
          required:
            - identifier
          properties:
            identifier:
              type: string
              description: Teléfono del destinatario (código de país + prefijo + número)
              example: '5511999999999'
        content:
          type: object
          required:
            - type
            - body
            - attachments
          properties:
            type:
              type: string
              description: Tipo de mensaje
              enum:
                - INTERACTIVE_BUTTON
            body:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                  description: Texto del mensaje
                thumbnail:
                  type: string
                  description: URL de una imagen o un vídeo (opcional)
                  nullable: true
                mimeType:
                  type: string
                  description: >-
                    Tipo de archivo del thumbnail (p. ej.: image/jpeg,
                    video/mp4)
            attachments:
              type: array
              description: Lista de botones de respuesta rápida (máximo 3)
              items:
                type: object
                required:
                  - id
                  - title
                properties:
                  id:
                    type: string
                    description: Identificador del botón
                  title:
                    type: string
                    description: Texto que se muestra en el botón
    MessageResponse:
      type: object
      properties:
        messageId:
          type: string
          description: ID del mensaje enviado
    Error:
      type: object
      properties:
        error:
          type: integer
        message:
          type: string
  responses:
    MessageSuccess:
      description: Mensaje enviado correctamente
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            messageId: wamid.HBgNNTU0NDk3MDUwNzg1FQIAERgSM0
    Unauthorized:
      description: Token no válido o ausente.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 401
            message: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generada en el panel de Seguridad de Omni Z-API

````