Official Python SDK and CLI for interfacing with the Jaxl API. Manage calls, messages, IVRs, devices, teams, payments, campaigns, streaming transcriptions and AI Agents. Built on OpenAPI, it offers both generated API clients and Pythonic wrappers for ease of use.
Project description
Jaxl CLI & Jaxl Python API Client
Use Jaxl from Python code or directly via the jaxl command-line tool.
- Install
- JAXL CLI
- Setup
- Verify API Credentials & Auth Token
- Check Account Balance
- Create an IVR
- Create a hangup IVR
- Configure IVR Options
- List IVRs
- List Purchased Jaxl Numbers
- Assign a Phone Number to IVR by ID
- Place Outgoing Cellular Call with Existing IVR
- Place Outgoing Cellular Call with Ad-hoc IVR
- Dial-out 2-Party Conference with Ad-hoc IVR
- Add External Phone Number to an Active Call
- Add External Phone Number via Another Phone Number to an Active Call
- Add Agent to an Active Call
- Remove External Phone Number from an Active Call
- Remove Agent from an Active Call
- Send Text Prompts (TTS) in an Active Call
- Play Audio File in an Active Call
- Mute a Participant in an Active Call
- Unmute a Participant in an Active Call
- Hold a Participant in an Active Call
- Unhold a Participant in an Active Call
- Get call details
- Receive Call Events via Webhook IVRs
- Realtime Streaming Audio
- Realtime Streaming Speech Segments
- Realtime Streaming Transcriptions per Speech Segment
- AI Agent: Realtime Transcriptions STT ➡️ LLM/MCP ➡️ TTS
- List Subscriptions Payments
- List Consumable Payments
- Jaxl Python SDK
- JAXL HTTP Webhook Protocol
- SDK Documentation
- Status
Install
pip install -U jaxl-python
JAXL CLI
jaxl -h
usage: jaxl [-h] {accounts,apps,calls,campaigns,devices,ivrs,kycs,members,messages,notifications,orgs,payments,phones,teams} ...
Jaxl CLI
positional arguments:
{accounts,apps,calls,campaigns,devices,ivrs,kycs,members,messages,notifications,orgs,payments,phones,teams}
accounts Manage Accounts
apps Manage Apps for Webhooks and Streaming audio/speech/transcriptions.
calls Manage Calls (Domestic & International Cellular, App-to-App)
campaigns Manage Campaigns
devices Manage Devices
ivrs Manage IVRs (Interactive Voice Response)
kycs Manage KYCs
members Manage Members
messages Manage Messages (SMS, WA, RCS, Email, App-to-App)
notifications Manage Notifications (Android, iOS, Web)
orgs Manage Organizations
payments Manage Payments
phones Manage Phones (Landline, Mobile, TollFree)
teams Manage Teams (Managers, Phones)
options:
-h, --help show this help message and exit
Setup
You will require the following to successfully run jaxl command line tool:
JAXL_API_CREDENTIALS: Required to connect with Jaxl API InfrastructureJAXL_API_AUTH_TOKEN: Ensure necessary permissions are added to generated auth token.
Please visit Jaxl Business Website or download the Jaxl Business Android or Jaxl Business iOS mobile application to access your credentials and auth tokens.
Finally, setup following environment variables when trying jaxl command line.
export JAXL_API_CREDENTIALS=/path/to/jaxl-api-credentials.json
export JAXL_API_AUTH_TOKEN="....authentication token...."
Verify API Credentials & Auth Token
jaxl accounts me
Check Account Balance
jaxl accounts balance
Create an IVR
jaxl ivrs create \
--message "Hello, we are calling via Jaxl IVR demo created from CLI"
Create a hangup IVR
This IVR will speak the message and then hangup the call.
jaxl ivrs create \
--message "Hello, we are calling via Jaxl IVR demo created from CLI. Will hang up after speaking this message" \
--hangup
Configure IVR Options
This IVR option uses --next to send user to another IVR or to the same IVR for a "repeat this menu" experience.
jaxl ivrs options configure \
--ivr <IVR ID TO CONFIGURE> \
--input 0 \
--message "Press 0 to repeat this menu" \
--next <NEXT IVR ID>
Use same value for <IVR ID TO CONFIGURE> and <NEXT IVR ID> to complete the "repeat this menu" experience.
One of the CTA key flag must be provided. Allowed CTA keys are:
--next: Send to another IVR--phone: Send to an external phone number--devices: Send to devices by ID--appusers: Send to app users (org employees) by ID--teams: Send to teams by ID
List IVRs
jaxl ivrs list
List Purchased Jaxl Numbers
jaxl phones list
You can also search for a specific purchased number:
jaxl phones list --e164 "+CC<Purchased Jaxl Number>"
Assign a Phone Number to IVR by ID
All incoming calls to this number will send user to the assigned IVR.
jaxl phones ivrs \
--e164 "+CC<Purchased Jaxl Number>" \
--ivr <IVR ID>
Place Outgoing Cellular Call with Existing IVR
Below command will execute the following flow:
- Places a call to <Callee Number>
- When answered sends them to an existing IVR ID
- Once IVR finishes, call continues to CTA returned by IVR
jaxl calls create \
--to "+CC<Callee Number>" \
--from "+CC<Purchased Jaxl Number>" \
--ivr <IVR ID>
Place Outgoing Cellular Call with Ad-hoc IVR
Below command will execute the following flow:
- Creates an Ad-hoc IVR using
--messageand--optionflags - Places a call to
- When answered sends callee to the ad-hoc IVR
- Once IVR finishes, call continues to CTA returned by IVR
jaxl calls create \
--to "+CC<Callee Number>" \
--from "+CC<Purchased Jaxl Number>" \
--message "Hello, we are calling you from MyCompany" \
--option "1=Press 1 for sales:teams=<Sales Team ID>" \
--option "2=Press 2 for HR department:teams=<HR Team ID>
Dial-out 2-Party Conference with Ad-hoc IVR
Below command will execute the following flow:
- Dials out to Doctor first
- When doctor answers the call, they are asked to press 1 when ready
- If doctor presses 1, a second call is placed to the patient
- Ends the call when one but all others have hanged up the call
jaxl calls create \
--to "+CC<Doctors Number>" \
--from "+CC<Purchased Jaxl Number>" \
--message "Hello Doctor, this is a call from MyCompany regarding your appointment with Mr. Patient Name. When ready please, " \
--option "1=Press 1 to connect with the patient:phone=+CC<Patient Number>"
Add External Phone Number to an Active Call
jaxl calls add --call-id 1234 --e164 +CC<Mobile Number>
Add External Phone Number via Another Phone Number to an Active Call
jaxl calls add --call-id 1234 --e164 +CC<Mobile Number> --from-e164 +CC<Purchased Jaxl Number>
Add Agent to an Active Call
jaxl calls add --call-id 1234 --email <someone@mycompany.com>
Remove External Phone Number from an Active Call
jaxl calls remove --call-id 1234 --e164 +CC<Mobile Number>
Remove Agent from an Active Call
jaxl calls remove --call-id 1234 --email <someone@mycompany.com>
Send Text Prompts (TTS) in an Active Call
jaxl calls tts --call-id 1234 \
--prompt "Hello, this text was injected in the middle of an active call"
Play Audio File in an Active Call
jaxl calls play --call-id 1234 --audio /path/to/a/file/on/local/disk/or/public/url
NOTE: Audio file must be in SLIN16 format i.e. 8KHz Mono 16-bit.
Mute a Participant in an Active Call
Mute a specific cellular user in a call.
jaxl calls mute --call-id 1234 --e164 +CC<Mobile Number>
Mute an agent (Jaxl App User) in a call.
jaxl calls mute --call-id 1235 --email <someone@mycompany.com>
Unmute a Participant in an Active Call
Unmute a specific cellular user in a call.
jaxl calls unmute --call-id 1234 --e164 +CC<Mobile Number>
Unmute a specific agent (Jaxl App User) in a call.
jaxl calls unmute --call-id 1235 --email <someone@mycompany.com>
Hold a Participant in an Active Call
Put a cellular user on-hold in a call
jaxl calls hold --call-id 1234 --e164 +CC<Mobile Number>
Put an agent on-hold in a call
jaxl calls hold --call-id 1235 --email <someone@mycompany.com>
Unhold a Participant in an Active Call
Unhold a cellular user in a call
jaxl calls unhold --call-id 1234 --e164 +CC<Mobile Number>
Unhold an agent in a call
jaxl calls unhold --call-id 1235 --email <someone@mycompany.com>
Get call details
jaxl calls get --call-id 1234
Receive Call Events via Webhook IVRs
Webhook IVRs can be used to programatically control the lifecycle of incoming and outgoing calls. Jaxl will invoke configured webhook URL for subscribed call events. Handle the webhook request and use Jaxl SDK to continue and customise the call flows.
To create a webhook IVR, use a https:// URL as --message flag e.g.
jaxl ivrs create --message "https://example.com/jaxl-webhook-ivr"
Next, assign a number to webhook IVR as shown previously under Assign a Phone Number to IVR by ID. Now, all incoming calls on the number will start with webhook before proceeding further.
To control flow of outgoing calls, use webhook IVR ID when placing an outbound call. See Place Outgoing Cellular Call with Existing IVR
See examples directory for working webhook examples.
Realtime Streaming Audio
Refer to examples directory for working streaming audio examples.
Realtime Streaming Speech Segments
Refer to examples directory for working streaming speech segments examples.
Realtime Streaming Transcriptions per Speech Segment
Refer to examples directory for working streaming transcription per speech segment examples.
AI Agent: Realtime Transcriptions STT ➡️ LLM/MCP ➡️ TTS
Refer to examples directory for working AI Agent examples.
List Subscriptions Payments
jaxl payments subscriptions list
List Consumable Payments
jaxl payments consumables total
Jaxl Python SDK
- Jaxl APIs is built upon OpenAPI specification
SDK Example Usage:
from jaxl.api import JaxlSDK
os.environ.setdefault("JAXL_API_CREDENTIALS", "/path/to/jaxl-api-credentials.json")
os.environ.setdefault("JAXL_API_AUTH_TOKEN", "....authentication token...")
sdk = JaxlSDK()
response = sdk.calls.create(to="+CC<Callee Number>", from_="+CC<Purchased Jaxl Number>", ivr=1234)
response = sdk.calls.list(currency=2) # 1=USD, 2=INR
response = sdk.accounts.me()
SDK Documentation
# Clone this repository
git clone git@github.com:jaxl-innovations-private-limited/jaxl-python.git
# Enter cloned repo directory
cd jaxl-python
# Create virtual environment
python3 -m venv .venv
# Activate virtual environment
source .venv/bin/activate
# Install
pip install -e ".[dev,docs]"
# Generate documentation
./docs.sh
# View documentation in browser
open docs/jaxl/index.html
Status
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaxl_python-0.0.45.tar.gz.
File metadata
- Download URL: jaxl_python-0.0.45.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
548c39b56892a0ba4a6ef1f6d4299e14844de88cff11001989cc51497cf148a2
|
|
| MD5 |
e65b3597c9d0ac7ae16b43bb966ddd2a
|
|
| BLAKE2b-256 |
9ea7cfee365a8977868b5befeda52a7e7e5cbc688ff856a78655c7240b4e0fd2
|
File details
Details for the file jaxl_python-0.0.45-py3-none-any.whl.
File metadata
- Download URL: jaxl_python-0.0.45-py3-none-any.whl
- Upload date:
- Size: 277.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00f15ab0c8790324e9dc2def3dab33808e0cc96bb5c5fa00df3fe01004172725
|
|
| MD5 |
9e8c4929065f70dc6896140de6d907e9
|
|
| BLAKE2b-256 |
71fdb0b0ffd8a1bc73fbf2acccee94a81ff848b88bcb1e7a91116f7042855adc
|