Objects used by the endpoints and events above. Fields marked “required” are always present; nullable fields are present with null.
MessageContent
{"type": T, T: {...}}. Types: text, image, video, audio, document, sticker, location, contacts, interactive, interactive_reply, template, reaction, unsupported, system. Media of both directions carries media: {id, mime_type, size, sha256, filename, state, failure_reason}: id is UPPU's media id (GET /media/{id}/content), size and sha256 stay null until the file is stored (state pending -> ready). A media object whose id is null belongs to an old inbound message stored before UPPU kept its files (WhatsApp, Messenger and Instagram messages from before UPPU kept media files): it stays pending, never becomes ready and cannot be downloaded, so do not poll for it. Messenger and Instagram (added within v1): a message's type is the type of its first media attachment, whatever attachment comes before it (a link preview, a location, a template, a shared post, a reel or a story mention followed by a photo is an image message). A message with several media attachments carries attachments: [{type, media}] next to media, every media attachment (image, video, audio, document, sticker) in Meta's order (the first is the same file as media; the key is absent when there is at most one media attachment). Other attachment types (location, link previews, templates, shared posts, reels, story mentions) are not listed and have no file; the preview text counts every attachment. A message without a media attachment takes the type of its first attachment: a shared post or reel (unsupported) carries the preview's file as unsupported.media when Meta gave one; an Instagram story mention has no file (Meta does not allow storing story content). On Messenger and Instagram a caption reaches the person as a separate text message after the file. Meta's attachment links are never exposed.
MessageContent: Fields| Field | Type | Description |
|---|
typerequired | string | |
|---|
Other keys may appear: read the ones you know and ignore the rest.
OutboundContent
{"type": T, T: {...}}. Web chat channels take text only. Limits come from the channel's capabilities (GET /channels; Meta's limits are not verified). Media (image, video, audio, document) takes exactly one of media_id (POST /media) or an https link that UPPU downloads before sending; contacts and stickers come in v1.1 (422 content_not_supported_on_channel).
One of:
TextContent
InteractiveContent
ReactionContent
LocationContent
TemplateContent
MediaContent
MediaContent
An image, video, audio or document: {"type": "document", "document": {"media_id": "…", "filename": "…", "caption": "…"}}. Give exactly one of media_id (an upload of the same channel, within reusable_until) or link (https on port 443, public addresses only, no redirects, at most the type's size, 15 seconds; a failure ends as failed with media_fetch_failed). Audio has no caption; only a document has a filename. The type's MIME types and sizes are those of POST /media for the channel's type. WhatsApp, Messenger and Instagram channels send media (see capabilities.content_types; Instagram only while UPPU's Instagram outbound media is on, otherwise 422 content_not_supported_on_channel); Instagram has no document (422 content_not_supported_on_channel), web chat no media at all. On Messenger and Instagram the caption is sent as a separate text message right after the file (it has the channel's text limit: Messenger 2000 characters, Instagram 1000 bytes), and Meta shows a document under the name it was uploaded with (the upload's file name, or filename with a link); one message, one status. If the file was accepted but the caption could not be sent, the message stays accepted.