> ## 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 enlace

> Envía mensajes con vista previa de enlace por WhatsApp

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 vista previa de enlace, incluyendo imagen, título y descripción.

<Warning>
  Los enlaces solo son pulsables si el destinatario tiene tu número guardado en su agenda o si ha iniciado una conversación contigo anteriormente.
</Warning>

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


## OpenAPI

````yaml es/z-api/openapi.json POST /send-link
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-link:
    post:
      tags:
        - Mensajes
      summary: Enviar enlace
      description: >-
        Envía un mensaje con vista previa de enlace (imagen, título y
        descripción).
      operationId: sendLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendLinkRequest'
            example:
              phone: '5511999999999'
              message: 'Visita nuestro sitio web: https://www.omni.z-api.io'
              image: https://www.omni.z-api.io/logo.png
              linkUrl: https://www.omni.z-api.io
              title: Omni Z-API
              linkDescription: API omnicanal para la comunicación empresarial
      responses:
        '200':
          $ref: '#/components/responses/MessageSuccess'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
components:
  schemas:
    SendLinkRequest:
      type: object
      required:
        - phone
        - message
        - image
        - linkUrl
        - title
        - linkDescription
      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. Debe incluir la URL del enlace al final
        image:
          type: string
          description: URL de la imagen de vista previa del enlace
        linkUrl:
          type: string
          description: URL del enlace
        title:
          type: string
          description: Título del enlace
        linkDescription:
          type: string
          description: Descripción del enlace
        linkType:
          type: string
          description: 'Tamaño de la vista previa: SMALL, MEDIUM o LARGE'
          enum:
            - SMALL
            - MEDIUM
            - LARGE
          default: SMALL
        delayMessage:
          type: integer
          description: Retardo en segundos antes del envío (1-15)
          minimum: 1
          maximum: 15
        delayTyping:
          type: integer
          description: Tiempo en segundos mostrando el estado «escribiendo» (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

````