# Send SMS — kwtsms

> Sends an SMS to a specified number. See the documentation

- Key: `kwtsms-send-sms`
- Type: Action (Write)
- Version: 0.0.3
- App: kwtsms (`kwtsms`) — https://pipedream.com/apps/kwtsms.md
- This page (HTML): https://pipedream.com/apps/kwtsms/actions/send-sms
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/kwtsms/actions/send-sms/send-sms.mjs

## Description

Sends an SMS to a specified number. [See the documentation](https://www.kwtsms.com/doc/KwtSMS.com_API_Documentation_v37.pdf)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `sender` | `string` | Yes | The sender ID of the SMS message. Use your private senderid or one of ours. SenderID is case sensitive. If Sender ID has spaces, replace them with + sign. Options are loaded from the connected account. |
| `mobile` | `string` | Yes | List of mobile numbers separated by , commas. Characters like +, 00, . or space in numbers are not allowed. |
| `lang` | `integer` | Yes | Language of the SMS message. |
| `message` | `string` | Yes | The content of the SMS message to send. Spaces must be converted to + sign (do not encode), use for new lines. |
| `test` | `boolean` | No | If set to true, the SMS will be sent to handsets, but will be inserted to the queue and can be deleted to recover the credits. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "kwtsms",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "kwtsms-send-sms",
  arguments: {
    sender: "Sender ID",
    mobile: "Mobile",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "kwtsms-send-sms",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    kwtsms: { authProvisionId: "apn_xxxxxxx" },
    sender: "Sender ID",
    mobile: "Mobile",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "kwtsms-send-sms",
    "configured_props": {
      "kwtsms": { "authProvisionId": "apn_xxxxxxx" },
      "sender": "Sender ID",
      "mobile": "Mobile"
    }
  }'
```

---

- App: https://pipedream.com/apps/kwtsms.md · All apps: https://pipedream.com/apps
