/plivo:plivo-cx-agentsfrom Plivo
Build, update, test and publish Plivo CX Agents (conversation flows made of nodes) through the Agents API and Plivo CLI. Covers node wiring, UUID assignment, positioning, preflight checks, and publishing.
Ships in Plivo. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A Plivo CX Agent is a directed graph: nodes (what happens) plus connections (what happens next). You build one by sending that graph as JSON. A 201 only means the graph was stored. The agent is done when the preflight passes, publish leaves it ACTIVE, and it opens cleanly in the console builder.
The Agents API is for US data region accounts only. It isn't available to India data region accounts (a CLI profile with region = "ap-south-1" in ~/.plivo/config.toml), and subaccounts aren't supported. With several CLI profiles, pass --profile <name> to every plivo command.
Docs: Agents API, building agents with the CLI.
id, every intent id on an AI node and every condition id on a branch_v2 node. Send each one back unchanged on every update. If you leave a node id out, Plivo assigns one such as send_message_1, and those ids repeat across agents, so always send your own. Never copy ids from an example, the catalogue or another agent. Make them with python3 -c 'import uuid; print(uuid.uuid4())' or the fill script in the worked example.left and top on every node. The builder draws top-down: Start at 400, 50, each step about 250 lower, siblings about 480 apart. Without positions the server lays nodes out left to right, which reads badly in the builder.plivo agents nodes get <type> for every type you use and send only fields from its schema. A missing required field still saves with 201, then fails at publish with 422.422, naming it), and a node with no incoming connection never runs.id; variables use node name. A connection end is <node_id>.<handle>, and the target handle is always Input. A variable is {{<node name>.<field>}}. Mixing them up fails at runtime, not on save.null. Lists are [], strings "". A null list can crash the builder's node editor.name allows letters, numbers, spaces, - and _ only. Anything else saves, then blocks publish. Names are the variable namespace, so pick them once.Use the Plivo CLI. It handles auth and adds /v1/Account/<auth_id> to paths. Check it with plivo --version. Not on PATH: brew install plivo/tap/plivo. Without Homebrew, ask the user to install it from https://github.com/plivo/plivo-cli#install (the installer checks the release signature) rather than running an install script yourself. Then plivo auth whoami: if it exits 2, ask the user to run plivo login in their own terminal, which signs in through the browser. Don't run it yourself.
plivo api GET /AgentFlowNode/ > catalogue.json: every node type and its handles. The preflight reads this file.plivo agents nodes get <type>: the JSON Schema, once per type you use.flow.json: {"name", "description", "nodes", "connections"}.plivo agents create --file flow.json: prints the agent_uuid and the stored name (a taken name gets 1 appended).plivo agents get <agent_uuid> -o json: the same node ids and connection count must come back.plivo agents publish <agent_uuid>, then plivo agents get <agent_uuid> must show ACTIVE. A 422 names the node and field to fix.Anything else goes through plivo api <METHOD> <path>, for example plivo api GET /AgentFlowNode/. Writes need --yes and take a body with --body @file.json. With -o json, or whenever stdout is piped, the CLI wraps the response in {"data": ...}.
Without the CLI: HTTP Basic auth (auth_id:auth_token) against https://api.plivo.com/v1/Account/<auth_id>/, with Content-Type: application/json. The auth_id in the path must be the one you authenticate with, or you get 401.
Under /v1/Account/<auth_id>/. Paths are case-sensitive; keep the trailing slash on collections.
| Method | Path | Result |
|---|---|---|
| GET | /AgentFlow/ | list; ?limit= (max 20), ?offset=, ?state=DRAFT|ACTIVE|PAUSED |
| POST | /AgentFlow/ | create; 201 with agent_uuid |
| GET | /AgentFlow/<agent_uuid>/ | detail, incl. nodes and connections |
| POST | /AgentFlow/<agent_uuid>/ | update; 202. The full graph, not a patch |
| DELETE | /AgentFlow/<agent_uuid>/ | 204 |
| POST | /AgentFlow/<agent_uuid>/Publish (or Pause, Resume) | 202; empty body |
| GET | /AgentFlow/<agent_uuid>/Run/[<run_uuid>/] | run history, or one run with its logs |
| GET | /AgentFlowNode/[<node_type>/] | the catalogue, or one type's schema |
Resources are keyed agent_uuid and run_uuid, never a bare id. Timestamps look like 2026-08-10 09:15:00.000000+00:00. The limit is 60 requests per 60 seconds per auth_id. Testing routes are under Testing.
{"id": "<new uuid4>", "name": "Front Desk", "type": "ai_agent_v2", "left": 400, "top": 300,
"config": {"model": {"...": "fields from plivo agents nodes get ai_agent_v2"}}}
Post config.model flat, with every field at its top level, even for the few types (http_request, conference_bridge, multi_party_call, voicemail) that read back with fields nested under a group key.
A source handle is one of the node's output_states from the catalogue, an intent_name of an AI node, or a condition alias of a branch_v2 node.
| Type | Handles |
|---|---|
start | the trigger: call, message, whatsapp, chat, email, http, outbound_call, ... |
ai_agent_v2 | each intent_name, plus error |
call_forward | completed, no_answer, busy_rejected, failed |
branch_v2 | each condition alias, plus no_match and error |
http_request | success, failed |
end_conversation | none; it ends the flow |
Start's config.model.triggers must contain the handle its connection uses. The trigger sets the agent's type: call for voice, message for SMS, http for an agent you trigger through the API.
ai_agent_v2 is the AI node; the builder calls it AI Conversation. The catalogue's description calls it legacy, which is wrong. ai_agent_v29 is a newer voice-only variant with the same shape. The catalogue also points to agent_node, which the builder shows only to some orgs, so use ai_agent_v2 unless the user asks for it. Don't use ai_agent_call, ai_agent_chat, ai_agent_message or ai_agent_whatsapp in new flows.
channel (call for voice), instructions (the system prompt) and initial_wait_time (seconds, e.g. 3).actions, extract_variables and instruction_attachments as [] when unused.first_response. It's dropped on save, and the greeting comes from instructions.intents. Each needs id (a new UUID v4), intent_name and intent_instructions (when it applies). Each intent_name is a source handle, spaces included: <node_id>.Transfer To Human.error handle. Don't wire sent: the builder doesn't draw it.call_forward (voice; needs from, to and ring_timeout, and from must differ from to) or queue_and_route (needs the UUID of a queue made in the console). Wire call_forward's no_answer, busy_rejected and failed handles too.actions[] entries with action_type CUSTOM_CODE or HTTP. EXECUTE_ACTION (a connected integration) needs an org_app_uuid the API can't list.instruction_attachments isn't a knowledge base.The catalogue lists 54 types, including superseded ones. Build with the types the builder's palette offers:
| Group | Types |
|---|---|
| Trigger | start |
| AI | ai_agent_v2, ai_action, ai_skills |
| Conversation | agent_preset_conversation, end_conversation |
| Functions | queue_and_route, business_hour, create_task, http_request |
| Call | initiate_call, ivr_menu, get_input, call_forward, voicemail, prompt, conference_bridge, multi_party_call_v2, stream |
| Customer input | customer_feedback, user_input |
| Logic | branch_v2, counter |
queue_and_route and business_hour take UUIDs of a queue and business hours made in the console. Don't add any other type. Old flows still show ai_agent_call, ai_agent_chat, ai_agent_message and ai_agent_whatsapp (use ai_agent_v2), hangup (use end_conversation), and send_message, send_whatsapp and send_chat. These save but the builder can't show them at all: agent_assignment, ai_chatbot, api_integration, branch (use branch_v2), chat_menu_button, customer_feedback_call, email_conversation, get_object, multi_party_call, queue, send_chat_and_wait_reply, send_email, send_message_and_wait_reply, send_whatsapp_and_wait_reply, set_attribute, waiting_room.
branch_v2{"id": "<new uuid4>", "name": "VIP Sender", "type": "branch_v2", "left": 400, "top": 300,
"config": {"model": {"conditions": [
{"id": "<new uuid4>", "alias": "vip", "expression_operators": [],
"expressions": [{"lhs": "{{Start.message.from}}", "rhs": ["+15551234567"],
"operation": "exact match", "case_sensitive": false}]}]}}}
expression_operators has one entry fewer than expressions: [] for one, ["and"] for two. exact match compares one value, so to match any of N values use N conditions, all wired to the same target. Other operations: contains, starts with, ends with, in.
{{<node name>.<field>}}, for example {{Start.call.to}}, the number that was called. No schema lists the trigger fields, so use only paths you've seen work ({{Start.call.to}}, {{Start.message.from}}, {{Start.outbound_call.to}}), or read one off a real run with plivo agents runs get <agent_uuid> <run_uuid>. Publish rejects a path it doesn't know. Stored credentials go in {{secrets.NAME}}, never in config. Renaming a node breaks every variable that uses its old name.
Start, an AI receptionist, a transfer to a human, and an end. Write it to flow.json:
{
"name": "Bright Smile Front Desk",
"description": "Inbound voice receptionist with transfer to a human",
"nodes": [
{"id": "<uuid:start>", "name": "Start", "type": "start", "left": 400, "top": 50,
"config": {"model": {"triggers": ["call"]}}},
{"id": "<uuid:ai>", "name": "Front Desk", "type": "ai_agent_v2", "left": 400, "top": 300,
"config": {"model": {
"channel": "call",
"initial_wait_time": 3,
"instructions": "You are the receptionist for Bright Smile Dental. Book, move or cancel appointments. Hours: Mon-Fri 9am-6pm. Address: 12 Main Street. Greet callers warmly and keep replies short.",
"intents": [
{"id": "<uuid:human>", "intent_name": "Transfer To Human",
"intent_instructions": "The caller asks for a person, is upset, or needs something you can't do."},
{"id": "<uuid:done>", "intent_name": "Call Complete",
"intent_instructions": "The caller has what they need and the call is over."}],
"actions": [], "extract_variables": [], "instruction_attachments": []}}},
{"id": "<uuid:forward>", "name": "Transfer", "type": "call_forward", "left": 160, "top": 560,
"config": {"model": {"from": "{{Start.call.to}}", "to": "+15551234567", "ring_timeout": 30}}},
{"id": "<uuid:end>", "name": "End", "type": "end_conversation", "left": 640, "top": 560,
"config": {"model": {"end_message": "Thanks for calling Bright Smile Dental. Goodbye!"}}}
],
"connections": [
{"source": "<uuid:start>.call", "target": "<uuid:ai>.Input"},
{"source": "<uuid:ai>.Transfer To Human", "target": "<uuid:forward>.Input"},
{"source": "<uuid:ai>.Call Complete", "target": "<uuid:end>.Input"},
{"source": "<uuid:ai>.error", "target": "<uuid:end>.Input"},
{"source": "<uuid:forward>.no_answer", "target": "<uuid:end>.Input"},
{"source": "<uuid:forward>.busy_rejected", "target": "<uuid:end>.Input"},
{"source": "<uuid:forward>.failed", "target": "<uuid:end>.Input"}
]
}
Set to to the human's number. call_forward records the transferred call unless you send "record": false. Swap each <uuid:...> for a new UUID v4, the same value everywhere it appears, then run the preflight, create and publish:
python3 - flow.json <<'PY'
import re, sys, uuid
ids, path = {}, sys.argv[1]
text = re.sub(r"<uuid:(\w+)>", lambda m: ids.setdefault(m[1], str(uuid.uuid4())), open(path).read())
open(path, "w").write(text)
PY
plivo agents create --file flow.json
plivo agents publish <agent_uuid>
Run it before every create and update, and fix every error; warnings are worth fixing too. It checks ids, handles, wiring, names and nulls. It doesn't check required fields, field types or loops: publish does, and its 422 names the node and field. It reads the catalogue from a file, so it holds no credentials. To reuse it, save the lines between the PY markers as preflight.py and run python3 preflight.py flow.json catalogue.json.
plivo api GET /AgentFlowNode/ > catalogue.json
python3 - flow.json catalogue.json <<'PY'
import json, re, sys, uuid
flow, cat = (json.load(open(p)) for p in sys.argv[1:3])
flow, cat = flow.get("data", flow), cat.get("data", cat) # the CLI wraps JSON output in "data"
nodes, conns = flow.get("nodes") or [], flow.get("connections") or []
states = {t["node_type"]: {s["id"] for s in t.get("output_states") or []} for t in cat["objects"]}
err, warn = [], []
def is_uuid4(v):
try:
return uuid.UUID(str(v)).version == 4 and str(uuid.UUID(str(v))) == v
except ValueError:
return False
def model(n):
return (n.get("config") or {}).get("model") or {}
def handles(n):
m = model(n)
h = set(states.get(n.get("type"), ())) | {i.get("intent_name") for i in m.get("intents") or []}
h |= {c.get("alias") for c in m.get("conditions") or []}
if str(n.get("type")).startswith("ai_agent_v2"):
h.discard("sent") # the builder doesn't draw it
return h - {None}
byid = {}
for n in nodes:
nid, label = n.get("id"), repr(n.get("name") or n.get("id"))
if not is_uuid4(nid):
err.append(f"{label}: id {nid!r} is not a new UUID v4")
elif nid in byid:
err.append(f"{label}: id {nid} is used twice")
byid[nid] = n
if not re.fullmatch(r"[A-Za-z0-9 _-]+", str(n.get("name") or "")):
err.append(f"{label}: name may use only letters, numbers, spaces, - and _")
if n.get("type") not in states:
err.append(f"{label}: unknown type {n.get('type')!r}")
if n.get("left") is None or n.get("top") is None:
warn.append(f"{label}: no left/top, so the builder draws it out of place")
m = model(n)
subs = (m.get("intents") or []) + (m.get("conditions") or [])
exits = [s.get("intent_name") or s.get("alias") for s in subs]
for sub, exit_name in zip(subs, exits):
if not is_uuid4(sub.get("id")):
err.append(f"{label}: {exit_name!r} needs its own UUID v4 id")
for dup in {x for x in exits if exits.count(x) > 1}:
err.append(f"{label}: two intents or conditions are named {dup!r}")
for k, v in m.items():
if v is None:
err.append(f"{label}: config.model.{k} is null; drop it, or send [] or \"\"")
if "first_response" in m:
warn.append(f"{label}: first_response is dropped on save; put the greeting in instructions")
out, nxt, inc = {}, {}, set()
for c in conns:
src, dst = str(c.get("source", "")), str(c.get("target", ""))
(s, _, sh), (t, _, th) = src.partition("."), dst.partition(".")
if s not in byid or t not in byid or not sh or not th:
err.append(f"{src} -> {dst}: each end must be <node_id>.<handle> of a node in this flow")
continue
if th != "Input":
err.append(f"{src} -> {dst}: the target handle is always Input")
if sh not in handles(byid[s]):
valid = ", ".join(sorted(handles(byid[s]))) or "none"
err.append(f"{byid[s].get('name')!r}.{sh}: not a handle of {byid[s].get('type')}; valid: {valid}")
out.setdefault(s, set()).add(sh)
nxt.setdefault(s, set()).add(t)
inc.add(t)
starts = [i for i, n in byid.items() if n.get("type") == "start"]
if len(starts) != 1:
err.append(f"found {len(starts)} start nodes; a flow needs exactly 1")
seen, todo = set(), list(starts)
while todo:
cur = todo.pop()
if cur not in seen:
seen.add(cur)
todo += nxt.get(cur, ())
for i, n in byid.items():
label = repr(n.get("name") or i)
if n.get("type") != "start" and i not in inc:
err.append(f"{label} has no incoming connection")
elif i not in seen:
err.append(f"{label} isn't reachable from Start")
if handles(n) and i not in out:
(err if n.get("type") == "start" else warn).append(f"{label} has no outgoing connection")
for intent in model(n).get("intents") or []:
if intent.get("intent_name") not in out.get(i, ()):
err.append(f"{label}: intent {intent.get('intent_name')!r} isn't wired to anything")
if str(n.get("type")).startswith("ai_agent_v2") and "error" not in out.get(i, ()):
warn.append(f"{label}: wire its error handle")
if n.get("type") == "start" and out.get(i, set()) - set(model(n).get("triggers") or []):
warn.append(f"{label}: config.model.triggers must include the handle its connection uses")
names = {n.get("name") for n in nodes}
for ref in set(re.findall(r"\{\{\s*([^.{}]+?)\s*\.", json.dumps(flow))):
if ref in byid and ref not in names:
err.append(f"variable {{{{{ref}...}}}} uses a node id; variables use the node name")
for line in [f"ERROR {e}" for e in err] + [f"warn {w}" for w in warn]:
print(line)
print(f"{len(err)} error(s), {len(warn)} warning(s)")
sys.exit(1 if err else 0)
PY
Scenarios are test conversations generated from the flow, ready in about 30 seconds:
plivo agents get <agent_uuid> -o json | python3 -c 'import json, sys; a = json.load(sys.stdin)["data"]; json.dump({"flow_json": {"nodes": a["nodes"], "connections": a["connections"]}, "max_scenarios": 3}, open("scenarios.json", "w"))'
plivo api POST /AgentFlow/<agent_uuid>/Scenario/ --body @scenarios.json --yes
plivo api GET /AgentFlow/<agent_uuid>/Scenario/ | python3 -c '
import json, sys
for s in json.load(sys.stdin)["data"]["data"]["scenarios"]:
print(s["scenario"]["name"], "|", s["scenario"]["goal"])'
Simulations run scenarios against the flow and return a run_uuid to poll or stream. A run started over the API can fail to save. If GET Simulation/<run_uuid>/ keeps returning 404, or these routes return 500, test in the console instead (below).
| Method | Path under /AgentFlow/<agent_uuid>/ | Result |
|---|---|---|
| POST | Scenario/ | generate; 202. Needs flow_json, takes max_scenarios |
| GET | Scenario/ | list |
| DELETE | Scenario/[<scenario_uuid>/] | delete all, or one |
| POST | Simulation/ | run; 202. Needs flow_json and scenario_uuids |
| GET | Simulation/[<run_uuid>/] | runs, or one run with per-scenario results |
| GET | Simulation/<run_uuid>/Export/ | full results |
| GET | Simulation/<run_uuid>/Stream/ | live transcript, text/event-stream |
flow_json is the whole graph from the agent's GET. Ids in these paths must be real UUIDs, or you get 400. Generating and running are limited to 5 requests per 10 minutes per auth_id.
In the console, at https://cx.plivo.com/agent/builder/<agent_uuid>:
to number.plivo agents runs list <agent_uuid> lists the run, and plivo agents runs get <agent_uuid> <run_uuid> shows its logs.Send the whole graph back, with every id exactly as it came back. Reads return unset fields as null. Following rule 7, this turns a null list into [] and a null text field into "", by each type's schema, and leaves other null fields out:
plivo agents get <agent_uuid> -o json > agent.json
for t in $(python3 -c 'import json; print(*{n["type"] for n in json.load(open("agent.json"))["data"]["nodes"]})'); do
plivo agents nodes get "$t" -o json > "schema_$t.json"
done
python3 - <<'PY'
import json
a = json.load(open("agent.json"))["data"]
for n in a["nodes"]:
props = json.load(open(f"schema_{n['type']}.json"))["data"]["json_schema"].get("properties", {})
model = n.get("config", {}).get("model", {})
for k in [k for k, v in model.items() if v is None]:
s = props.get(k, {})
kinds = s.get("type") if isinstance(s.get("type"), list) else [s.get("type")]
if "array" in kinds:
model[k] = []
elif kinds == ["string"] and "enum" not in s:
model[k] = ""
else:
del model[k]
json.dump({"nodes": a["nodes"], "connections": a["connections"]}, open("flow.json", "w"), indent=2)
PY
# edit flow.json, run the preflight, then:
plivo agents update <agent_uuid> --file flow.json
type can't change: remove the node and add a replacement under a new id.--allow-node-deletion (v1.3.2+): plivo agents update <agent_uuid> --file flow.json --allow-node-deletion. Without the flag the update gets 422. A connection left pointing at a removed node gets 500, which retrying won't fix. Older binaries have no such flag: add "allow_node_deletion": true to flow.json and use plivo api POST /AgentFlow/<agent_uuid>/ --body @flow.json --yes.name can change alone (plivo agents update <agent_uuid> --name "..."). A description change must include the full graph.token, password, secret, api_key, authorization, cookie) as ***REDACTED***, and the server restores them on write. It can't for a list under a secret-named key, or for list entries without a unique id, uuid, key or name: those updates return 400 until you send the real values.| Symptom | Cause | Fix |
|---|---|---|
422 naming nodes | a node no connection mentions | wire it, or drop it |
400 on a connection | an end isn't <node_id>.<handle> | add the handle; targets use .Input |
401 | the path auth_id isn't the authenticated one | use the same auth_id |
422 on publish | a missing required field, an unknown variable, a loop, or already ACTIVE | read the message; it names the node and field |
| a branch never fires | an invented source handle | run the preflight |
| a node on the canvas has no parent | its only incoming edge uses a handle the builder doesn't draw | wire a real handle |
| the builder shows "Cannot read properties of null" | a null list in config.model | send [] |
422 on update: "omits ... stored node(s)" or "A node's type cannot be changed" | a node was left out, or its id or type changed | send each node back with its id and type; to replace one, add the new node under a new id with --allow-node-deletion (v1.3.2+) |
What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/plivo-audio-streamingTakes a new or existing Plivo user to a voice agent on real calls through audio streaming (the Stream XML element), using the Plivo CLI. It checks credit, KYC and the number, builds a test agent (an echo test, or Pipecat with OpenAI) or reuses the user's own WebSocket voice agent, exposes it through ngrok or Cloudflare Tunnel, creates an audio-stream application, links the number and places a test call, then covers go-live, handoff and debugging. Use when someone wants to build or try a Plivo voice agent or bot, connect a WebSocket bot to Plivo, or for a caller hearing silence, errors 7011/8011, streamed-call hangup codes, bot-to-human handoff, India KYC for an agent number. Not for SIP trunking (plivo-sip-trunking) or plain Voice XML (plivo-voice-xml)./plivo-call-forwardingDebugs call forwarding on Plivo with the Plivo CLI: a carrier forwards calls into a Plivo number and ForwardedFrom, ForwardedCause or ForwardedReason is missing or odd; Plivo forwards a call out (Dial XML, a PHLO Call Forward node, an agent transfer) and the forwarded leg fails; or a carrier forwards into a SIP trunk number and the Diversion header must reach the SBC. Use when forwarded calls never arrive, lack the forwarding number or fail. Not for writing XML (plivo-voice-xml) or SIP trunk setup (plivo-sip-trunking).Other plugins' skills for the same job
npx claudepluginhub plivo/plivo-cli --plugin plivo