Send

single_simple_send

Send a single message in one request. The body is a flat object — ideal for transactional, one-off messages. For high volume, use simple_send to batch up to 250 messages per call.

Extras. On WhatsApp, actions turns the message into reply buttons, a link button or a list. check_duplication_time_window skips the send when the same sender already messaged the recipient within that many hours (up to 72).

Set an internal_id to correlate the message with delivery webhooks; it defaults to the recipient phone number.

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.

Whole-request errors. Invalid JSON field types return HTTP 200 with status: false, error_code 0x1 and no task_id. 402 (0x41) means the balance is depleted.

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

post/simple_send_single

Request

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

Request body

internal_idstring nullable

Your identifier for the message. Echoed back in the response and in delivery webhooks (internal_id). Up to 36 characters are kept; longer values are cut. Not checked for uniqueness. Defaults to the recipient phone number.

senderstring nullable

An alphanumeric sender ID or a phone number registered on the stream. Omit it to use the stream's default sender.

recipient_phonestring nullable

Recipient phone number in international format, as a string. +, spaces, - and parentheses are removed before validation. Not needed when conversation_uuid or contact.phone identifies the recipient.

message_contentstring required

The text body. With actions, the body of the interactive message.

conversation_uuidstring nullable

Continue an existing conversation: the sender and recipient are taken from it. Two-way channels only (WhatsApp, Telegram, two-way SMS); ignored on one-way SMS.

check_duplication_time_windowinteger nullable

Skip the send when this sender already messaged this recipient within the last N hours (content is not compared). At most 72. The skipped message is reported with error 0x19.

senders_poolstring[] nullable

Candidate senders, used only when no sender is set on the message, the request or the stream: a sender allowed for the destination is picked at random. When none is allowed, the whole request fails with 0x61.

schedule_tostring nullable

Send at this time instead of now (ISO 8601 date-time).

Example request

{
  "internal_id": "1001",
  "message_content": "Hi John, your CommPeak code is 4821.",
  "recipient_phone": "12125551234",
  "sender": "CommPeak"
}

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.