Install, authenticate, and use the CallingBox Python SDK for numbers and calls.
The CallingBox Python SDK wraps the same public /v1 API you see in the API Reference, but gives you a more natural Python interface for managing numbers, creating calls, polling for results, and handling errors.
available = callingbox.numbers.search_available( country_code="US", area_code="415", number_type="local", limit=10,)for number in available: print(number.phone_number, number.monthly_cost_cents)
# List recent callscalls = callingbox.calls.list()# Retrieve a single call by IDcall = callingbox.calls.retrieve("CALL_ID")print(call.status)print(call.result)
The CLI is a first-class interface, not a demo — it supports the full call flow, cursor-paginated calls list / numbers list, JSON output for scripting, and shell completions.See the CLI reference for the full command catalog, auth resolution order, exit codes, and scripting tips.
Manage endpoints and verify signatures with callingbox.webhooks:
from callingbox import Callingboxcb = Callingbox(api_key="sk_live_...")# Create an endpoint (signing_secret is returned once)endpoint = cb.webhooks.create_endpoint( url="https://your-server.com/callingbox-webhook", description="Production CRM sync", enabled_events=["call.completed", "call.failed"],)print(endpoint.signing_secret) # whsec_... — store somewhere secure# Verify an incoming webhookevent = cb.webhooks.construct_event( payload=request.body, # raw bytes sig_header=request.headers["CallingBox-Signature"], secret=os.environ["CALLINGBOX_WEBHOOK_SECRET"],)# event.type, event.data["call"] are now trustworthy# Replay a failed deliverycb.webhooks.redeliver("9c1d9f9e-21a1-4f6d-8fce-bf4a4b8a9e3f")