Skip to main content
PUT
Set Opening Templates by Segment
Use this when leads of the same task should get a different first WhatsApp message depending on where they came from, for example one template per campaign for leads you upload in bulk. Read the current segments with Get a WhatsApp Template Pool (opening_segments). MCP keys need whatsapp:write; the MCP tool is set_opening_segments.

Set the segments

  • The list replaces the whole configuration. Send every segment you want to keep. "segments": [] removes it.
  • Up to 20 segments. Each name is required and appears once.
  • Segments are checked in order. The first one whose condition_rules match the lead wins.
  • Inside a segment, one template is drawn by weight: an integer from 1 to 100, 1 when you leave it out. In the example, spring_promo_ig_v1 goes out about three times as often as spring_promo_ig_v2.
  • Each segment has 1 to 10 templates, with no repeated names inside a segment.
  • Every template must be APPROVED on the account’s WhatsApp and written in the agent’s language.

Who gets which template

A segment without condition_rules is the catch-all and must be the last one. Without a catch-all, leads that don’t carry the segment field keep getting the normal opening template.

Condition rules

A rule is { "field", "op", "value" }, or a group { "operator": "and" | "or", "rules": [...] } with up to 10 single rules. Groups do not nest.

Errors

Authorizations

X-API-Key
string
header
required

API key for authentication. Keys are prefixed with nxr_live_. To work inside a sub-account with a main account key, also send the optional X-Nexor-Sub-Account-Id header.

Body

application/json
workflow_id
string<uuid>
required

Task (workflow in the API) whose opening template is chosen by segment.

segments
object[]
required

Segments in priority order, up to 20. Names are unique. Send [] to remove the configuration.

Maximum array length: 20

Response

Saved. opening_segments is the configuration now in effect, in priority order.

success
enum<boolean>
required
Available options:
true
opening_segments
object[]
required

Empty after segments: [].

Last modified on November 10, 2026