Skip to main content

Jaxl CLI & Jaxl Python API Client

Use Jaxl from Python code or directly via the jaxl command-line tool.

  1. Install
  2. JAXL CLI
  3. Jaxl Python SDK
  4. JAXL HTTP Webhook Protocol
  5. SDK Documentation
  6. 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 Infrastructure
  • JAXL_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.

Setup

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 --message and --option flags
  • 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

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

pypi version

PyPi Monthly

Python 3.x

Checked with mypy

Release files for jaxl-python 0.0.52

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jaxl-python 0.0.52
File Size Uploaded
jaxl_python-0.0.52.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaxl-python 0.0.52
File Interpreter ABI Platform
jaxl_python-0.0.52-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / jaxl_python-0.0.52.tar.gz

Download URL jaxl_python-0.0.52.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a79d8e9a78ddd9b39ee643b804f4b74de53f26e539c3640c66003e865c7afc74
BLAKE2b-256 checksum
How to use checksums
93baad85808149ec7c9b2f1db28e3c3cefefff8999756b18d3da91ca8a40b5bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / jaxl_python-0.0.52-py3-none-any.whl

Download URL jaxl_python-0.0.52-py3-none-any.whl
Size 302.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9da2f3f3ab82148a0d91bf65fdd5148709a87606e49fc02e9f0a7977f147e7c
BLAKE2b-256 checksum
How to use checksums
f2000f9a7ab9c7d334e5d8a52cb50ff5b6c6d0399796005fee1ffc2452ea9a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.52 This release

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.13

2 release files

0.0.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page