Room membership

Invite a user to participate in a particular room.

Note that there are two forms of this API, which are documented separately. This version of the API requires that the inviter knows the Matrix identifier of the invitee. The other is documented in the third-party invites section.

This API invites a user to participate in a particular room. They do not start participating in the room until they actually join the room.

Only users currently in a particular room can invite other users to join that room.

If the user was invited to the room, the homeserver will append a m.room.member event to the room.

post/_matrix/client/v3/rooms/{roomId}/invite

Request

Path parameters

roomIdstring mx-room-id required

The room identifier (not alias) to which to invite the user.

Request body

reasonstring

Optional reason to be included as the reason on the subsequent membership event.

user_idstring mx-user-id required

The fully qualified user ID of the invitee.

Example request

{
  "reason": "Welcome to the team!",
  "user_id": "@cheeky_monkey:matrix.org"
}

Response

The user has been invited to join the room, or was already invited to the room.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.