Use when working with Plivo — plivo cloud communications platform management for voice calls, SMS messaging, phone number management, and usage analytics. Use when analyzing message delivery rates, monitoring call quality, reviewing Plivo account usage and billing, or managing phone number inventory.
Manage and analyze Plivo voice, messaging, and phone number resources.
All API calls use HTTP Basic Auth with Auth ID and Auth Token, injected automatically.
https://api.plivo.com/v1/Account/$PLIVO_AUTH_ID
#!/bin/bash
plivo_api() {
local method="$1"
local endpoint="$2"
local data="${3:-}"
if [ -n "$data" ]; then
curl -s -X "$method" \
-u "$PLIVO_AUTH_ID:$PLIVO_AUTH_TOKEN" \
-H "Content-Type: application/json" \
"https://api.plivo.com/v1/Account/${PLIVO_AUTH_ID}${endpoint}/" \
-d "$data"
else
curl -s -X "$method" \
-u "$PLIVO_AUTH_ID:$PLIVO_AUTH_TOKEN" \
"https://api.plivo.com/v1/Account/${PLIVO_AUTH_ID}${endpoint}/"
fi
}
jq to extract only needed fields#!/bin/bash
echo "=== Account Details ==="
plivo_api GET "" | jq '{auth_id: .auth_id, name: .name, cash_credits: .cash_credits, state: .state}'
echo ""
echo "=== Phone Numbers ==="
plivo_api GET "/Number?limit=50" \
| jq -r '.objects[] | "\(.number)\t\(.region)\t\(.type)\t\(.sms_enabled)\t\(.voice_enabled)"' \
| column -t | head -20
echo ""
echo "=== Applications ==="
plivo_api GET "/Application?limit=20" \
| jq -r '.objects[] | "\(.app_id[0:12])\t\(.app_name)\t\(.default_endpoint_app)"' \
| column -t | head -15
#!/bin/bash
echo "=== Recent Messages ==="
plivo_api GET "/Message?limit=50&offset=0" \
| jq -r '.objects[] | "\(.message_time[0:16])\t\(.message_direction)\t\(.message_state)\t\(.to_number)"' \
| head -20
echo ""
echo "=== Message Status Breakdown ==="
plivo_api GET "/Message?limit=200" \
| jq -r '.objects[] | .message_state' | sort | uniq -c | sort -rn
echo ""
echo "=== Failed Messages ==="
plivo_api GET "/Message?limit=100" \
| jq -r '.objects[] | select(.message_state == "failed") | "\(.message_time[0:16])\t\(.error_code)\t\(.to_number)"' \
| head -10
#!/bin/bash
echo "=== Recent Calls ==="
plivo_api GET "/Call?limit=50" \
| jq -r '.objects[] | "\(.initiation_time[0:16])\t\(.call_direction)\t\(.call_duration)s\t\(.end_time[0:16])"' \
| head -20
echo ""
echo "=== Pricing / Usage ==="
plivo_api GET "/Pricing" | jq '{country: .country, phone_code: .phone_code}' | head -10
=== Account: <name> ===
Balance: $<cash_credits> State: <active|suspended>
--- Phone Numbers: <count> ---
<number> <region> SMS:<y/n> Voice:<y/n>
--- Messaging Health ---
Delivered: <n> Failed: <n> Queued: <n>
--- Call Summary ---
Total: <n> Avg Duration: <n>s
--help output.| Shortcut | Counter | Why |
|---|---|---|
| "I'll skip discovery and check known resources" | Always run Phase 1 discovery first | Resource names change, new resources appear — assumed names cause errors |
| "The user only asked for a quick check" | Follow the full discovery → analysis flow | Quick checks miss critical issues; structured analysis catches silent failures |
| "Default configuration is probably fine" | Audit configuration explicitly | Defaults often leave logging, security, and optimization features disabled |
| "Metrics aren't needed for this" | Always check relevant metrics when available | API/CLI responses show current state; metrics reveal trends and intermittent issues |
| "I don't have access to that" | Try the command and report the actual error | Assumed permission failures prevent useful investigation; actual errors are informative |
/ on all endpointslimit and offset params; check meta.total_count for total