> ## 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 (llamar, URL, respuesta rápida)

export const ZapiResponseText = ({lang = 'pt'}) => ({
  pt: 'A estrutura de resposta é idêntica à da Z-API. Seu código existente que processa esses retornos continuará funcionando sem alterações.',
  en: 'The response structure is identical to Z-API. Your existing code that processes these returns will continue working without changes.',
  es: 'La estructura de la respuesta es idéntica a la de Z-API. El código que ya tienes para procesar esas respuestas seguirá funcionando sin cambios.'
})[lang];

## Conceptos

Método para enviar mensajes con botones de acción. Hay tres tipos de botón:

* **CALL** — Botón para llamar a un número
* **URL** — Botón para abrir un enlace
* **REPLY** — Botón de respuesta rápida

<Warning>
  No combines los tres tipos de botón en el mismo mensaje. Envía los botones de **CALL + URL** juntos y los de **REPLY** por separado. Combinarlos todos provoca un error en WhatsApp Web.
</Warning>

<Tip>
  Para los botones de copiar código, usa el formato de URL: `https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code=SU_CODIGO`
</Tip>

<Note>
  <ZapiResponseText lang="es" />
</Note>


## OpenAPI

````yaml es/z-api/openapi.json POST /send-button-actions
openapi: 3.1.0
info:
  title: Omni Z-API - Compatibilidad con Z-API
  description: API compatible con Z-API para facilitar la migración a Omni Z-API
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io/channels/{channel_id}/token/{channel_token}
    variables:
      channel_id:
        description: ID del canal (equivalente al instance_id de Z-API)
        default: SU_CANAL
      channel_token:
        description: Token del canal (equivalente al token de Z-API)
        default: SU_TOKEN
security:
  - bearerAuth: []
paths:
  /send-button-actions:
    post:
      tags:
        - Mensajes
      summary: Enviar botones de acción
      description: >-
        Envía un mensaje de texto con botones de acción (llamar, abrir una URL o
        respuesta rápida).
      operationId: sendButtonActions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendButtonActionsRequest'
            examples:
              callAndUrl:
                summary: Botones de llamada y de URL
                value:
                  phone: '5511999999999'
                  message: ¡Hola! ¿Cómo podemos ayudarte?
                  title: Omni Z-API
                  footer: Elige una opción
                  buttonActions:
                    - id: '1'
                      type: CALL
                      phone: '5511999999999'
                      label: Fale conosco
                    - id: '2'
                      type: URL
                      url: https://www.omni.z-api.io
                      label: Visita nuestro sitio web
              reply:
                summary: Botón de respuesta rápida
                value:
                  phone: '5511999999999'
                  message: Precisa de ajuda?
                  buttonActions:
                    - id: '3'
                      type: REPLY
                      label: Falar com atendente
      responses:
        '200':
          $ref: '#/components/responses/MessageSuccess'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
components:
  schemas:
    SendButtonActionsRequest:
      type: object
      required:
        - phone
        - message
        - buttonActions
      properties:
        phone:
          type: string
          description: Teléfono del destinatario (código de país + prefijo + número)
          example: '5511999999999'
        message:
          type: string
          description: Texto del mensaje
        title:
          type: string
          description: Título del mensaje
        footer:
          type: string
          description: Pie del mensaje
        buttonActions:
          type: array
          description: Lista de botones de acción
          items:
            type: object
            required:
              - type
              - label
            properties:
              id:
                type: string
                description: Identificador del botón
              type:
                type: string
                description: Tipo de botón
                enum:
                  - CALL
                  - URL
                  - REPLY
              label:
                type: string
                description: Texto que se muestra en el botón
              phone:
                type: string
                description: Teléfono para los botones de tipo CALL
              url:
                type: string
                description: >-
                  URL para los botones de tipo URL (debe empezar por http:// o
                  https://)
        delayMessage:
          type: integer
          description: Retardo en segundos antes del envío (1-15)
          minimum: 1
          maximum: 15
    MessageResponse:
      type: object
      properties:
        zaapId:
          type: string
          description: Identificador interno
        messageId:
          type: string
          description: ID del mensaje en WhatsApp
        id:
          type: string
          description: El mismo valor que messageId (compatibilidad)
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Código del error
        message:
          type: string
          description: Descripción del error
  responses:
    MessageSuccess:
      description: Mensaje enviado correctamente
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            zaapId: 3999984263738042930CD6ECDE9VDWSA
            messageId: D241XXXX732339502B68
            id: D241XXXX732339502B68
    MethodNotAllowed:
      description: Método no permitido. Comprueba que estés usando POST.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 405
            message: Method not allowed
    UnsupportedMediaType:
      description: 'Content-Type no válido. Envía `Content-Type: application/json`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 415
            message: Unsupported media type
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generada en el panel de Seguridad de Omni Z-API

````