WhatsApp

Send Media

Send a WhatsApp media message (image, document, audio, video, …) that references a file you have already uploaded with the Upload file endpoint. Pass the media_id returned by that upload.

Each entry sends one media message: set recipient_phone (and a sender, or rely on the stream default) for a new conversation, or conversation_uuid to reply into an existing one. message_content is stored with the message in the inbox but is not delivered as a caption.

Response. HTTP 200 with a task_id and one entry per message. status is false when any message failed: failed entries come first and carry error (hex code) and details; accepted entries carry message_uuid (and conversation_uuid on two-way channels). Match entries by internal_id. Final delivery status is sent asynchronously to your configured webhook.

Authentication: stream token in the Authorization header (see Authentication in the API Overview).

post/whatsapp/send_media

Request

  • Base URL
    https://api.commpeak.com/textpeak/streams
  • URL
    https://api.commpeak.com/textpeak/streams/whatsapp/send_media
  • Auth
    API key in header Authorization

Request body

senderstring nullable

Default WhatsApp Business sender phone number for every message.

Example request

{
  "messages": [
    {
      "media": {
        "media_id": "01d1e10f-9eb2-4543-a711-3707906010e2"
      },
      "contact": {
        "display_name": "John Doe",
        "email": "test@example.com",
        "external_id": "crm-1001",
        "first_name": "John",
        "last_name": "Doe",
        "phone": "12125551234"
      }
    }
  ]
}

Response

Successful Response

statusboolean required

true when every message was accepted; false when at least one failed. The HTTP status is 200 either way.

task_idstring required

Identifier of this request.

Example response

{
  "messages": [
    {
      "conversation_uuid": "e2a489db-bb8a-4f51-9692-726153599c57",
      "internal_id": "1001",
      "message_uuid": "a61e5bfe-c82b-448a-815b-32de8bf22089"
    }
  ],
  "status": true,
  "task_id": "ca550f7e-9eb5-45b3-9830-e82b407ede02"
}

Changes

No recorded changes to this operation across all 1 revision of this API.