# Reply To Conversation — Intercom

> Reply to an existing Intercom conversation as an admin or on behalf of a contact (POST /conversations/{conversation_id}/reply). Use List Admin ID Options to find a valid Admin ID, and Search Contacts to find a contact's Intercom user ID…

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

## Description

Reply to an existing Intercom conversation as an admin or on behalf of a contact (POST /conversations/{conversation_id}/reply). Use **List Admin ID Options** to find a valid Admin ID, and **Search Contacts** to find a contact's Intercom user ID, email, or external user ID. Example: set **Conversation ID** to `192783634529321`, **Reply Type** to `admin`, **Message Type** to `comment`, **Body** to `Thanks for reaching out!`, and **Admin ID** to `25` to post that comment as an admin reply. [See the documentation](https://developers.intercom.com/docs/references/rest-api/api.intercom.io/conversations/replyconversation).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `conversationId` | `string` | Yes | The Intercom provisioned identifier for the conversation (e.g. 192783634529321). Run List Conversations first to discover one, or reuse the ID from a prior Reply To Conversation, Manage A Conversation, or Retrieve Conversation call's response. If a specific ID isn't known, set this to the literal string last to reply to the most recently updated conversation instead of guessing an ID. |
| `replyType` | `string` | Yes | Who the reply is from. Select user (Contact Reply) to reply on behalf of a contact, or admin (Admin Reply) to reply as an admin. |
| `messageType` | `string` | No | The type of the message. Use comment for a standard reply (valid for both admin and contact replies). Use note for an internal note (valid only for admin replies). Defaults to comment. |
| `body` | `string` | Yes | The text body of the reply. |
| `adminId` | `string` | No | The ID of the admin sending the reply (required when Reply Type is admin). Run List Admin ID Options first to discover valid admin IDs (e.g. 9876543). |
| `replyOnBehalfOf` | `string` | No | When Reply Type is user, selects which contact identifier field to send. Choose intercom_user_id, email, or user_id, then populate the matching prop below. Run Search Contacts first to find a contact's identifiers. |
| `intercomUserId` | `string` | No | The Intercom user ID of the contact (used when Reply On Behalf Of is intercom_user_id). Run Search Contacts first to find a contact's id (e.g. 6762f1571bb69f9f2193bbbb). |
| `email` | `string` | No | The email of the contact (used when Reply On Behalf Of is email). Run Search Contacts first to find a contact's email (e.g. jane.doe@example.com). |
| `userId` | `string` | No | The external user ID of the contact (used when Reply On Behalf Of is user_id). Run Search Contacts first to find a contact's external_id. |
| `attachmentUrls` | `string[]` | No | A list of image URLs that will be added as attachments. You can include up to 10 URLs. |

## 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-reply-to-conversation",
  arguments: {
    conversationId: "Conversation ID",
    replyType: "Reply Type",
  },
})
```

**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-reply-to-conversation",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    intercom: { authProvisionId: "apn_xxxxxxx" },
    conversationId: "Conversation ID",
    replyType: "Reply Type",
  },
})

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-reply-to-conversation",
    "configured_props": {
      "intercom": { "authProvisionId": "apn_xxxxxxx" },
      "conversationId": "Conversation ID",
      "replyType": "Reply Type"
    }
  }'
```

---

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