Skip to content

CLI quickstart

You'll end up with: a rented phone number and an SMS sent to your own phone. No code, no deploys, just the CLI.

Prerequisites

  • Sinch CLI installed: npm install -g @sinch/cli
  • A Sinch account with a Project ID, API key, and API secret (find them in the Sinch Dashboard under your project's Access Keys)
  • For Step 3: a Conversation App with an SMS channel. sinch conversation send sends through one, and only on the channels the app has configured.

If you have not done the install, see Installation.

Step 1 — Log in

sinch auth login

The CLI prompts for your Project ID, Key ID, and Key Secret. These are stored in your OS keychain (not in a config file) so they don't leak into shell history or source control.

After the credentials, auth login asks one optional follow-up:

  • Install Sinch developer skills for AI coding assistants? — installs Sinch skills for AI coding tools (Claude, Cursor, etc.). Optional.

Verify the login worked:

sinch auth status

You should see your Project ID printed.

Step 2 — Find and rent a number

sinch numbers available search --region US --type LOCAL --capabilities SMS

Region is an ISO country code (US, GB, SE, …). Type is one of LOCAL, MOBILE, or TOLL_FREE. Capabilities take one or more of SMS and VOICE; leave the flag out and the CLI asks.

The CLI asks for an optional digit pattern, then shows a picker of available numbers with their cost. Picking a number does not rent it yet (choose Exit without selecting to leave without picking one). It then asks:

  • Configure SMS for this number? Answer Yes (the default is No) and pick the SMS service plan. The list shows only plans already set on numbers in your project; for another plan, choose Enter ID manually and paste its ID from the Sinch Dashboard. With no plans to list, the CLI asks for the ID directly. For a US number it also offers a 10DLC campaign: to attach one later, leave the campaign ID blank (from the list, choose Enter ID manually first).
  • Voice configuration: None is fine for this quickstart.
  • Callback URL for provisioning events: optional.
  • Rent <number>? This will activate it on your project. (default Yes). Nothing is rented until you answer Yes here.

The CLI then tries to rent the number. If Sinch rejects the rental and the number needs supporting documentation, the CLI places an order instead, and the number is not active until that order is approved. Otherwise it is active right away:

sinch numbers active list

Already know the number you want? sinch numbers available rent asks you to type it in E.164 format and then runs the same questions.

Step 3 — Send an SMS

sinch conversation send takes the recipient and message as positional arguments. It sends through a Conversation App: pass --app <app-id>, or it uses your saved default, or it asks you to pick an app and offers to save it. Without --channel, it asks which of the app's channels to use.

sinch conversation send +15559876543 "Hello from the Sinch CLI!" --app <app-id> --channel SMS

To send on another channel the app has, change --channel:

sinch conversation send +15559876543 "Hi on WhatsApp!" --channel WHATSAPP

The command uses the Sinch Conversation API, so WhatsApp, Messenger, Viber, and other channels all work the same way as long as your Conversation App is configured for them.

Step 4 — Try the other APIs

Some things you can do from here without writing code:

# Send a fax (needs a fax service first: sinch fax services create)
sinch fax send --to +15559876543 --file invoice.pdf

# List your SIP trunks
sinch sip trunks list

# Store an API key in the keychain so a deployed Function can use it
sinch secrets add STRIPE_SECRET_KEY sk_live_abc123

# Look at your phone number's configuration
sinch numbers active get +15551234567

Step 5 — Release the number (optional)

If you rented a number just to test, release it so you are not billed for it:

sinch numbers active release +15551234567

What's next

  • Deploy a Function — host voice or messaging logic that Sinch calls whenever something happens on your number.
  • Architecture — how the CLI, Sinch platform, and your Function fit together.
We'd love to hear from you!
Rate this content: