# Plain — Pipedream Connect

> Customer support for modern tools. Fast, flexible and extendable.

- API slug: `plain` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Help Desk & Support
- Website: https://plain.com/
- This page (HTML): https://pipedream.com/apps/plain
- Tools: 4 actions · 11 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: plain`

```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": "plain",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Add Customer to Group:
const result = await mcp.callTool({
  name: "plain-add-customer-to-group",
  arguments: {
    customerId: "Customer ID",
    groupKey: "Group Key",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Plain endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://core-api.uk.plain.com/graphql/v1

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9jb3JlLWFwaS51ay5wbGFpbi5jb20vZ3JhcGhxbC92MQ?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```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: "plain-add-customer-to-group",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    plain: { authProvisionId: "apn_xxxxxxx" },
    customerId: "Customer ID",
    groupKey: "Group Key",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (4)

### `plain-add-customer-to-group` — Add Customer to Group (Write)

Adds a customer to a customer group. See the documentation

Full schema: https://pipedream.com/apps/plain/actions/add-customer-to-group.md

### `plain-create-customer-event` — Create Customer Event (Write)

Creates an event with a customer. See the documentation

Full schema: https://pipedream.com/apps/plain/actions/create-customer-event.md

### `plain-create-thread` — Create Thread (Write)

Creates a new thread with a given customer. See the documentation

Full schema: https://pipedream.com/apps/plain/actions/create-thread.md

### `plain-upsert-customer` — Upsert Customer (Write)

Creates or updates customer with customer details. See the documentation

Full schema: https://pipedream.com/apps/plain/actions/upsert-customer.md

## Triggers (11)

### `plain-customer-created` — Customer Created (Instant)

Emit new event when a customer is created.

Full schema: https://pipedream.com/apps/plain/triggers/customer-created.md

### `plain-customer-deleted` — Customer Deleted (Instant)

Emit new event when a customer is deleted.

Full schema: https://pipedream.com/apps/plain/triggers/customer-deleted.md

### `plain-customer-updated` — Customer Updated (Instant)

Emit new event when a customer is updated.

Full schema: https://pipedream.com/apps/plain/triggers/customer-updated.md

### `plain-email-received` — Email Received (Instant)

Emit new event when an email is received.

Full schema: https://pipedream.com/apps/plain/triggers/email-received.md

### `plain-email-sent` — Email Sent (Instant)

Emit new event when an email is sent.

Full schema: https://pipedream.com/apps/plain/triggers/email-sent.md

### `plain-note-created` — Note Created (Instant)

Emit new event when a note is created.

Full schema: https://pipedream.com/apps/plain/triggers/note-created.md

### `plain-thread-assignment-transitioned` — Thread Assignment Transitioned (Instant)

Emit new event when a thread assignment is transitioned.

Full schema: https://pipedream.com/apps/plain/triggers/thread-assignment-transitioned.md

### `plain-thread-created` — Thread Created (Instant)

Emit new event when a thread is created.

Full schema: https://pipedream.com/apps/plain/triggers/thread-created.md

### `plain-thread-label-changed` — Thread Label Changed (Instant)

Emit new event when a thread label is changed.

Full schema: https://pipedream.com/apps/plain/triggers/thread-label-changed.md

### `plain-thread-priority-changed` — Thread Priority Changed (Instant)

Emit new event when a thread's priority is changed.

Full schema: https://pipedream.com/apps/plain/triggers/thread-priority-changed.md

### `plain-thread-status-transitioned` — Thread Status Changed (Instant)

Emit new event when a thread's status is transitioned.

Full schema: https://pipedream.com/apps/plain/triggers/thread-status-transitioned.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
