Send a state event to the given room.
PUT {{baseUrl}}/rooms/:roomId/state/:eventType/:stateKey
State events can be sent using this endpoint. These events will be
overwritten if <room id>
, <event type>
and <state key>
all
match.
Requests to this endpoint cannot use transaction IDs
like other PUT
paths because they cannot be differentiated from the
state_key
. Furthermore, POST
is unsupported on state paths.
The body of the request should be the content object of the event; the
fields in this object will vary depending on the type of event. See
Room Events for the m.
event specification.
If the event type being sent is m.room.canonical_alias
servers
SHOULD ensure that any new aliases being listed in the event are valid
per their grammar/syntax and that they point to the room ID where the
state event is to be sent. Servers do not validate aliases which are
being removed or are already present in the state event.
Request Body
{"membership"=>"join", "avatar_url"=>"mxc://localhost/SEsfnsuifSDFSSEF", "displayname"=>"Alice Margatroid"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"event_id":"$YUwRidLecu:example.com"}