For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
cXMLREST API
cXMLREST API
  • Core
    • Compatibility API
    • cXML Specification
  • Guides
    • Compatibility API Webhooks
    • Receive SMS
    • Send SMS
    • Inbound Fax Callback
    • Add mustache template parameters to cXML responses
    • Gathering user input
  • Voice
    • Overview
    • Conference
    • Connect
    • Denoise
    • Dial
    • Echo
    • Enqueue
    • Gather
    • Hangup
    • Leave
    • Number
    • Pause
    • Pay
    • Play
    • Queue
    • Record
    • Redirect
    • Refer
    • Reject
    • Room
    • Say
    • Sip
    • Sms
    • Stream
    • Verto
    • VirtualAgent
  • Messaging
    • Overview
    • Message
    • Redirect
  • Fax
    • Overview
    • Receive
    • Reject
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Your API Credentials
  • Obtaining a number
  • Sending a message
  • Installation
  • Sending
Guides

Sending your first SMS

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

Callback for inbound fax

Next
Built with

Let’s get you started by sending your first SMS. In this guide we are going to use Compatibility APIs: if you are migrating from a different provider, these APIs will likely be very similar.

Your API Credentials

To send messages, make phone calls, and programmatically control video rooms, you need API credentials. Find these in your SignalWire Space, within the “API” tab on the left sidebar. If this is the first time you are using API credentials, you will need to create an API token.

The API page.

You can find your Project ID, Space URL, and API Token from the API tab in your SignalWire Space. Make sure your token has the necessary scopes enabled.

In the “API” section you will find all the information you’ll need. In particular:

  • Your Project ID (e.g., 7b981d06-fa9e-XXXX-XXXX-XXXXXXXXXXXX)
  • Your Space URL (e.g., yourname.signalwire.com)
  • Your API Token (e.g., PTda745ebXXXXXXXXXXXXXXXXXXXXXX)

The API Token is confidential: keep it private.

Obtaining a number

Log in to your SignalWire Space. From the Phone Numbers section, you can buy a new phone number if you don’t have one already. You will need at least one number to send and receive messages.

Make sure the number you are buying supports SMS messaging, and you’re good.

You can also port an existing phone number from another provider.

Sending a message

Let’s see how to send your first message. You have a few different options: you can trigger an HTTP request yourself (using cURL or the dedicated functions in your preferred programming language), or you can use one of our SDKs. We’ll show examples for both methods.

Installation

$> Refer to https://everything.curl.dev/install
$
$```bash title="Node.js"
>
>```bash
$npm install @signalwire/compatibility-api

Once your environment is set up, you can proceed with your first API call.

Sending

To send a message, you can use the Create a Message endpoint from our Compatibility APIs.

If you are sending messages to the US from a 10DLC number, you must register your traffic with the Campaign Registry. Otherwise, the carriers will not deliver your messages. Please see Campaign Registry - Everything You Need To Know for more information.

Let’s see how to send a message with a REST API call:

$curl "https://$SPACE_URL/api/laml/2010-04-01/Accounts/$PROJECT_ID/Messages" \
> -X POST \
> -u "$PROJECT_ID:$API_TOKEN" \
> --data-urlencode "From=$FROM_NUMBER" \
> --data-urlencode "To=$TO_NUMBER" \
> --data-urlencode 'Body=Hello'

Make sure to replace all placeholders with your own values.

This example used the Compatibility API, and in particular the Compatibility REST API, to send a message.