Skip to content

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#

attachments[0]json
{  "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}
FieldTypeDescription
type"image" | "audio" | "video" | "document" | "sticker"image, audio, video, document or sticker.
urlURL | nullShort-lived download URL on the API host, valid until expires_at. null when the file is unavailable.
mime_typestring | nullMIME type reported by the provider.
size_bytesinteger | nullSize in bytes, when known.
filenamestring | nullOriginal file name, when the provider supplies one.
voicebooleantrue for a voice note recorded in the app, false for an audio file.
duration_secondsnumber | nullDuration of audio and video, when the provider supplies it.
transcriptstring | nullTranscript of a voice note when transcription is configured and enabled for the workspace; otherwise null.
expires_attimestamp | nullWhen url stops working (24 hours after the event at most).
unavailable_reason"too_large" | "expired" | "unsupported" | "fetch_failed" | nullWhy 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 at expires_at; after that the URL answers 410 Gone. It also answers 410 Gone as 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-Type and Content-Disposition. Download soon after the event and copy the file to your own storage if you need it later.

Treat attachment URLs as confidential

Anyone with the URL can download the file until it expires. Do not post it publicly or put it into prompts that leave your systems.

Unavailable files#

When a file cannot be offered, url is null and unavailable_reason says why. The rest of the message is still delivered.

unavailable_reasonMeaning
too_largeThe provider does not serve files this large (Telegram: over 20 MB).
expiredThe file is no longer available from the provider.
unsupportedThe provider sent a file Braidport cannot pass on.
fetch_failedCopying the file from the provider failed.

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:

documentjson
{  "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.