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

# Audio

> O endpoint `/message/audio` é utilizado para enviar uma mensagem contendo um arquivo de áudio para um número de telefone especificado. Além do conteúdo do áudio, você pode adicionar opções como atraso no envio, tempo de digitação simulado, prioridade, tags, e metadados adicionais.

***

### Notas

Certifique-se de que o número do destinatário esteja no formato internacional (E.164). O tempo de atraso e a simulação de digitação são úteis para criar uma experiência mais natural de envio de mensagens, especialmente em aplicações onde o realismo na comunicação é importante.

## Atenção!

Recomendamos fortemente que você utilize as opções de `delay` ou `typing` ao enviar múltiplas mensagens em sequência. O envio de mensagens em grande volume sem essas configurações pode resultar no bloqueio temporário ou permanente de sua conta no WhatsApp. Use essas opções para garantir uma experiência mais natural e segura na plataforma.


## OpenAPI

````yaml POST /message/audio
openapi: 3.0.1
info:
  title: Interacto API
  description: API for Interacto messaging platform
  version: 1.0.0
servers:
  - url: https://api.interacto.io
security:
  - apiKeyAuth: []
paths:
  /message/audio:
    post:
      summary: Send an audio message
      description: Sends an audio message to a specified recipient
      parameters:
        - in: header
          name: Instance-Id
          required: true
          schema:
            type: string
          description: Unique identifier for the instance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewAudioMessage'
      responses:
        '201':
          description: Message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 201
                  message:
                    type: string
                    example: request successful
                  data:
                    $ref: '#/components/schemas/AudioMessageResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKeyAuth: []
components:
  schemas:
    NewAudioMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          required:
            - media
          properties:
            media:
              $ref: '#/components/schemas/AudioMessageInfo'
    AudioMessageResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the sent message
          example: 66b3c041eac929f51c6f160f
        instanceId:
          type: string
          description: Unique identifier for the instance that sent the message
          example: 66a09db606fd14660c8fc1d0
        to:
          type: string
          description: Recipient's phone number in E.164 format
          example: '551198888888'
        midia:
          type: object
          description: Content of the message
          properties:
            url:
              type: string
              description: Audio URL of the message
              example: https://example.com/audio.mp3
        status:
          type: string
          description: Status of the message sending process
          enum:
            - QUEUED
            - sent
            - delivered
            - read
            - failed
        sended:
          type: boolean
          description: Indicates whether the message has been successfully sent
        priority:
          type: integer
          description: Priority level of the message
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the message was created or processed
        metadata:
          type: object
          description: Additional metadata related to the message
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    BaseMessage:
      type: object
      required:
        - to
      properties:
        to:
          type: string
          description: O número de telefone do destinatário no formato E.164.
          example: '551198888888'
        delay:
          type: number
          description: Tempo de atraso em segundos antes do envio da mensagem.
          maximum: 5
          example: 2
        typing:
          type: number
          description: Tempo em segundos para simular a digitação da mensagem.
          maximum: 15
          example: 8
        priority:
          type: number
          description: >-
            Nível de prioridade da mensagem, representado como um número
            inteiro.
          maximum: 15
          example: 2
        tags:
          type: array
          description: Tags para categorização da mensagem.
          items:
            type: string
          example:
            - urgent
            - lead
        metadata:
          type: object
          description: ' Metadados adicionais que podem ser utilizados na sua aplicação.'
          example:
            leadId: '1234533'
    AudioMessageInfo:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: URL of the audio file
          example: https://example.com/audio.mp3
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
      description: API Key needed to access the endpoints

````