Webhooks: Forward Incoming SMS Messages to Your System
With webhooks, SureSMS can automatically forward incoming text messages to another system. This is useful when you need to save customer responses or trigger an action without manual intervention.
1. What is a webhook?
A webhook is an automated message sent from one system to another. When a customer replies to your text message, SureSMS automatically forwards the message to your system without you having to log in and retrieve it.
Flow: The customer sends a text message → SureSMS receives it → your system is notified.
For example, you can use webhooks to:
- save a response in a CRM
- Start a flow in Zapier or Make
- record entries for a contest
- create a support ticket
2. You need to take care of this first
- A SureSMS account with a number that can receive text messages. This can be your own virtual number, a hosted SIM, or a code sent to a short number, such as TAXA in 1414.
- A web address—that is, a URL—that can receive the message. It typically comes from the system you want to send the message to, such as Zapier, Make, HubSpot, or your CRM. It can also come from your developer.
- The address must be accessible from the Internet and should preferably begin with https://.
3. How to Set Up the Webhook
- Log in to the SureSMS portal and go to Integrations → Webhooks.
- Click Create a new webhook.
- Select the type in the field Description:
- POST on Incoming SMS (Recommended), if you want to receive data as JSON. It works with most systems.
- GET for incoming messages (recommended), if your system can only receive data contained in the web address itself.
- Enter your web address in URI. The portal provides an example that you should replace with your own address.
- Select from All issues, whether the webhook should apply to all your numbers or just one specific number or keyword. A keyword only matches if it is the first word in the text message.
- If you have selected POST, please fill in POST value. This is the JSON that SureSMS sends to your URL. Use the button Insert a merge field to enter dynamic values. The field can contain a maximum of 1,000 characters.
- Click Gem.
4. Merge Fields
Merge fields are replaced with the correct values when an SMS is received. Here are the most commonly used ones:
| Braid field | Content |
|---|---|
<%bodyjson%> | The SMS text, ready for JSON. Use this in JSON. |
<%body%> | The text message |
<%fromphonenumber%> | Sender's number |
<%receivedbyphonenumber%> | Your number, to which the text message was sent |
<%countrycode%> | Sender's country code |
<%receivedutcdatetime%> | Time of receipt (UTC) |
Use the drop-down menu in the portal to see the full list.
Example: GET
https://ditdomæne.dk/sms?fra=<%fromphonenumber%>&til=<%receivedbyphonenumber%>&tekst=<%body%>
Example: POST
{
"time": "",
"sender": "",
"receiver": "",
"message": ""
}
If the test values are from the sender +4512345678, receives +4587654321 and the text SureSMS Test, the POST example looks like this:
{
"time": "2026-10-23T07:54:00Z",
"sender": "+4512345678",
"receiver": "+4587654321",
"message": "SureSMS test"
}
5. How to Test
a) Click the "Test" button
In the setup window, you can click Test, before you save. SureSMS sends a test request to your address using the test values above. You'll be notified whether it was successful and what HTTP status code your system returned. Any code in the 200 series means it works.
b) Take a real test
Send a text message from your own cell phone to that number. Remember your password, if you use one. Then open the tab Log on the Webhooks page and click Update. Here you can see exactly what was sent, what your system responded with, and when.
c) Don't you have a system in place yet?
You can use a free testing service such as webhook.site. It provides you with a temporary address. Enter the address as URI, send a test text message, and view the message in real time on webhook.site.
6. If it doesn't work
- The test fails with a 400 Bad Request error: Do you use
<%bodyjson%>in JSON? Is the JSON valid, with the correct quotation marks and commas? - The test works, but nothing happens when you send a real text message: Is this the right number? Does the text message start with the password? Has the webhook been deleted?
- Timeout: Your system must respond within a few seconds. Perform any resource-intensive processing afterward, not while SureSMS is waiting for a response.
- Invalid address: The address must begin with http:// or https://.
- Your system is temporarily down: SureSMS tries 3 times at 1-minute intervals.
- Firewall: If you need to allow static IP addresses, you can obtain them by contacting SureSMS.
The webhook is sent immediately after the text message is received. Webhooks do not require a special subscription, but you must be able to receive text messages in some form.
For Developers
- POST is sent via
Content-Type: application/json. The content is exactly the JSON you entered in POST value, with the merge fields replaced. SureSMS does not enforce a fixed format. - With GET, the values are URL-encoded in the address.
- Return a 2xx status code, and perform resource-intensive processing asynchronously.
- Webhooks can also be created via the SureSMS API using the following endpoints:
HookSources,HookSubscribeandHookUnsubscribe. See SureSMS API Documentation For more details.