curl -sS -X PUT 'https://matrix.example.com/_matrix/client/v3/rooms/!abc123:example.com/send/m.room.message/txn1' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"msgtype":"m.text","body":"Hello world"}'

Category: Matrix & Synapse

curl -sS -X PUT 'https://matrix.example.com/_matrix/client/v3/rooms/!abc123:example.com/send/m.room.message/txn1' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"msgtype":"m.text","body":"Hello world"}'

Send a message to a room

Posts a text message to the room using PUT with a unique transaction ID (txn1) so retries do not duplicate the message. The event type m.room.message with msgtype m.text is the standard chat message; m.notice renders as a system-style notice. The response contains the new event ID. Bots use this endpoint to speak in rooms.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.