Receive
Media
Photos, voice notes, videos and documents arrive as attachments with a download URL that works for 24 hours at most. Braidport keeps no media library: download what you need to keep.
On this page
Attachments#
{ "type": "audio", "url": "https://api.braidport.com/media/v1.k1.Zm9vYmFy", "mime_type": "audio/ogg", "size_bytes": 18233, "filename": null, "voice": true, "duration_seconds": 7, "transcript": null, "expires_at": "2026-11-11T19:21:04.000Z", "unavailable_reason": null}| Field | Type | Description |
|---|---|---|
type | "image" | "audio" | "video" | "document" | "sticker" | image, audio, video, document or sticker. |
url | URL | null | Short-lived download URL on the API host, valid until expires_at. null when the file is unavailable. |
mime_type | string | null | MIME type reported by the provider. |
size_bytes | integer | null | Size in bytes, when known. |
filename | string | null | Original file name, when the provider supplies one. |
voice | boolean | true for a voice note recorded in the app, false for an audio file. |
duration_seconds | number | null | Duration of audio and video, when the provider supplies it. |
transcript | string | null | Transcript of a voice note when transcription is configured and enabled for the workspace; otherwise null. |
expires_at | timestamp | null | When url stops working (24 hours after the event at most). |
unavailable_reason | "too_large" | "expired" | "unsupported" | "fetch_failed" | null | Why url is null: too_large, expired, unsupported or fetch_failed. |
audio_url on the message repeats the URL of the first audio attachment, which is convenient for voice-first agents.
Download URLs#
- Attachment URLs point at the API host (
/media/<token>). The token is encrypted and expires atexpires_at; after that the URL answers410 Gone. It also answers410 Goneas soon as its channel is disconnected or disabled, or its workspace is deleted. - WhatsApp and Telegram files are streamed from the provider when you download them; nothing is stored. Instagram and Messenger links expire within minutes at the provider, so Braidport copies those files once, encrypted, into a temporary store that is purged after 24 hours.
- The response sets
Content-TypeandContent-Disposition. Download soon after the event and copy the file to your own storage if you need it later.
Voice note transcripts#
When transcription is available and the workspace setting transcribe_audio is on, voice notes and audio files up to 25 MB carry a transcript. Transcription is best effort: it is tried once with a 15-second limit, and on any failure transcript is null while the event is delivered as usual. The transcription provider is announced on the sub-processors page before transcription becomes available.
Sending media#
To send a file, give a public media.url. The API downloads it, checks size and type against the channel's limits (25 MB at most on any channel), and uploads it to the provider:
{ "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8", "type": "document", "media": { "url": "https://example.com/price-list.pdf", "filename": "Price list.pdf" }}media_fetch_failed: the URL could not be downloaded. It must be public, reachable from the internet and return the file itself (no login page, no redirect).media_too_large: the file exceeds the channel's limit. Send a smaller file or a link.media_invalid: the channel does not accept this file type.- A voice note (
"voice": true) that is not OGG/Opus is sent as a normal audio file.
These checks happen before anything is sent, so a failed request sent nothing.