Create stream event template

Description

Summary: Creates a new stream event template via the TextPeak API.
Details: This endpoint creates a new stream event template that defines a reusable event configuration for messaging streams. Stream event templates specify the event name, associated stream, message text, and a unique event key used to trigger the template programmatically. Templates can be created in an active or inactive state using the activated flag. Once created, the template can be referenced by other endpoints (e.g., WhatsApp template sending) to deliver structured messages to recipients. Authentication is performed via a TextPeak API key passed in the Authorization header.

Authentication & Scopes

Authentication is handled via a TextPeak API key provided in the Authorization header. No OAuth scopes are defined; access is granted or denied based on the validity of the API key.

MethodDetails
API KeyPass your TextPeak API key directly in the Authorization header value.

Headers

HeaderRequiredDescription
AuthorizationYesYour TextPeak API key that authenticates the request.
Content-TypeYesMust be set to application/json. The API only accepts JSON-formatted request bodies.
acceptYesMust be set to application/json. Indicates that the client expects a JSON response.

Parameters

This endpoint does not use path or query parameters.

Request Body

The request body is a JSON object defining the new stream event template.

FieldTypeRequiredDescription
namestringYesA human-readable name for the stream event template (e.g., "Welcome Message", "OTP Verification").
streamIdintegerYesThe numeric ID of the stream this event template belongs to. Associates the template with a specific messaging stream.
textstringYesThe message text content of the template. This is the default text that will be sent when the event is triggered.
eventKeystringYesA unique key used to identify and trigger this event template programmatically (e.g., "welcome_msg", "otp_verify").
activatedbooleanYesWhether the template is active and available for use. Set to true to enable or false to create in a disabled state.

Examples

This endpoint has a saved example demonstrating usage:

  • Create stream event template — Creating a new stream event template with a name, stream association, text content, event key, and activation status.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
boolean
string
string
number
string
Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json