# Make Phone Call — 46elks

> Dials and connects two phone numbers using the 46elks service. See the documentation

- Key: `_46elks-make-phone-call`
- 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/make-phone-call
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/_46elks/actions/make-phone-call/make-phone-call.mjs

## Description

Dials and connects two phone numbers using the 46elks service. [See the documentation](https://46elks.com/docs/make-call)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `from` | `string` | Yes | The phone number initiating the call. 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 call. The phone number of the recipient, in E.164 format. Options are loaded from the connected account. |
| `voiceStart` | `string` | Yes | A webhook URL that returns the first action to execute. See Call actions for details. It is also possible to add a JSON struct for direct call actions without any logic, like: {"connect":"+46700000000"}. |
| `timeout` | `integer` | No | Seconds to wait for the to-number to pickup before stopping call. Eg. 60 |

## 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-make-phone-call",
  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-make-phone-call",
  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-make-phone-call",
    "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
