Skip to main content

PIOPIY: Complete Voice AI Agent & CPaaS Platform SDK (Voice, Queue, Campaigns, WhatsApp, SMS)

Project description

Piopiy AI Agent, Voice & WhatsApp SDK - Python

The official Python SDK for Piopiy - a complete Voice AI Agent and CPaaS Platform.

Easily build intelligent Voice Agents, manage complex call flows (queues, human handoff), execute bulk voice campaigns, and send multi-channel notifications via WhatsApp and SMS.

Installation

pip install piopiy

Usage

1. Initialize the Client

You strictly need a Bearer token to initialize the client.

from piopiy import RestClient

# Initialize with your Bearer token
client = RestClient(token="your_bearer_token")

2. Initiate an AI Call

Trigger an outbound call handled by your AI Agent.

try:
    response = client.ai.call(
        caller_id="919999999999",      # The number displayed to the callee
        to_number="918888888888",      # The destination number
        agent_id="bdd32bcb-...",       # Your AI Agent ID
        options={
            "max_duration_sec": 600,   # Optional: Limit call duration (30-7200)
            "record": True,            # Optional: Record the call
            "ring_timeout_sec": 40     # Optional: Ring timeout (5-120)
        },
        variables={
            "customer_name": "John Doe",  # Custom variables for the AI Agent
            "subscription": "premium"
        }
    )
    print("Call Initiated:", response)
except Exception as e:
    print("Error:", e)

Parameters

Parameter Type Required constraints Description
caller_id string Yes ^[1-9][0-9]{6,15}$ The number calling from. Must start with 1-9 and be 7-16 digits long.
to_number string Yes ^[1-9][0-9]{6,15}$ The destination number. Must start with 1-9 and be 7-16 digits long.
agent_id string Yes uuid The unique UUID of the AI agent.
options object No - Configuration options for the call.
variables object No - Custom variables to pass to the agent. Keys must match ^[A-Za-z_][A-Za-z0-9_]*$. Values can be string, number, or boolean.

Options Object

Key Type constraints Description
max_duration_sec integer 30 - 7200 Maximum duration of the call in seconds.
ring_timeout_sec integer 5 - 120 Time in seconds to wait for the call to be answered.
record boolean - Whether to record the call.

3. Terminate a Call

Hang up an active call programmatically.

try:
    response = client.voice.hangup(
        call_id="bf2d781e-...",        # The Call UUID
        cause="NORMAL_CLEARING",       # Hangup cause
        reason="Consultation done"     # Optional reason
    )
    print("Call Terminated:", response)
except Exception as e:
    print("Error:", e)

Parameters

Parameter Type Required Description
call_id string Yes The unique identifier (UUID) of the call to hang up.
cause string No The cause for hanging up. Defaults to "NORMAL_CLEARING".
reason string No Additional text description or reason for terminating the call.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piopiy-1.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piopiy-1.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file piopiy-1.1.0.tar.gz.

File metadata

  • Download URL: piopiy-1.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for piopiy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9bfe941e2189af58241ea0fe0134250691e702fcb2ba2a3e3f8f838a1db7fbcb
MD5 719f832ffa8e7227a6fd665ae6ed6b21
BLAKE2b-256 f5a71f137f2f79cda543ce95f5cfd1b53e7d6a9e049600d6ff8aeaf4ce681336

See more details on using hashes here.

File details

Details for the file piopiy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: piopiy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for piopiy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16530ce08e7c17c512231193ee8154a994f6a7050bbf95157a9c143ea7ab0094
MD5 ffa10128ddb36cc01eb82a0bfa540f30
BLAKE2b-256 c64338437e9a09ca83340cd797e4743fde8ff9cd27c6d6a87f104dfa3d54ed4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page