# Send SMS — 46elks

> Composes and sends an SMS message to a specified phone number. See the documentation

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

## Description

Composes and sends an SMS message to a specified phone number. [See the documentation](https://46elks.com/docs/send-sms)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `from` | `string` | Yes | The phone number initiating sending the SMS message. A valid phone number in E.164 format. Can be one of your voice enabled 46elks numbers, the phone number you signed up with, or an unlocked number. Options are loaded from the connected account. |
| `to` | `string` | Yes | The phone number receiving the SMS message. The phone number of the recipient, in E.164 format. Options are loaded from the connected account. |
| `message` | `string` | Yes | The text of the SMS message to send |
| `whendelivered` | `string` | No | This webhook URL will receive a POST request every time the delivery status changes. |
| `flashSms` | `boolean` | No | Send the message as a Flash SMS. The message will be displayed immediately upon arrival and not stored. |
| `dontLog` | `boolean` | No | Enable to avoid storing the message text in your history. The other parameters will still be stored. |

## 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": "_46elks",
      },
    },
  },
)

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: "_46elks-send-sms",
  arguments: {
    from: "From Phone Number",
    to: "To Phone Number",
  },
})
```

**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: "_46elks-send-sms",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    _46elks: { authProvisionId: "apn_xxxxxxx" },
    from: "From Phone Number",
    to: "To Phone Number",
  },
})

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": "_46elks-send-sms",
    "configured_props": {
      "_46elks": { "authProvisionId": "apn_xxxxxxx" },
      "from": "From Phone Number",
      "to": "To Phone Number"
    }
  }'
```

---

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