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.
| Method | Details |
|---|---|
| Stream Token | Pass your token directly in the Authorization header value (not as a Bearer token). |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | The stream token that verifies your access to the API. |
Content-Type | Yes | Must 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.
| Field | Type | Required | Description |
|---|---|---|---|
messages | array | Yes | An array of message objects to send. Each object represents a single media message within a conversation. |
Message Object
| Field | Type | Required | Description |
|---|---|---|---|
message_content | string | No | A text caption to accompany the media file (e.g., "Here is your image"). Can be left empty if no caption is needed. |
conversation_uuid | string | Yes | The UUID of the WhatsApp conversation to send the media message to (e.g., "01d1e10f-9eb2-4543-a711-3707906010e2"). |
media | object | Yes | An object containing the reference to the uploaded media file. |
Media Object
| Field | Type | Required | Description |
|---|---|---|---|
media_id | string | Yes | The 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.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||