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

# Enviar áudio

> Envie mensagens de áudio

## Conceituação

Envia uma mensagem de áudio para um contato. O campo `content.type` deve ser `AUDIO` e o áudio é enviado via URL no array `attachments`.

<Note>
  Este endpoint só funciona quando a [janela de conversa](/conversation-window) de 24 horas estiver aberta.
</Note>


## OpenAPI

````yaml pt/messages/openapi-audio.json POST /v1/channels/{channelId}/messages
openapi: 3.1.0
info:
  title: Hub Message - Enviar Áudio
  version: 1.0.0
servers:
  - url: https://api.hubmessage.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/messages:
    post:
      tags:
        - Mensagens
      summary: Enviar áudio
      description: Envia uma mensagem de áudio.
      operationId: sendAudioMessage
      parameters:
        - name: channelId
          in: path
          required: true
          description: ID do canal
          schema:
            type: string
            example: SEU_CHANNEL_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendAudioRequest'
            example:
              recipient:
                identifier: '5511999999999'
              content:
                type: AUDIO
                attachments:
                  - url: >-
                      https://actions.google.com/sounds/v1/alarms/digital_watch_alarm_long.ogg
      responses:
        '200':
          $ref: '#/components/responses/MessageSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    SendAudioRequest:
      type: object
      required:
        - recipient
        - content
      properties:
        recipient:
          type: object
          required:
            - identifier
          properties:
            identifier:
              type: string
              description: Telefone do destinatário (DDI + DDD + número)
              example: '5511999999999'
        content:
          type: object
          required:
            - type
            - attachments
          properties:
            type:
              type: string
              description: Tipo da mensagem
              enum:
                - AUDIO
            attachments:
              type: array
              description: Lista de anexos
              items:
                type: object
                required:
                  - url
                properties:
                  url:
                    type: string
                    description: URL do áudio
    MessageResponse:
      type: object
      properties:
        messageId:
          type: string
          description: ID da mensagem enviada
    Error:
      type: object
      properties:
        error:
          type: integer
        message:
          type: string
  responses:
    MessageSuccess:
      description: Mensagem enviada com sucesso
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            messageId: wamid.HBgNNTU0NDk3MDUwNzg1FQIAERgSM0
    Unauthorized:
      description: Token inválido ou ausente.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 401
            message: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key gerada no painel de Segurança do Hub Message

````