Early access: these interfaces are documented as drafts. Confirm commands, packages and endpoints with us before use.

CLI

Installation, login and every command of the command line tool.

Installation

npm install -g @trunkbeam/cli

Or run it without installing via npx @trunkbeam/cli. Requires Node.js 20 or newer.

Log in

trunkbeam login

login opens the browser to confirm. On servers without a browser, set the environment variable instead:

export TRUNKBEAM_API_KEY=tb_live_…

Keep several accounts apart with profiles, for example trunkbeam login --profile client-a and then --profile client-a on every command.

Global options

OptionEffect
--jsonJSON output for scripts
--yesSkip confirmations, for example when buying
--profile <name>Use another account
--helpHelp for any command

Commands

CommandWhat it does
signupCreate an account
login, logoutLog the CLI in or out
statusVerification status of your account
verify --docs <file>Submit documents
addresses list, addresses addAddresses for more area codes
numbers search --area <code>Search available numbers
numbers buy <number> --sip <uri>Buy a number and connect it
numbers listYour numbers with status
numbers update <number> --sip <uri>Change the target
numbers release <number>Cancel a number at month end
transfer allow <number> --to <targets>Allowed targets for SIP REFER
trunks create --name <name>Credentials for outbound calls
calls listRecent calls with duration and cost
pricesCurrent price list
usage --month <YYYY-MM>Usage and cost for a month
keys create, keys list, keys revokeManage API keys

In scripts

With --json and --yes nothing asks for confirmation. Example: get a number in the right area code for every new customer.

number=$(trunkbeam numbers search --area 089 --json | jq -r '.[0].number')
trunkbeam numbers buy "$number" --sip "sip:customer-42@voice.example" --yes --json

Exit codes

CodeMeaning
0Success
1General error
2Invalid input
3Not logged in or invalid key
4Account not approved yet
5Spend limit reached
Connect your stack to TrunkBeam