attachment_id in a media or media part on a message with is_audio_message.
Upload
Send the raw bytes as the request body (up to 100 MB):201 Created:
A presigned two-step flow is tracked on API availability.
Send it
Reference the attachment in a part. Relay stores its download URL on the part so clients and history reads can render it directly. Text and media commit as separate messages: the send below commits a text message, then a media message. Contiguous media parts in one send stay together as one media message:"is_audio_message": true on the message for native inline playback. The uploaded attachment needs an audio/* content type. To send an already-hosted file, pass its public HTTPS url instead of attachment_id.
For a video uploaded with Content-Type: video/mp4, send the attachment ID:
Relay rejects a
media_kind that conflicts with a specific image/*,
video/*, or audio/* MIME type.
Media parts accept optional width and height in pixels, always together.
- Declare the pair when you know the size. Clients reserve the aspect ratio before the bytes download.
- Omit the pair on an uploaded
image/*attachment. Relay derives both from the stored bytes (PNG, JPEG, GIF, and WebP) and includes them on the delivered part.
Who can use an attachment
Attachments belong to their uploader.Check an upload
Only
available attachments can be sent.
Receiving media
Incomingmedia parts carry content_type, media_kind, and a capability url
you can download directly.
- Use
media_kindto pick the presentation. - Pass
content_typeto the media framework when the URL has no file extension. - Read
widthandheighton image parts, present when the sender declared them or Relay derived them at send time.

