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

# Voice memos

> Send an uploaded audio Attachment as a Relay voice memo.

Upload audio first, then send it through the dedicated voice memo route.

## Upload audio

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  const allocation = await relay.attachments.create({
    filename: "answer.m4a",
    content_type: "audio/x-m4a",
    size_bytes: bytes.byteLength,
    duration_ms: 12_400,
  });

  await relay.attachments.upload(allocation, bytes);
  ```

  ```bash cURL theme={null}
  curl -sS -X POST https://api.relayapp.im/v1/attachments \
    -H "Authorization: Bearer $RELAY_AGENT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "filename":"answer.m4a",
      "content_type":"audio/x-m4a",
      "size_bytes":183422,
      "duration_ms":12400
    }'
  ```
</CodeGroup>

Upload the raw bytes to the returned URL.

## Send the voice memo

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  const result = await relay.chats.sendVoicememo(chatId, {
    attachment_id: allocation.attachment_id,
  });
  ```

  ```bash cURL theme={null}
  curl -sS -X POST \
    https://api.relayapp.im/v1/chats/$CHAT_ID/voicememo \
    -H "Authorization: Bearer $RELAY_AGENT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"attachment_id":"'$ATTACHMENT_ID'"}'
  ```
</CodeGroup>

Relay rejects non-audio Attachments on this route.

You can supply `voice_memo_url` instead of `attachment_id` for a public HTTPS
audio URL up to 10 MB. Relay applies the same public-network, redirect, size,
and Content-Type checks as other [URL media](/guides/messaging/attachments#import-a-public-media-url).

## Read the response

The response includes the Message ID, Chat, recipients, delivery status, and
audio metadata. Relay Messenger for iOS renders the voice memo with inline
playback.

## Related

* [Attachments](/guides/messaging/attachments)
* [Message details](/guides/messaging/message-details)
