> ## 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 botones de acción

> Envía mensajes con botones de acción (abrir URL y llamar)

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 con botones de acción a un contacto. El campo `content.type` debe ser `INTERACTIVE_ACTION`.

Tipos de botón disponibles:

* **URL** — Abre un enlace al pulsarlo
* **CALL** — Llama a un número al pulsarlo

Los campos `header` y `footer` son opcionales.

<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-action.json POST /v1/channels/{channelId}/messages
openapi: 3.1.0
info:
  title: Omni Z-API - Enviar botones de acción
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/messages:
    post:
      tags:
        - Mensajes
      summary: Enviar botones de acción
      description: Envía un mensaje con botones de acción (URL o llamada).
      operationId: sendInteractiveActionMessage
      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/SendInteractiveActionRequest'
            examples:
              urlAndCall:
                summary: URL + Llamar
                value:
                  recipient:
                    identifier: '5511999999999'
                  content:
                    type: INTERACTIVE_ACTION
                    body:
                      message: Como podemos ajudar?
                    header:
                      message: Omni Z-API
                    footer:
                      message: Elige una opción
                    attachments:
                      - id: '1'
                        title: Visita nuestro sitio web
                        name: URL
                        url: https://www.omni.z-api.io
                      - id: '2'
                        title: Llámanos
                        name: CALL
                        phones:
                          - '5511999999999'
              urlOnly:
                summary: Solo URL
                value:
                  recipient:
                    identifier: '5511999999999'
                  content:
                    type: INTERACTIVE_ACTION
                    body:
                      message: Visita nuestro sitio web
                    attachments:
                      - id: '1'
                        title: Ir al sitio web
                        name: URL
                        url: https://www.omni.z-api.io
      responses:
        '200':
          $ref: '#/components/responses/MessageSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    SendInteractiveActionRequest:
      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_ACTION
            body:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                  description: Texto principal del mensaje
            header:
              type: object
              properties:
                message:
                  type: string
                  description: Título del mensaje
            footer:
              type: object
              properties:
                message:
                  type: string
                  description: Pie del mensaje
            attachments:
              type: array
              description: Lista de botones de acción
              items:
                type: object
                required:
                  - id
                  - title
                  - name
                properties:
                  id:
                    type: string
                    description: Identificador del botón
                  title:
                    type: string
                    description: Texto que se muestra en el botón
                  name:
                    type: string
                    description: Tipo de botón
                    enum:
                      - URL
                      - CALL
                  url:
                    type: string
                    description: URL para los botones de tipo URL
                  phones:
                    type: array
                    description: Teléfono para los botones de tipo CALL
                    items:
                      type: string
    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

````