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

# SMS via NetSapiens

> Let your agent text callers and read their replies using an SMS-enabled DID on your NetSapiens platform.

The NetSapiens SMS functions let an agent text a caller during a call and check whether the caller has texted back. Messages go out through your own NetSapiens platform, from the SMS number assigned to the agent's extension, not from a Telzino number.

There are two functions:

* **Send SMS**: texts the caller, or another number the caller gives. It sends from the agent's own SMS number.
* **Check SMS Replies**: reads texts sent to the agent's SMS number since the call started.

<Note>
  This is a different feature from the [Send SMS](/functions/send-sms) function, which sends through Telzino/Twilio numbers. Use this page if your DIDs and SMS are hosted on NetSapiens.
</Note>

## Before you start

You need all three of the following. If any one is missing, the functions won't appear or the agent can't send.

1. **An SMS-enabled DID on NetSapiens, routed to the agent's extension.** In NetSapiens, the DID's SMS number must have its destination set to the extension the AI agent uses, and it must have a carrier assigned. Telzino looks up the sender number by that extension. On the v2 API, an SMS number without a carrier is ignored. Carrier registration (for example 10DLC brand and campaign approval in the US) is handled between you and your SMS carrier.
2. **The NetSapiens integration enabled for your account.** If the NetSapiens card doesn't appear on the agent's **Integrations** page, contact Telzino support or your partner/reseller to have it enabled.
3. **NetSapiens API credentials** for a user with **Domain Manager** or higher access in the agent's domain.

## Step 1: Connect the agent to NetSapiens

1. Open the agent and go to its **Integrations** page.
2. Click the NetSapiens card. Your platform may show it under your own UCaaS brand name.
3. Fill in the form:
   * **API Version**: choose **v2** only if you know your platform supports the NetSapiens v2 API. If you're unsure, start with **v1**, as the form suggests. Both versions support sending and reading SMS (see [v1 and v2 differences](#v1-and-v2-differences)). The v1 warning in the form, which says chat and message-session tools will be hidden, refers to the chat tools. The SMS functions still work on v1.
   * **URL** (labelled with your platform's name): your NetSapiens API host, for example `https://core1.example.com`. `/ns-api/` is added automatically if it's missing.
   * **Username** and **Password**: the Domain Manager (or higher) credentials.
   * **Domain**: the NetSapiens domain the agent lives in. This is pre-filled from your session.
   * **Advanced (Client ID / Secret)**: leave these blank unless your platform needs manually issued OAuth credentials. They're normally detected automatically.
4. Save. Telzino checks the credentials against your platform before saving and shows an error if they're rejected.

The agent's extension is filled in automatically from the agent's own NetSapiens user. That extension is what Telzino uses to find the agent's SMS number.

<Tip>
  If your reseller already saved NetSapiens credentials, the form tells you so. You can leave **Password** and **Client Secret** blank to inherit them.
</Tip>

## Step 2: Add the SMS functions to the agent

1. Open the agent editor and add a function.

2. The NetSapiens functions only appear after Step 1 is saved. They're grouped under your NetSapiens platform's name. Pick **Send SMS**, **Check SMS Replies**, or both from that group.

   <Warning>
     The function list can also show a separate **Send SMS** outside that group. That one is the Twilio [Send SMS](/functions/send-sms) function and won't send from your NetSapiens DID.
   </Warning>

3. Write instructions telling the agent when to use each function, then save the agent.

### Example instructions

**Send SMS**

```plaintext theme={null}
When the caller asks for our address or booking link, offer to text it to them.
Once they agree, send: "Book online at https://example.com/book. Reply here if you have questions."
```

**Check SMS Replies**

```plaintext theme={null}
After you text the caller a form link, if they say they've replied or sent the information,
check for their SMS reply and confirm what they sent.
```

## How the functions behave

**Send SMS**

* If no destination is given, the text goes to the caller's own number. The agent is instructed to text a different number only when the caller gives one. This is guidance to the agent, not a hard restriction. The per-call limit below applies either way.
* The sender is always the SMS number assigned to the agent's extension in NetSapiens.
* There's a limit of **3 texts per call**, so the agent can't be talked into sending bulk messages.
* Sending MMS (pictures or files) isn't supported.

**Check SMS Replies**

* Only returns messages received **during the current call**, so older conversation history is never mistaken for a new reply.
* Returns the sender, the message type, the time, and the message text. Each message's text is shortened to its first 200 characters.

## v1 and v2 differences

| | v2 API | v1 API |
| - | - | - |
| Send SMS | Supported | Supported |
| Check SMS Replies | Supported. Replies arrive in real time through a NetSapiens message subscription, with polling as a backup. | Supported through polling only |

On v2, whenever an agent with **Check SMS Replies** takes a call, Telzino checks for your domain's message subscription and creates it if it's missing. You don't need to set it up yourself.

## Availability controls

Partners and resellers control these functions for each organization in [Feature Administration](/admin-guide/dashboard/feature-administration). Each function has its own setting:

* **NS Send SMS** controls the Send SMS function.
* **NS Check SMS Replies** controls the Check SMS Replies function.

Both also depend on the **Netsapiens** integration setting. Locking the integration locks both SMS functions, along with every other NetSapiens function. Partners and resellers can lock or unlock the two SMS settings, but only a partner can lock or unlock the **Netsapiens** integration.

When a function is locked for an organization:

* It still appears in the agent editor, but it's disabled and marked **Locked by your provider**.
* Saving an agent that adds it is refused. The agent editor shows a message such as "NS Send SMS is not available for this organization." The Telzino API returns `403 forbidden` and lists the blocked features, for example `Feature(s) not available for this organization: integration.netsapiens, ns.send_sms`.
* Agents that already have the function keep using it on calls, and it stays editable and removable.

## Troubleshooting

| What you see | What it means | What to do |
| - | - | - |
| No NetSapiens card on the **Integrations** page | The NetSapiens integration isn't enabled for your account, or it's locked for your organization | Contact Telzino support or your partner/reseller |
| **Send SMS** / **Check SMS Replies** don't appear in the function list | The agent isn't connected to NetSapiens yet | Finish Step 1 |
| The function is shown but disabled with **Locked by your provider** | **NS Send SMS**, **NS Check SMS Replies** or the **Netsapiens** integration is locked for the organization | Ask your partner or reseller to unlock it in Feature Administration. Only a partner can unlock the **Netsapiens** integration |
| Agent says its extension isn't configured | The integration was saved before the agent had a NetSapiens extension | Re-save the integration in Step 1 |
| Agent says SMS isn't provisioned for its extension | No SMS number in NetSapiens has its destination set to the agent's extension with a carrier assigned | Assign an SMS-enabled DID to the agent's extension and set its carrier |
| Agent says SMS is temporarily unavailable because of a phone system error | Telzino couldn't reach the NetSapiens API, or the credentials stopped working | Re-save the integration in Step 1 with valid credentials |
| Agent says the SMS limit was reached | The agent already sent 3 texts on this call | Expected. The limit resets on the next call |


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