When Titan receives a WhatsApp message containing media (images, video, audio, documents, stickers), it records the media reference in a media object and delivers the media ID in the webhook event payload. You use the media ID to download the file, retrieve its metadata, or persist it to your own S3-compatible bucket. Media files on WhatsApp’s CDN expire after approximately 14 days. Persist important files to your own storage using the persist endpoint.Documentation Index
Fetch the complete documentation index at: https://docs.usetitan.app/llms.txt
Use this file to discover all available pages before exploring further.
The
mediaId appears in message.received webhook events for messages of type image, video, audio, document, and sticker. Store it from the webhook payload so you can fetch or persist the media later.Media object
Unique media identifier.
ID of the WhatsApp message that contained this media.
Session where the media was received.
MIME type of the media file (e.g.
image/jpeg, video/mp4).Size of the media file in bytes.
Whether the media has been saved to S3.
S3 URL of the persisted file. Present only when
persisted is true.Get media metadata
GET /api/sessions/{session}/media/{mediaId}
Returns metadata for a media record without downloading the file.
Session name.
Media ID from a webhook event payload.
Download media
POST /api/sessions/{session}/media/{mediaId}/download
Downloads the raw media file from WhatsApp’s CDN, decrypts it, and returns the binary content. The response Content-Type header reflects the media’s MIME type.
Alternatively, the endpoint may return a 302 redirect to the media URL if your configuration uses direct streaming. In that case, follow the redirect to fetch the file.
Session name.
Media ID from a webhook event payload.
Media files on WhatsApp’s CDN expire after approximately 14 days. Download or persist media promptly after receiving the webhook event.
Persist media to S3
POST /api/sessions/{session}/media/{mediaId}/persist
Downloads the media from WhatsApp, decrypts it, and uploads it to your configured S3-compatible bucket. You must configure your S3 credentials in your account settings before using this endpoint.
Session name.
Media ID from a webhook event payload.
Public or presigned URL of the uploaded object in your S3 bucket.
S3 object key (path within the bucket).
Name of the S3 bucket where the file was stored.
Size of the uploaded file in bytes.
MIME type of the uploaded file.
Auto-persist mode
Instead of manually persisting each media file, you can enable auto-persist in your account settings. When enabled, Titan automatically saves all incoming media to your S3 bucket as it arrives. Themessage.received webhook payload will include a mediaUrl field with the S3 URL instead of requiring a separate persist call.