Send a share of live traffic to a branch

POST /Platform/entities/branch-traffic

Send a share of live traffic to a branch.

Runs an A/B experiment: the branch's changes (routing, agents, workflows, documents) are the variant. Each inbound contact (caller, sender, chat visitor) is assigned by a stable hash, so the same person always lands on the same side. A contact assigned to the branch is handled with the branch's configuration, and everything it produces (calls, conversations, messages) is still written to main, stamped with _read_branch so you can compare: the branch name for the variant, main for the control group (contacts that met the condition but stayed on main). Several branches can take traffic at once; their shares never overlap, and changing one never moves another's contacts.

Takes effect for new contacts within seconds and reaches real callers immediately, and so does every later edit to the branch. So it needs the permission to approve changesets (org admins hold it), whether or not main is protected, and every change is in the audit log. Set percent to 0, delete the branch, or merge it to end the experiment.

An experiment ended with percent 0 stays listed (with include_ended) with when it ran, so its results can still be compared; a share on it resumes it with the same contacts. It is gone once it is forgotten or its branch is deleted or merged.

Body parameters

Returns

BranchTraffic or null

Example request

curl -X POST "https://api.hilus.ai/Platform/entities/branch-traffic" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'