Synchronous REST client for managing SignalWire resources, controlling live calls, and interacting with every SignalWire API surface from Python. It needs no WebSocket connection, only standard HTTP requests with automatic connection pooling.
Create a client and call any SignalWire API surface directly:
from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="example.signalwire.com",
)
# Create an AI agent
agent = client.fabric.ai_agents.create(
name="Support Bot",
prompt={"text": "You are a helpful support agent."},
)
# Search for a phone number
results = client.phone_numbers.search(areacode="512")
# Place a call via REST
client.calling.dial(
from_="+15559876543",
to="+15551234567",
url="https://example.com/call-handler",
)The REST client provides:
- Single
RestClientwith namespaced sub-objects for every API - All 37 calling commands: dial, play, record, collect, detect, tap, stream, AI, transcribe, and more
- Full Fabric API: 13 resource types with CRUD + addresses, tokens, and generic resources
- Datasphere: document management and semantic search
- Video: rooms, sessions, recordings, conferences, tokens, streams
- Phone number management, 10DLC registry, MFA, logs, and more
- Shared
requests.Sessionfor connection pooling across all calls - Dict returns: raw JSON, no wrapper objects to learn
These pages cover the client in depth:
- Getting Started: installation, configuration, first API call
- Client Reference: RestClient constructor, namespaces, error handling
- Fabric Resources: managing AI agents, SWML scripts, subscribers, call flows, and more
- Calling Commands: REST-based call control (dial, play, record, collect, AI, etc.)
- All Namespaces: phone numbers, video, datasphere, logs, registry, and more
These examples are in the repository:
- rest_manage_resources.py: create an AI agent, search for a phone number, and place a test call
- rest_datasphere_search.py: upload a document and run a semantic search
| Variable | Description |
|---|---|
SIGNALWIRE_PROJECT_ID |
Project ID for authentication |
SIGNALWIRE_API_TOKEN |
API token for authentication |
SIGNALWIRE_SPACE |
Space hostname (e.g. example.signalwire.com) |
SIGNALWIRE_LOG_LEVEL |
Log level (debug for HTTP request details) |
The client's code lives under the installed package:
signalwire/signalwire/rest/
__init__.py # Public exports: RestClient, SignalWireRestError
client.py # RestClient -- namespace wiring, env var resolution
_base.py # HttpClient, BaseResource, CrudResource, CrudWithAddresses
_pagination.py # PaginatedIterator for list endpoints
namespaces/
fabric.py # 13 resource types + generic resources + addresses + tokens
calling.py # 37 command dispatch methods via single POST
phone_numbers.py # Search, purchase, update, release
video.py # Rooms, sessions, recordings, conferences
datasphere.py # Documents, search, chunks
... and 15 more