# Send SMS

The **Send SMS** action node sends a custom text message to a given recipient via SMS.

{% hint style="info" %}
An example setup of Send SMS is showcased in our [Showroom](https://showroom.appfarm.app/action-nodes/send-sms)! You may view a demo, as well as access the setup in Appfarm Create. If you do not have access, you may register [here](https://showroom.appfarm.app/sign-up).
{% endhint %}

{% hint style="warning" %}
Each Appfarm solution has settings for Daily and Monthly SMS limits, meaning an upper limit on the number of SMSs sent daily and monthly. When this occurs, the Send SMS action node will throw a DailyQuotaExceededException or MonthlyQuotaExceededException. Read more on exception handling and error codes [here](broken://pages/AMMceAaE4MEu0QouE4zl#defined-errors).\
\
By default, the limit is 50 messages per day and 500 per month. *You may increase the limit by contacting Appfarm.*
{% endhint %}

## Usage

Appfarm uses [GatewayAPI](https://gatewayapi.com) to deliver SMS messages.

The sending of SMS messages is subject to Appfarm's SMS usage policy. Sent messages are charged according to the price schedule laid out in your customer agreement. The total number of SMS messages sent from a solution is available under Resource Usage Overview on the [Dashboard](/reference/dashboard.md).

## Validation

Appfarm does not validate the recipient's number before attempting to send the message. It is your responsibility to verify that the number is in the correct format. The number should include the country code and adhere to the [MSISDN](https://gatewayapi.com/docs/glossary/#msisdn) format.

## Settings

### Sender

Set the sender's name. This value can be up to 11 characters long.

We recommend using the name of your business or service. If no value is set, the short name of the solution will be used.

* Using human names or phone numbers is not allowed
* Leading or trailing whitespace will be stripped
* Multiple whitespace characters within text will be replaced with a single space
* If the provided name is longer than 11 characters, it will be trimmed
* The string must otherwise adhere to the regex `^[a-zA-Z0-9_\-øæåÆØÅ!]+( [a-zA-Z0-9_\-øæåÆØÅ!]+)*$` (all Nordic characters, numbers, -, \_ and !)

{% hint style="warning" %}
Some countries have local restrictions on Sender for SMSs not originating from a personal phone number, which is the case when using Send SMS from Appfarm. Singapore (+65) has introduced such a restriction, and we are working on a solution to this.&#x20;
{% endhint %}

### Message

Set the message to be sent. The message can be a static text string, a property value from a data binding, or the return value of a function.

You can send a message of any length, but messages of more than 160 characters will be split into separate messages of 153 characters each.

All characters included in the [GSM 03.38 standard](https://en.wikipedia.org/wiki/GSM_03.38) are supported. If you use any character *outside* of this range, such as emojis or other non-Western characters, the message will be automatically transcoded to ensure proper delivery. This will take up significantly more of the character limit and potentially increase delivery costs.

If you include a URL in the message body, first generate a shortlink with the **Create Shortlink** action node. This uses Appfarm's link shortener service, af.link. Links to other domains in the message body will, in some cases, be blocked by the SMS service provider.

{% hint style="success" %}
To check the length of your message, you may use tools such as the [SMS Length Calculator](https://codepen.io/thedoctor46super/pen/qGOYLg).
{% endhint %}

### Broadcast

Check this box to send to multiple recipients at once. Selecting Broadcast enables further options in order to select the recipients.

### Single Recipient

Set the recipient's phone number. The value must be a string. It can be a static text string, a property value from a data binding, or the return value of a function.

The country code (e.g., 47) must be prefixed to the number, but a leading + is not required.

### Recipient Data Source

*Visible only if Broadcast is checked.*

Select the data source that contains the recipients you wish to send the message to.

### Selection

*Visible only if Broadcast is checked.*

Select specific objects to use or apply filters to the data source.

### Phone Number Field

*Visible only if Broadcast is checked.*

Select the field from the data source that contains the recipient's phone number. The value must be a string. The country code (e.g., 47) must be prefixed to the number, but a leading + is not required.

### Tags

Add one or more tags. Tags are useful for later filtering SMS logs, particularly if you are using Send SMS for several different use cases in the same solution.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appfarm.io/library/action-nodes/send-sms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
