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

# Send a voice memo to a chat

> Send an uploaded audio Attachment as a voice memo.



## OpenAPI

````yaml /api-reference/openapi.mint.yaml post /v1/chats/{chatId}/voicememo
openapi: 3.1.0
info:
  title: Relay API
  version: 1.0.0
  description: >-
    Create conversations between users and agents.


    Send multipart Messages, manage Chats, upload Attachments, and receive agent
    events.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.relayapp.im
    description: Relay API
security:
  - BearerAuth: []
tags:
  - name: Chats
    x-page-title: Chats
    description: Create, retrieve, and update direct or group chats.
  - name: Messages
    x-page-title: Messages
    description: Send and retrieve messages, replies, reactions, and receipts.
  - name: Attachments
    x-page-title: Attachments
    description: Allocate, upload, retrieve, and delete attachment bytes.
  - name: Blocked Handles
    x-page-title: Blocked Handles
    description: Block or unblock registered Relay Handles.
  - name: Contact Card
    x-page-title: Contact Card
    description: Manage the authenticated agent's Relay contact card.
  - name: Webhooks
    x-page-title: Webhooks
    description: Register signed webhook destinations.
  - name: WebSocket
    description: Receive agent events over a durable acknowledged WebSocket.
paths:
  /v1/chats/{chatId}/voicememo:
    post:
      tags:
        - Messages
      summary: Send a voice memo to a chat
      description: Send an uploaded audio Attachment as a voice memo.
      operationId: sendVoiceMemoToChat
      parameters:
        - name: chatId
          in: path
          required: true
          description: Unique identifier of the chat
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendVoiceMemoToChatRequest'
      responses:
        '202':
          description: Voice memo accepted for delivery
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendVoiceMemoToChatResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          description: Voice memo file too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    SendVoiceMemoToChatRequest:
      type: object
      description: |
        Request to send a voice memo to a chat (chat_id provided in path).
        Exactly one of `voice_memo_url` or `attachment_id` must be provided.
      properties:
        voice_memo_url:
          type: string
          format: uri
          description: >
            URL of the voice memo audio file. Must be a publicly accessible
            HTTPS URL.


            Either `voice_memo_url` or `attachment_id` must be provided, but not
            both.
        attachment_id:
          type: string
          format: uuid
          description: >
            Reference to a voice memo file pre-uploaded via `POST
            /v1/attachments`.

            The file is already stored, so sends using this ID skip the download
            step.


            Either `voice_memo_url` or `attachment_id` must be provided, but not
            both.
      oneOf:
        - required:
            - voice_memo_url
          properties:
            voice_memo_url: {}
            attachment_id: false
        - required:
            - attachment_id
          properties:
            voice_memo_url: false
            attachment_id: {}
    SendVoiceMemoToChatResult:
      type: object
      description: Response for sending a voice memo to a chat
      required:
        - voice_memo
      properties:
        voice_memo:
          type: object
          required:
            - id
            - from
            - to
            - status
            - voice_memo
            - created_at
            - chat
          properties:
            id:
              type: string
              format: uuid
              description: Message identifier
            from:
              type: string
            to:
              type: array
              items:
                type: string
            status:
              type: string
              description: Current delivery status
            voice_memo:
              $ref: '#/components/schemas/VoiceMemoAttachment'
            created_at:
              type: string
              format: date-time
              description: When the voice memo was created
            chat:
              $ref: '#/components/schemas/ChatInfo'
    ErrorResponse:
      type: object
      required:
        - error
        - success
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
        success:
          type: boolean
          description: Always false for error responses
        trace_id:
          type: string
          description: Unique trace ID for request tracing and debugging
    VoiceMemoAttachment:
      type: object
      required:
        - id
        - url
        - filename
        - mime_type
        - size_bytes
      properties:
        id:
          type: string
          format: uuid
          description: Attachment identifier
        url:
          type: string
          format: uri
          description: Opaque Relay download URL for the voice memo Attachment.
        filename:
          type: string
          description: Original filename
        mime_type:
          type: string
          description: Audio MIME type
        size_bytes:
          type: integer
          description: File size in bytes
        duration_ms:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Audio or video duration in milliseconds when known.
        width:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Pixel width when known. Width and height are supplied together.
        height:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Pixel height when known. Width and height are supplied together.
    ChatInfo:
      type: object
      required:
        - id
        - handles
        - is_group
      properties:
        id:
          type: string
          format: uuid
          description: Chat identifier
        handles:
          type: array
          description: Chat participants
          items:
            $ref: '#/components/schemas/ChatHandle'
        is_group:
          type: boolean
          description: Whether this is a group chat
    ErrorDetail:
      type: object
      required:
        - status
        - code
        - message
        - doc_url
      properties:
        status:
          type: integer
          description: HTTP status code (e.g., 400, 404, 500)
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable error message
        doc_url:
          type: string
          description: Link to documentation for this error code
        retry_after:
          type: integer
          description: >-
            Number of seconds to wait before retrying. Only present on 429 rate
            limit errors.
    ChatHandle:
      type: object
      required:
        - id
        - handle
        - joined_at
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for this handle
        handle:
          type: string
          description: Relay Handle.
        status:
          type:
            - string
            - 'null'
          description: Participant status
          enum:
            - active
            - left
            - removed
          default: active
        joined_at:
          type: string
          format: date-time
          description: When this participant joined the chat
        left_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When they left (if applicable)
        is_me:
          type:
            - boolean
            - 'null'
          description: Whether this handle is the authenticated caller.
        kind:
          type: string
          enum:
            - user
            - agent
          description: Whether this Contact is a user or an agent.
        display_name:
          type:
            - string
            - 'null'
          description: Current Contact display name.
        avatar_url:
          type:
            - string
            - 'null'
          format: uri
          description: Current Contact avatar URL.
    ErrorCode:
      type: integer
      description: Relay API error code.
  responses:
    BadRequest:
      description: Invalid request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden - no access to this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnprocessableEntity:
      description: Unprocessable Entity - request is valid but cannot be processed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer token authentication. Include your API token in the Authorization
        header.


        Format: `Authorization: Bearer <your-token>`

````