> ## Documentation Index
> Fetch the complete documentation index at: https://docsv4.mile.app/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS Gateway

> Send the app's SMS through your own SMS provider: endpoint, method, headers, body and a test message.

By default the app sends SMS, such as [Send SMS](/pages/workflow/automation/actions/notification-sms) automations, through its built-in provider and charges your **Credits** balance. Connect an **SMS gateway** and those messages go through your own provider's HTTP API instead, and use no credit.

You describe your provider's API once: where to send the request, which method, and which headers and body fields to send. The app fills in the phone number and the message each time it sends.

<Note>
  Required permission:

  * View integration
  * Create integration (to connect)
  * Edit integration (to change the gateway)
  * Delete integration (to disconnect)
</Note>

<Note>
  The **SMS gateway** card is offered to selected accounts only. If you don't see it, contact support.
</Note>

## Connect a gateway

Open **Settings › Integration** and click **Connect** on the **SMS gateway** card.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/settings/integration-sms.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=01ab8f2fdf197a99b6cd55d1f436a964" alt="The SMS gateway dialog" width="600" data-path="images/v4/settings/integration-sms.png" />
</div>

1. **Name**: which provider this is, for example the provider's name. Required.
2. **Endpoint**: the full `http://` or `https://` address the app sends each SMS to, as given in your provider's API documentation.
3. **Method**: **POST** (the default), **GET** or **PUT**. With **GET**, the body fields are sent as query parameters on the endpoint.
4. **Headers**: click **Add** for each header your provider needs, such as an API key or `Content-Type`. Each row has a **Name** and a **Value**.
5. **Body**: click **Add** for each field the request carries, such as the recipient, the message and a sender ID.
6. **Test recipient**: a phone number to receive a test message, then **Send a test**.

Click **Save**. The card shows **Connected**.

### Fill in the recipient and the message

In any header or body **Value**, write these placeholders where your provider expects the details of each message. They're replaced every time an SMS is sent:

| Placeholder | Replaced with |
| - | - |
| `{recipient}` | The phone number the SMS goes to. |
| `{message}` | The text of the SMS. |

For example, a provider that expects `to`, `text` and `from` fields gets three body rows:

| Name | Value |
| - | - |
| `to` | `{recipient}` |
| `text` | `{message}` |
| `from` | `YOURBRAND` |

The body is sent as JSON. If your provider expects a form instead, add a header **Name** `Content-Type` with **Value** `application/x-www-form-urlencoded`.

### Keep keys hidden

Each header and body row has a **Secret** checkbox. Tick it for API keys, passwords and tokens: the value is masked while you type and is **hidden once saved**, so nobody can read it back from the dialog later. To change a secret, type the new value.

Use **Remove** to delete a row.

## Send a test

Before you rely on the gateway, check that your provider accepts the request:

1. Type a phone number in **Test recipient**, for example `+62 812 3456 7890`.
2. Click **Send a test**. The button works once **Endpoint** is a full `http://` or `https://` address.

The test uses what is in the dialog right now, so you can test before saving. *Test message sent to …* means your provider accepted it; check that the phone received it. *The test message did not go through* means your provider refused the request: check the endpoint, method, headers and body against your provider's documentation.

## Change or disconnect the gateway

* Click **Edit** on the card to change any field, then **Save**. The toast *SMS gateway updated* confirms it.
* Click **Disconnect** and confirm to remove the gateway. SMS goes back through the built-in provider and uses **Credits** again. Automations don't need to change.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.