# Send Text Message — JustCall

> Send a text from your JustCall SMS capabled number. See the documentation

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

## Description

Send a text from your JustCall SMS capabled number. [See the documentation](https://justcall.io/developer-docs/#send_text)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `justcallNumber` | `string` | Yes | JustCall number using which the SMS is to be sent. Please follow the E.164 number format (+141555XXXXX). Options are loaded from the connected account. |
| `body` | `string` | Yes | Enter the content to be sent in the SMS. Maximum character limit for message is 1600. |
| `contactNumber` | `string` | Yes | Number of the contact with country code to which SMS is to be sent. Please follow the E.164 number format. |
| `mediaUrl` | `string` | No | Maximum 10 public links of the media having MIME type should not exceed the cumulative size of 5 MB |
| `restrictOnce` | `string` | No | Set value to Yes to prevent the SMS from being sent to the same receiver in 24 hours. Default value is set to No and allows same SMS to be sent multiple times in 24 hours to the same contact. |
| `scheduleAt` | `string` | No | Enter the date and time (YYYY-MM-DD HH:mm:ss) at which the SMS is to be sent. In case no value is sent, the SMS will be sent out immediately when the API call is made. |

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

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: "justcall-send-text-message",
  arguments: {
    justcallNumber: "JustCall Number",
    body: "Body",
  },
})
```

**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: "justcall-send-text-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    justcall: { authProvisionId: "apn_xxxxxxx" },
    justcallNumber: "JustCall Number",
    body: "Body",
  },
})

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": "justcall-send-text-message",
    "configured_props": {
      "justcall": { "authProvisionId": "apn_xxxxxxx" },
      "justcallNumber": "JustCall Number",
      "body": "Body"
    }
  }'
```

---

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