Streams

Update an existing stream. Only the fields you send are changed.

Activation. A request that carries params is a configuration step and never activates the stream. To activate a DRAFT stream, send state: "READY" without params; the configuration is validated first and a 400 explains what is missing.

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

put/streams/{id}

Request

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

Path parameters

idinteger required

Unique identifier of the resource.

Request body

namestring nullable

Stream name. Must not be blank when sent.

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.

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. A request without params that sets READY on a stream that is not yet active is the activation step: the stream configuration is validated first. Requests to a RESTRICTED stream are refused.

Example request

{
  "description": "Outbound marketing to US contacts",
  "state": "DISABLED"
}

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

      added the new path request parameter id

    • 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 200

    • breaking

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

    • breaking

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

    • breaking

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

    • breaking

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

    • 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 updateStream removed and replaced with update_stream

    • info

      the endpoint scheme security APIKeyHeader was added to the API

    • info

      the request property became optional

    • 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

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