# Send Incoming Message — Intercom

> Creates a new inbound conversation in Intercom on behalf of a contact (POST /conversations). The action first fetches the contact's role via GET /contacts/{id} to set the correct message sender type — this counts as an additional API call…

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

## Description

Creates a new inbound conversation in Intercom on behalf of a contact (POST /conversations). The action first fetches the contact's role via **GET /contacts/{id}** to set the correct message sender type — this counts as an additional API call. Use **Search Contacts** to find valid contact IDs before calling this action. Example: set **User** to `63a07ddf05a32042dffac965` and **Body** to `Hi, I need help with my order` to open a new conversation from that contact. Returns the new conversation object including `id`. [See the documentation](https://developers.intercom.com/intercom-api-reference/reference/create-a-conversation)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `userId` | `string` | Yes | The user initiating the conversation |
| `body` | `string` | Yes | The content of the message |

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

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: "intercom-send-incoming-message",
  arguments: {
    userId: "User",
    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: "intercom-send-incoming-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    intercom: { authProvisionId: "apn_xxxxxxx" },
    userId: "User",
    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": "intercom-send-incoming-message",
    "configured_props": {
      "intercom": { "authProvisionId": "apn_xxxxxxx" },
      "userId": "User",
      "body": "Body"
    }
  }'
```

---

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