Skip to content

Send Media Message

Facebook

Facebook

Send Media Message

Send a Messenger media message (image, video, audio, or file) from a Page to a user, either from a public URL or an uploaded file. Subject to the 24-hour messaging window.

Action

Inputs

Name Type Required Description
page_iddropdownRequiredThe Facebook Page to send the message from.
recipient_idtextRequiredThe recipient's Page-scoped ID (PSID).
media_typeselectRequiredThe kind of media to send. (options: Image, Video, Audio, File)
urltextOptionalPublicly accessible URL of the media to send. Provide this OR a file.
filesfilesOptionalUploaded media files to send. Provide this OR a url. Each file should match the selected media type; one message is sent per file.
messaging_typeselectOptionalMessaging type: RESPONSE (default), UPDATE, or MESSAGE_TAG. (options: Response, Update, Message Tag)
sender_actiontextOptionalOptional sender action, e.g. mark_seen, typing_on, typing_off.

Outputs

Name Type Description
statusCodenumberHTTP status code from the Graph API response. For multi-file sends, the last success status or the first failure status.
bodyobjectGraph API response. For file sends, mirrors the last successful response or the first failure; use results for per-file outcomes.
recipient_idtextThe recipient PSID.
message_idtextThe id of the sent message.
attachment_idtextThe reusable attachment id, when returned.
resultsarray of objectOne ordered outcome per uploaded file when sending via files. Includes earlier successes even if a later send fails.
filenametextFilename of the sent media.
statusCodenumberHTTP status code from the Graph API for this file.
bodyobjectGraph API response for this file, when available. Nested fields include: recipient_id, message_id, attachment_id.
errortextError message when this file send failed.