View as Markdown
Element icon

Element ACTION

Create Room

Create a new room, optionally inviting other users to it right away. Returns the new room's ID, which can be passed into Send Message or Invite User. Set Room Alias Name to give the room a memorable local alias (e.g. thepub becomes #thepub:matrix.org on matrix.org). If you omit Preset, Visibility also picks join rules — public creates an openly-joinable room. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Element account once, then configure and run Create Room from your backend or agent.

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: "element-create-room",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    element: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    topic: "Topic",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Room inputs
Property Type Description
name Name string
The name to display for the room, e.g. Project Discussion.
Optional
topic Topic string
A short description of the room's purpose.
Optional
roomAliasName Room Alias Name string
Local part of the room alias to create on this homeserver, e.g. thepub becomes #thepub:matrix.org if you are on matrix.org. The alias becomes the room's canonical alias. Do not include the leading # or the :homeserver suffix.
Optional
visibility Visibility string
Whether the room is published (public) to the homeserver's room directory or kept unlisted (private). Defaults to private. If preset is omitted, the server also uses this to pick join rules: public maps to public_chat (anyone can join) and private maps to private_chat (invite required). When preset is set, visibility only affects directory listing.
Optional
preset Preset string
Convenience preset that sets sensible defaults for the room's join rules and permissions. private_chat requires an invite to join and gives only the creator elevated permissions; trusted_private_chat also requires an invite but gives every invitee the same power level as the creator; public_chat lets anyone join without an invite. If omitted, the server infers this from visibility.
Optional
roomVersion Room Version string
The Matrix room version to create, e.g. 12. Omit to use the homeserver's default. The server returns M_UNSUPPORTED_ROOM_VERSION if it does not support the requested version.
Optional
invite Invite string[]
Full Matrix IDs of users to invite to the room, e.g. ["@alice:matrix.org", "@bob:matrix.org"].
Optional
isDirect Is Direct Message boolean
Mark this room as a direct message between the creator and the invited user(s), rather than a group room.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
element-create-room
Version
0.0.2
App
Element
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes