← All integrations

Send SMS from n8n

n8n has no NS SMS node, and it does not need one: the HTTP Request node sends the SMS and the Webhook node receives the delivery status. It works the same on n8n Cloud and on a self-hosted instance.

Who this is for

  • Teams that automate orders, leads or bookings in n8n and want an SMS step.
  • Self-hosters who prefer sending from their own SIM card to a paid SMS provider.

Before you start

  • An Android phone (8.0 or newer) with a SIM card that can send SMS.
  • The NS SMS app from Google Play, set as the default SMS app, with "Accept API requests" turned on in the API tab.
  • Your phone ID (device_id) and API key (nss_...) from the API tab. Below they appear as YOUR_DEVICE_ID and nss_YOUR_API_KEY.
  • An n8n workflow with a trigger that provides the phone number (form, CRM, database, schedule...).

No account, email or password. Install the app, turn on the API and copy your phone ID and API key.

Setup, step by step

  1. Step 1.Add an HTTP Request node

    Add an HTTP Request node after your trigger and fill it in as below. With Header Auth the key is stored as an n8n credential, so it does not show up in the workflow JSON or in shared screenshots.

    HTTP Request node
    Method:             POST
    URL:                https://sms-api.n-soft.pl/v1/sms/send
    Authentication:     Generic Credential Type
    Generic Auth Type:  Header Auth
      Name:             Authorization
      Value:            Bearer nss_YOUR_API_KEY
    Send Body:          on
    Body Content Type:  JSON
    Specify Body:       Using JSON
  2. Step 2.Paste the JSON body

    Switch the JSON field to Expression and paste the body. $json is the item coming from the previous node, so change phone and name to your own field names. JSON.stringify escapes quotes and new lines in the text.

    JSON (expression)
    {
      "device_id": "YOUR_DEVICE_ID",
      "to": "{{ $json.phone }}",
      "text": {{ JSON.stringify("Hi " + $json.name + ", your order has shipped.") }}
    }

    Prefer no expressions? Choose Specify Body: Using Fields Below and add device_id, to and text as three fields.

  3. Step 3.Run the node

    Execute the step. A 202 response with an id and status accepted means the phone has the order and will send the SMS within seconds.

  4. Step 4.Many recipients

    n8n calls the node once per item. To stay under 30 requests a minute, open Options > Batching and send 1 item every 2,000 ms. Or send one request with to as a list of up to 100 numbers when everyone gets the same text.

Check the status and receive webhooks

The send request answers 202 with a message ID right away. The status then moves through received (the phone has it), sent and delivered, or failed with an error code. You can ask for it with GET /v1/sms/{id}, or let the server POST every change to a webhook address that you set in the app (API tab). Webhooks work on every plan and also report usage.warning, usage.limit_reached, device.offline and device.online.

To read the status later, add another HTTP Request node with Method GET, URL https://sms-api.n-soft.pl/v1/sms/{{ $json.id }} and the same Header Auth credential.

For webhooks, create a second workflow that starts with a Webhook node. Copy its Production URL into the NS SMS app (API tab, webhook address) and activate the workflow; the Test URL only works while the editor is listening.

Webhook node
HTTP Method:     POST
Path:            keep the random path n8n generates
Authentication:  None
Respond:         Immediately

The event is in the body of the webhook output. Route it with a Switch node on the event field:

expressions in the next nodes
{{ $json.body.event }}           sms.status, usage.warning, usage.limit_reached,
                                 device.offline or device.online
{{ $json.body.sms.id }}          message ID from the send response
{{ $json.body.sms.status }}      received, sent, delivered, failed ...
{{ $json.body.sms.error_code }}  for example no_service (failed only)

The Webhook node does not check the X-NS-Signature header by itself. The random path works as a secret; for a strict check, verify the HMAC in your own code as shown in the language guides.

Troubleshooting

  • "JSON parameter needs to be valid JSON": usually a quote or a line break inside the text. Use JSON.stringify as above or Using Fields Below.
  • No webhook calls arrive: the address must be public HTTPS (not localhost), it must be the Production URL, and the workflow must be active.
  • 401 unauthorized: the Authorization header must be "Bearer " followed by the key, and device_id must belong to that key.
  • 403 api_disabled: open the app and turn on "Accept API requests" in the API tab.
  • 422 validation_failed: the number must be in international E.164 format, with + and the country code (for example +14155550123), and the text at most 1,600 characters.
  • 429: more than 30 requests a minute, or the daily or monthly cap of your plan (Free 50 a day, Pro 500, Business 1,000). The response says which one.

SMS API reference → SMS error codes → Plans and daily limits →

Use cases for n8n

Other integrations