Create a group
Creates a group from agents you already have, so live calls can be split across them by weight and the agents compared on real traffic.
name and members are required.
Members
A group holds 1–10 agents, each at most once. Every member must name an un-archived agent in the same workspace that has a production version. Weights are 0–100 and at least one must be above 0. Members are labelled A, B, C… in the order given.
What gets measured
overall_enabled(defaulttrue) measures every call on the platform's Overall performance fields:overall_score1–10 andoutcome.metricsadds up to 20 custom fields.
Both are written into one group-owned extraction object (extraction_object_id) that runs after every call routed through the group, on top of the answering agent's own after-call extractions. That object is hidden from GET /v1/extraction-objects and can only be changed here.
Validation failures list every offending field with its path. Requires the groups entitlement.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255application/json- body
Creates a group. name and members are required. overall_enabled defaults to true, routing_strategy to sticky, and metrics to an empty list. Maximum encoded body size is 262144 bytes.
name*stringUnique among the workspace's non-archived groups. Trimmed.
1 <= length <= 200description?|length <= 2000overall_enabled?booleantruerouting_strategy?GroupRoutingStrategyChooses among eligible members in proportion to their weights. sticky assigns a number consistently while the eligible members and weights are unchanged. random draws independently for each new assignment. prefer_new draws from agents with no retained answered call for the number in this group, or from all eligible members once every eligible agent has answered it. When the number is unavailable, sticky and prefer_new use weighted random.
"sticky""sticky""random""prefer_new"members*array<>1–10 distinct agents; at least one weight must be above 0. Array order sets position and the labels (A, B, …).
1 <= items <= 10metrics?array<>|Custom metrics. Null is accepted and stores an empty list.
items <= 20The created group, including the (empty) used_by_detail lists.
application/json- response
A set of existing agents with traffic weights. A phone number, outbound job or campaign can target a group instead of a single agent or a flow; each call is assigned to one member using routing_strategy and measured on the same metrics, so agents can be compared on real traffic. A group owns no prompt, model or voice configuration — those stay on each member agent's production version. Groups are not versioned: a save is live on the next call, and resource_version feeds the strong ETag that PATCH's If-Match is checked against.
id*stringuuidorg_id*stringuuidname*string1 <= length <= 200description?stringAbsent when no description is set.
length <= 2000routing_strategy*GroupRoutingStrategyChooses among eligible members in proportion to their weights. sticky assigns a number consistently while the eligible members and weights are unchanged. random draws independently for each new assignment. prefer_new draws from agents with no retained answered call for the number in this group, or from all eligible members once every eligible agent has answered it. When the number is unavailable, sticky and prefer_new use weighted random.
"sticky""random""prefer_new"overall_enabled*booleanWhether every call is measured on the platform's Overall performance fields: overall_score (integer 1–10) and outcome (achieved, partial, not_achieved or escalated).
members*array<>The live members in position order.
items <= 10metrics*array<>items <= 20extraction_object_id?stringThe group-owned extraction object that measures overall_enabled and metrics. It runs after every call routed through the group, is hidden from GET /v1/extraction-objects, and PATCH/DELETE on it return 409 extraction_object_managed_by_group — change the group instead.
uuidused_by*How many non-archived phone numbers and campaigns point at the group.
used_by_detail?Returned by the single-group endpoints (GET, POST, PATCH) only.
resource_version*integerMonotonic row version maintained by the database, never by the handler. It is the value behind the strong ETag.
int640 <= valuearchived_at?stringAbsent unless the group has been archived.
date-timecreated_at*stringdate-timeupdated_at*stringdate-timecurl -X POST 'https://api.kejue.co/v1/groups' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "name": "Debt collection A/B", "description": "Noura'\''s empathetic opener against Omar'\''s direct one.", "overall_enabled": true, "routing_strategy": "sticky", "members": [ { "agent_id": "11111111-1111-4111-8111-111111111111", "weight": 50 }, { "agent_id": "22222222-2222-4222-8222-222222222222", "weight": 50 } ], "metrics": [ { "name": "payment_promised", "type": "boolean", "description": "Did the customer promise to pay?" }, { "name": "sentiment", "type": "enum", "enum_values": [ "positive", "neutral", "negative" ] } ]}'{ "id": "55555555-5555-4555-8555-555555555555", "org_id": "44444444-4444-4444-8444-444444444444", "name": "Debt collection A/B", "description": "Noura's empathetic opener against Omar's direct one.", "overall_enabled": true, "routing_strategy": "sticky", "members": [ { "id": "66666666-6666-4666-8666-666666666666", "agent_id": "11111111-1111-4111-8111-111111111111", "agent_name": "Noura", "agent_slug": "noura", "label": "A", "weight": 50, "position": 0, "share": 50, "dispatchable": true, "created_at": "2026-10-20T09:00:00Z" }, { "id": "77777777-7777-4777-8777-777777777777", "agent_id": "22222222-2222-4222-8222-222222222222", "agent_name": "Omar", "agent_slug": "omar", "label": "B", "weight": 50, "position": 1, "share": 50, "dispatchable": true, "created_at": "2026-10-20T09:00:00Z" } ], "metrics": [ { "name": "payment_promised", "type": "boolean", "description": "Did the customer promise to pay?" }, { "name": "sentiment", "type": "enum", "enum_values": [ "positive", "neutral", "negative" ] } ], "extraction_object_id": "88888888-8888-4888-8888-888888888888", "used_by": { "phone_numbers": 0, "campaigns": 0 }, "used_by_detail": { "phone_numbers": [], "campaigns": [] }, "resource_version": 1, "created_at": "2026-10-20T09:00:00Z", "updated_at": "2026-10-20T09:00:00Z"}