curl -sS -X POST 'https://matrix.example.com/_matrix/client/v3/rooms/!abc123:example.com/leave' -H "Authorization: Bearer $ACCESS_TOKEN"
Leave a room as the logged-in user
Sets the authenticated user's membership to leave, removing them from the room's member list. The room stays visible in the account until it is forgotten, so leave then forget to fully clean up. Admins removing other users use the kick endpoint instead. Leaving does not delete your message history in the room.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.