Stream-Events

Create stream event template

Changed on

Create a reusable event template. name, streamId, text and eventKey are required; trigger it later by passing eventKey as event on the send endpoints.

On SMS streams, every [placeholder] in text becomes a template variable, filled from template_variables when you send.

Authentication: TextPeak API key in the Authorization header (see Authentication in the API Overview).

post/stream_events

Request

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

Request body

namestring required

Template name. Must not be blank.

streamIdinteger required

ID of the stream to attach this template to.

textstring required

Template body with [placeholder] tokens. On SMS streams each placeholder becomes a template variable.

eventKeystring required

Key used to trigger this template on the send endpoints (event). Must not be blank.

activatedboolean nullable

Whether the template is active.

Example request

{
  "activated": true,
  "eventKey": "verification_code",
  "name": "Verification code",
  "streamId": 5,
  "text": "Your CommPeak code is [code]"
}

Response

Successful Response

idinteger required

Unique template identifier.

namestring required

Template name.

textstring required

Template body with [placeholder] tokens. 4-byte characters (emoji) are removed on save.

eventKeystring required

Key used to trigger this template on the send endpoints (event). EVENT_<id> when saved empty.

createdAtstring required

When the template was created. Format YYYY-MM-DD HH:MM:SS.

activatedboolean required

Whether the template is active.

provider'sms' | 'whatsapp_business' | 'whatsapp_private' | 'telegram_bot' | 'telegram_private' | 'websocket' | 'voice' | 'email' required
externalStatusstring nullable

Provider-side approval status (for example a WhatsApp template review).

languagestring nullable

Template language code. Always en for SMS templates.

sectionsunknown
variablesMappingunknown required
identifierstring nullable

External (provider) template identifier.

categorystring nullable

External (provider) template category.

Example response

{
  "activated": true,
  "createdAt": "2026-03-01 09:00:00",
  "eventKey": "verification_code",
  "id": 21,
  "language": "en",
  "name": "Verification code",
  "provider": "sms",
  "sections": [
    "Your CommPeak code is [code]"
  ],
  "stream": {
    "id": 5,
    "name": "Marketing US"
  },
  "text": "Your CommPeak code is [code]",
  "variablesMapping": {}
}

Changes

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      response property category list-of-types was widened by adding types null to media type application/json of response 201

    • breaking

      response property externalStatus list-of-types was widened by adding types null to media type application/json of response 201

    • breaking

      response property identifier list-of-types was widened by adding types null to media type application/json of response 201

    • breaking

      response property language list-of-types was widened by adding types null to media type application/json of response 201

    • breaking

      the response's property type changed from array to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from array to no type for status

    • warning

      the request property's maxLength was set to 255

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      added the new email enum value to the response property for the response status

    • warning

      added the new sms enum value to the response property for the response status

    • warning

      added the new telegram_bot enum value to the response property for the response status

    • warning

      added the new telegram_private enum value to the response property for the response status

    • warning

      added the new voice enum value to the response property for the response status

    • warning

      added the new websocket enum value to the response property for the response status

    • warning

      added the new whatsapp_business enum value to the response property for the response status

    • warning

      added the new whatsapp_private enum value to the response property for the response status

    • info

      api operation id createStreamEventTemplate removed and replaced with create_stream_event

    • info

      the endpoint scheme security APIKeyHeader was added to the API

    • info

      api tag Stream-Events added

    • info

      api tag Stream event templates removed

    • info

      the request property default value true was added

    • info

      request property list-of-types was widened by adding types null to media type application/json

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added subschema #2 to the response property anyOf list for the response status

    • info

      added subschema #1 subschema #2 to the response property anyOf list for the response status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status