Send Media

Description

Summary: Sends one or more media messages through a WhatsApp conversation via the TextPeak Streams API.
Details: This endpoint delivers media content (such as images, documents, or other files) to recipients within an existing WhatsApp conversation. Each message in the request references a previously uploaded media file by its media_id and is associated with a specific conversation via conversation_uuid. An optional text caption can accompany the media using the message_content field. This is typically used after uploading a file through the upload endpoint, allowing you to attach and send that media within a WhatsApp stream. Authentication is performed via a stream token passed in the Authorization header.

Authentication & Scopes

Authentication is handled via a stream token provided in the Authorization header. No OAuth scopes are defined; access is granted or denied based on the validity of the token.

MethodDetails
Stream TokenPass your token directly in the Authorization header value (not as a Bearer token).

Headers

HeaderRequiredDescription
AuthorizationYesThe stream token that verifies your access to the API.
Content-TypeYesMust be set to application/json. The API only accepts JSON-formatted request bodies.

Parameters

This endpoint does not use path or query parameters.

Request Body

The request body is a JSON object containing an array of messages to send.

FieldTypeRequiredDescription
messagesarrayYesAn array of message objects to send. Each object represents a single media message within a conversation.

Message Object

FieldTypeRequiredDescription
message_contentstringNoA text caption to accompany the media file (e.g., "Here is your image"). Can be left empty if no caption is needed.
conversation_uuidstringYesThe UUID of the WhatsApp conversation to send the media message to (e.g., "01d1e10f-9eb2-4543-a711-3707906010e2").
mediaobjectYesAn object containing the reference to the uploaded media file.

Media Object

FieldTypeRequiredDescription
media_idstringYesThe UUID of the previously uploaded media file to attach and send (e.g., "01d1e10f-9eb2-4543-a711-3707906010e2"). This ID is obtained from the upload file endpoint response.

Examples

This endpoint has a saved example demonstrating usage:

  • Send Media — Sending a media message with a text caption to a WhatsApp conversation.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
messages
array of objects
messages
Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json