Send

event_send

Trigger a saved event template for one or more recipients, on SMS or WhatsApp streams. Identify the template with event (its eventKey) and pass each recipient's values in template_variables.

Defaults and overrides. Set sender and event once at the top level, on every recipient, or both: a recipient's own value wins. For WhatsApp Business templates with header or button variables, use WhatsApp template.

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/event_send

Request

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

Request body

senderstring nullable

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

eventstring nullable

Default template: an eventKey from Stream event templates. An unknown key fails the whole request.

message_templatestring nullable

Inline template text instead of event, with [name] or {name} placeholders. Used only when event is not set.

conversation_infoobject nullable

Metadata stored on new conversations (inbox).

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

{
  "recipients": [
    {
      "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.