# Invite to Mural — Mural

> Share a mural by inviting a user to it. Supply either Email or Username: an email invitation must be accepted by the recipient before they gain access, while inviting by username adds the user to the mural immediately. Users invited to a…

- Key: `mural-invite-to-mural`
- Type: Action (Write)
- Version: 0.0.2
- App: Mural (`mural`) — https://pipedream.com/apps/mural.md
- This page (HTML): https://pipedream.com/apps/mural/actions/invite-to-mural
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/mural/actions/invite-to-mural/invite-to-mural.mjs

## Description

Share a mural by inviting a user to it. Supply either **Email** or **Username**: an email invitation must be accepted by the recipient before they gain access, while inviting by username adds the user to the mural immediately. Users invited to a mural without being members of its room become restricted members, meaning they can open only that mural and cannot create murals in the room. [See the documentation](https://developers.mural.co/public/reference/inviteuserstomural)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workspaceId` | `string` | Yes | The ID of the Workspace. Options are loaded from the connected account. |
| `muralId` | `string` | Yes | The ID of the Mural. Options are loaded from the connected account. |
| `email` | `string` | No | The email address of the user to invite |
| `username` | `string` | No | The username of the user to invite. When inviting by username, the user is immediately added to the mural. |
| `editPermission` | `string` | Yes | The level of access granted to the invited user. Use edit (the default) to let them add and change widgets, as you would for a collaborator contributing to a workshop. Use view for read-only access, as you would when sharing results with a stakeholder who should not alter the mural. |
| `message` | `string` | No | The custom message to be sent in the email invitation |
| `sendEmail` | `boolean` | No | Indicates if the invitation will or will not be emailed. Default value is true. |

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

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: "mural-invite-to-mural",
  arguments: {
    workspaceId: "Workspace ID",
    muralId: "Mural 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: "mural-invite-to-mural",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mural: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: "Workspace ID",
    muralId: "Mural 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": "mural-invite-to-mural",
    "configured_props": {
      "mural": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": "Workspace ID",
      "muralId": "Mural ID"
    }
  }'
```

---

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