Streams

Create a new stream. name is required; other fields are optional and depend on the stream type (default MARKETING).

Lifecycle. SMS streams (MARKETING, TRANSACTIONAL, OTP, TWO_WAY) are active (READY) as soon as they are created. Every other type is created as a DRAFT: configure it with params, then activate it with a PUT that sets state to READY and sends no params.

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

post/streams

Request

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

Request body

namestring required

Stream name. Must not be blank.

descriptionstring nullable

Free-text description.

type'MARKETING' | 'TRANSACTIONAL' | 'OTP' | 'TWO_WAY' | 'WHATSAPP_BUSINESS' | 'WHATSAPP_PRIVATE' | 'TELEGRAM_BOT' | 'TELEGRAM_PRIVATE' | 'WEBSOCKET' | 'VOICE' | 'EMAIL' | 'WHATSAPP_BUSINESS_AUTH' | 'WHATSAPP_EMBEDDED' nullable

Stream type, case-insensitive. SMS types (MARKETING, TRANSACTIONAL, OTP, TWO_WAY) are active as soon as they are created; every other type is created as a DRAFT to configure.

paramsobject nullable

Type-specific configuration. Keys outside the allow-list for the stream type are dropped. All types: check_ip_acl (0/1), enable_timezone_checks (0/1). MARKETING / TRANSACTIONAL / TWO_WAY: content_generator (0 none, 1 inline templates, 2 event templates). WHATSAPP_BUSINESS: auth_token, business_id, selected_sender_id. TELEGRAM_BOT: auth_token, bot_name. Sending params is a configuration step: it never activates the stream (see the stream lifecycle in the overview).

state'READY' | 'SENDING' | 'DRAFT' | 'DISABLED' | 'RESTRICTED' nullable

Requested state. Unknown values are ignored. RESTRICTED is set by CommPeak only.

Example request

{
  "description": "Outbound marketing to US contacts",
  "ipAcl": "192.0.2.10",
  "name": "Marketing US",
  "type": "MARKETING"
}

Response

Successful Response

idinteger required

Unique stream identifier.

streamUidstring nullable

Opaque stream UID, generated at creation.

namestring nullable

Stream name.

descriptionstring nullable

Free-text description.

type'MARKETING' | 'TRANSACTIONAL' | 'OTP' | 'TWO_WAY' | 'WHATSAPP_BUSINESS' | 'WHATSAPP_PRIVATE' | 'TELEGRAM_BOT' | 'TELEGRAM_PRIVATE' | 'WEBSOCKET' | 'VOICE' | 'EMAIL' | 'WHATSAPP_BUSINESS_AUTH' | 'WHATSAPP_EMBEDDED' | 'UNKNOWN' required
callerIdstring nullable

Caller ID. Set only on VOICE streams.

ipAclstring nullable

Comma-separated, sorted IP / CIDR allow-list. Empty when not restricted.

state'READY' | 'SENDING' | 'DRAFT' | 'DISABLED' | 'RESTRICTED' | 'UNKNOWN' required
selectedSenderIdstring nullable

WhatsApp phone number ID selected during WhatsApp onboarding; null otherwise.

Example response

{
  "description": "Outbound marketing to US contacts",
  "id": 5,
  "ipAcl": "192.0.2.10",
  "name": "Marketing US",
  "state": "READY",
  "streamTags": [
    {
      "id": 12,
      "value": "vip"
    }
  ],
  "streamUid": "9f1c2d3e4b5a6789c0d1e2f3a4b5c6d7",
  "type": "MARKETING"
}

Changes

    • breaking

      removed the enum value DISABLED of the request property

    • breaking

      removed the enum value DRAFT of the request property

    • breaking

      removed the enum value MARKETING of the request property

    • breaking

      removed the enum value OTP of the request property

    • breaking

      removed the enum value READY of the request property

    • breaking

      removed the enum value RESTRICTED of the request property

    • breaking

      removed the enum value SENDING of the request property

    • breaking

      removed the enum value TELEGRAM_BOT of the request property

    • breaking

      removed the enum value TELEGRAM_PRIVATE of the request property

    • breaking

      removed the enum value TRANSACTIONAL of the request property

    • breaking

      removed the enum value TWO_WAY of the request property

    • breaking

      removed the enum value VOICE of the request property

    • breaking

      removed the enum value WEBSOCKET of the request property

    • breaking

      removed the enum value WHATSAPP_BUSINESS of the request property

    • breaking

      removed the enum value WHATSAPP_PRIVATE of the request property

    • breaking

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

    • breaking

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

    • breaking

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

    • breaking

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

    • breaking

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

    • warning

      the request property's maxLength was set to 255

    • warning

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

    • warning

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

    • warning

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

    • warning

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

    • warning

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

    • info

      api operation id addStream removed and replaced with create_stream

    • info

      the endpoint scheme security APIKeyHeader was added to the API

    • info

      the request property default value READY was added

    • info

      the request property default value MARKETING was added

    • info

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

    • info

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

    • info

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

    • info

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

    • 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 the optional property to the response with the status

    • info

      added the optional property to the response with 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