TheDocumentation Index
Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
Use this file to discover all available pages before exploring further.
media resource handles the lifecycle of every file you send or receive. Uploaded media gets a mediaId you reference from messages.send; inbound media arrives as a mediaId you resolve to a signed URL.
Upload
file accepts a Buffer or Uint8Array — stream the file yourself if it doesn’t fit in memory.
UploadOptions
UploadOptions
| Option | Type | Description |
|---|---|---|
file | Buffer | Uint8Array | |
filename | string | |
mimeType | string |
mediaId only long enough to use it — WhatsApp expires uploaded media after ~30 days.
Get URL
Resolve an inboundmediaId to a signed, time-limited URL plus metadata:
MediaUrlResult
MediaUrlResult
| Field | Type | Description |
|---|---|---|
fileSize | number | |
mimeType | string | |
sha256 | string | |
url | string |
Authorization header when you fetch it.
Delete
Supported MIME types
WhatsApp restricts which types are accepted per content category. The SDK passes whatever you give it — validation happens server-side.| Category | Common types |
|---|---|
| Image | image/jpeg, image/png |
| Video | video/mp4, video/3gpp |
| Audio | audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg (voice notes only) |
| Document | Any MIME — PDFs, spreadsheets, archives |
| Sticker | image/webp |