# Create Call — Vapi

> Starts a new conversation with an assistant. See the documentation

- Key: `vapi-create-call`
- Type: Action (Write)
- Version: 0.1.2
- App: Vapi (`vapi`) — https://pipedream.com/apps/vapi.md
- This page (HTML): https://pipedream.com/apps/vapi/actions/create-call
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/vapi/actions/create-call/create-call.mjs

## Description

Starts a new conversation with an assistant. [See the documentation](https://docs.vapi.ai/api-reference/calls/create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | No | Name of the new conversation |
| `assistantId` | `string` | No | ID of the assistant to start a conversation with or update Options are loaded from the connected account. |
| `squadId` | `string` | No | ID of the squad to assign to the conversation Options are loaded from the connected account. |
| `phoneNumberId` | `string` | Yes | ID of the phone number to use for the conversation Options are loaded from the connected account. |
| `customerId` | `string` | No | ID of the customer for the conversation |
| `customerNumber` | `string` | No | Phone number to call in E.164 format, e.g. +14155551234. The API requires either this or the customerId prop for outbound phone calls |

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

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: "vapi-create-call",
  arguments: {
    name: "Conversation Name",
    assistantId: "Assistant ID",
  },
})
```

**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: "vapi-create-call",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    vapi: { authProvisionId: "apn_xxxxxxx" },
    name: "Conversation Name",
    assistantId: "Assistant ID",
  },
})

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": "vapi-create-call",
    "configured_props": {
      "vapi": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Conversation Name",
      "assistantId": "Assistant ID"
    }
  }'
```

---

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